A static strategy is a trade strategy that depends only the market price at each point in time. Such strategies are not very flexible and are not recommended beyond initial experimentations. See Dynamic Strategy for a more flexible implementation.
A static strategy is defined as a single python script with a run_strategy
function as entry point. run_strategy
must accept 2 arguments: price_data
and config
.
price_data: an ordered list of market frames. This contains all available price data read from the inputs.
config: the configuration element under the strategy in the configuration file. This is un-processed and can be used to configure the strategy on-the-fly without modification to the code.
The function should return an iterable collection of orders for each timeframe, aggregated into a list. Therefore, the returned list needs to be the same length as the input list of price data.