Is there an alternative solution for the TimerEventProcessor?
This CustomEvents just brings me trouble and does not what it is supposed to do. I am pretty sure I have coded the Timer correctly. All is done by the various examples that are on the forum and the NT support pages. Besides that I have the timer working when I test this to print a line in the output window every timed period. But within the same event an open position has to be closed, which never happens. So a line is printed, but the execution is not processed; weird.
I rather want to skip the whole timer thing, as it brings nothing but hassle, like the "error on triggering custom event ... more than100 subsequent user events.". I have read about every thread about this, but none of them has a fitting solution, where my goal is rather simple:
I want to replace the ExitOnClose with an alternative from within the strategy. ExitOnClose and the strategy are more than once not in sync after a trigger from the ExitOnClose, if it is triggered at all. I want to trade around the clock for the whole week, but exit all positions at the end of the session of my choice. As the OnBarUpdate might not be triggered in time to exit possible open positions just before the end of a session, I want to add a coded timer which is set at a fixed hour/minute/second. To check for this time every minute a day, just to hit that one possible set time to Exit open positions seems not the right way to do this.
Are there any possible alternatives which trigger an execution apart from the OnBarUpdate and not being the CustomEventsHandler like the Timer?
Comment