Pass actions to execute into strategy
strategyshould sometimes listen to outer world, which could say when to buy or sell. Signals come with array of
orderobject with fields:
loadarray of orders before start, execute them in their times and do nothing untill last order will be executed.
How to pass array of order objects into Strategy?
Using params? It's now params.
Using maybe datas array?
You can build an indicator with necessary lines and trade based on it.
This was outlined here: Community - Importing orders #219
The data feed contains the extra data. You then read it directly from the data feed
With separate data you load it into an indicator and check if the timestamp of the data feed matches the next timestamp of the action to be executed. And the indicator may signal with
-1(sell), plus potentially extra lines for
priceand some other things.
As you point out ... you can pass it as a parameter to the strategy and do the check with the trading logic.
The indicator solution seems the cleanest, because it does isolate data and logic.
Done! Thanks for ideas!