As I am trying to debug strategy, and I am using multi time frame (with ticks coming very slowly for some particular instrument, at times could be 1 tick in few minutes time), it seems that State.Configure is called at least twice after hitting enabling strategy and hitting "OK" button.
It also seems to be called when trying to disable strategy by opening dialog and unchecking "enable" strategy checkbox.
Based on documentation, I though it would be called only once after hitting "OK" or "Apply" button, but it seems that the "State.Configure" gets called more than once.
Also, State.Terminate seems to be called often as well.
And as I am trying to initialize TriggerCustomEvent within State.Configure in order to call strategy later at specific time (to close position for example at certain time) - it becomes problematic because timer might get initialized twice and hitting at wrong interval etc...
Do you have a sample to create my own timer (maybe sytem.threading) without using TriggerCustomEvent? TriggerCustomEvent seems to work fine when calling from Configure state but doesn't work if calling after strategy reached the State.Realtime...
Thanks
Comment