I have had an issue with my time exit during the last week. Can this have something to do with the change from summer to winter time?
I had one time exit set by:
1
DefPARAMFlatafter=180000
This one worked in backtest and on demo but not on my live account.
On a different strategy I had another one set by:
1
2
3
4
iftime>220000or(dayofweek=5andtime>210000)then
exitshortatmarket
sellatmarket
endif
What is strange with the second one is that in the back test the time exit is working correctly all until yesterday’s position which is still open. (see screen shot)
When I run the backtest on the second strategy and change the time exit to 21:00 it stops where it should. Could this issue come from that the candle of 22:00-23:00 is missing and therefore it is no close to evaluate the code from? But in that case should the close not occur at the next closing candle since the time is after 22:00 or does it not happen then because the next candle is 00:00 which is smaller than 22?
Thanks Nicolas! I understand that and I realised how that influenced my first error. However do you have an idea why I didn’t get an exit at 18:00 when I had flat after 180000 at the top of my system code?
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.