I want to close a possible open posititon at a time I input into the strategy.
Let's assume that I wan't close any position 20sec before 6 pm. My strategy works with "CalculateOnBarClose = true" and the interval is 8min.
Normally there is no chance to trigger the close with that constellation, right?
My possible solutions are looking as follow:
1. Using a internal Timer and the raising timer event will be checked to close the position.
2. Implementing the code in the callback "OnMarketData"
3. Or Developing a separate timer indicator which has the flag CalculateOnBarClose set to false; And in the ObBarUpdate I check the time and fired a event to the registered strategy. (this way I have implemented) Maybe there are some sideeffects with threadsafe data handling?
Many Thanks....
cicondo
Comment