This is very thin question of real time fully automated trading.
For example If you are testing strategies on historical data or using WLB for end of day such kind of synchronization or verification
is not needed.
I use pair strategies and instruments i use are liquid - there is always good spread - thanks to market makers.
But if there is no trades during timeframe ( i use 1 minute ) OHLC provided by adapter may not be updated by prices of transactions. If strategy is executed by strategy monitor every minute or by updated new bar in chart i may be in position when 1st symbol in updated but without updated bar in other symchronized symbols ( they certainly will be synchronized but in reality OHLC series wont be actual).
Certainly stop loss and target prices are staying in exchange system.
Now im working on reducing price and other risks of open positions and my provider is giving me the possibility to use best offer and bid (real quotes are different from OHLC).
Unfortunately they are coming in one dimension variables renewed on every execution of strategy.
And im not so friendly with C# and all possibilities of wealthlab.
But i m sure that it is possible to store these prices in some kind of Series - some kind of adding new value on every new execution of strategy.
I suppose if i try to do as follows:
CODE:
Please log in to see this code.
only last prices will be be stored and previuos will be deleted.
Certainly if they were stored it wont be a problem to update Close and other Series or use them directly in indicators.
My question is - how to put it in something like "static" or "global" arrayes or series that wont be deleted on every execution of strategy.