scml.scml2020.components.trading
Classes
Base class for all trading strategies. |
|
The agent reactively responds to contracts for selling by buying and vice versa. |
|
A trading strategy that uses prediction strategies to manage inputs/outputs needed |
|
Predicts an amount based on publicly available market information. Falls |
Module Contents
- class scml.scml2020.components.trading.TradingStrategy(*args, **kwargs)[source]
Base class for all trading strategies.
- Provides:
inputs_needed(np.ndarray): How many items of the input product do I need to buy at every time step (n_steps vector). This should be read but not updated by theNegotiationManager.outputs_needed(np.ndarray): How many items of the output product do I need to sell at every time step (n_steps vector). This should be read but not updated by theNegotiationManager.inputs_secured(np.ndarray): How many items of the input product I already contracted to buy (n_steps vector) [out ofinput_needed]. This can be read but not updated by theNegotiationManager.outputs_secured(np.ndarray): How many units of the output product I already contracted to sell (n_steps vector) [out ofoutputs_secured] This can be read but not updated by theNegotiationManager.
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check theBasessection above for all the bases of this component).Requiressection describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- inputs_needed: numpy.ndarray = None[source]
How many items of the input product do I need at every time step
- outputs_needed: numpy.ndarray = None[source]
How many items of the output product do I need at every time step
- inputs_secured: numpy.ndarray = None[source]
How many units of the input product I have already secured per step
- outputs_secured: numpy.ndarray = None[source]
How many units of the output product I have already secured per step
- class scml.scml2020.components.trading.ReactiveTradingStrategy(*args, **kwargs)[source]
Bases:
scml.scml2020.components.SignAllPossible,TradingStrategyThe agent reactively responds to contracts for selling by buying and vice versa.
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check theBasessection above for all the bases of this component).Requiressection describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- class scml.scml2020.components.trading.PredictionBasedTradingStrategy(*args, add_trade=True, **kwargs)[source]
Bases:
scml.scml2020.components.prediction.FixedTradePredictionStrategy,scml.scml2020.components.prediction.MeanERPStrategy,TradingStrategyA trading strategy that uses prediction strategies to manage inputs/outputs needed
- Hooks Into:
- Requires:
expected_inputs(np.ndarray): How many items of the input product do I expect to have every day. Should be adjusted by theTradePredictionStrategy.expected_outputs(np.ndarray): How many items of the output product do I expect to have every day. Should be adjusted by theTradePredictionStrategy.
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check theBasessection above for all the bases of this component).Requiressection describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- class scml.scml2020.components.trading.MarketAwarePredictionBasedTradingStrategy(*args, predicted_outputs: int | numpy.ndarray = None, predicted_inputs: int | numpy.ndarray = None, add_trade=False, **kwargs)[source]
Bases:
scml.scml2020.components.prediction.MarketAwareTradePredictionStrategy,PredictionBasedTradingStrategyPredicts an amount based on publicly available market information. Falls back to fixed prediction if no information is available
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check theBasessection above for all the bases of this component).Requiressection describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.