PRT Strategy adjust Local TradeTime when Daylight Savings time changes +/- 1hr?
Forums › ProRealTime English forum › ProBuilder support › PRT Strategy adjust Local TradeTime when Daylight Savings time changes +/- 1hr?
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by PeterSt.
-
-
04/12/2022 at 2:03 AM #191616
Hello,
- Does PRT automatically change the local times with daylight savings / BST etc ? I am curious if running an auto-trading on UK trading times (and backtesting for that matter too), does PRT account for the British Summer Time (BST) and change the time automatically each year? If my PRT is set for London (GMT+1) at the moment as example if i launched a strategy, would it change to using GMT+0 trade times in my code when the BST finishes?
- OR do we have to adjust the trade time’s in the code to ensure we trading correctly within trade times all year round? If so (2.), then would this code below work? However running a backtest with below code made the strategy a lot less efficient oddly, which counters to what would expect if it was actually working right? Looking over the trades it does however appears to not open any between 9-10 during the BST months.
123456789101112131415161718// --------- UK DAY LIGHT SAVINGS MONTHS ---------------- //DLSMonths = CurrentMonthDLSdd = OpenDayDLS = ((dayofweek >= 0) and (DLSMonths =3) AND (31-DLSdd<7) ) OR ( (DLSMonths > 3) AND (DLSMonths < 10) ) OR ( (DLSMonths = 10) AND (31-DLSdd > 6) ) OR ((dayofweek = 4) AND (DLSMonths = 10) AND (DLSdd<31)) OR ((dayofweek = 3) AND (DLSMonths = 10) AND (DLSdd+1<31)) OR ((dayofweek = 2) AND (DLSMonths = 10) AND (DLSdd+2<31)) OR ((dayofweek = 1) AND (DLSMonths = 10) AND (DLSdd+3<31)) OR ((dayofweek = 0) AND (DLSMonths = 10) AND (DLSdd+4<31)) OR ((dayofweek = 5) AND (DLSMonths = 10) AND (31-DLSdd<7))If DLS then //daylightsavingstimesTradetime = time >=100000 and time <173000elsif not DLS then //nondaylightsavingstimesTradetime = time >=090000 and time <163000endifIf not longonmarket and LONGCONDITIONS and Tradetime THEN BUY 1 CONTRACT AT MARKETEndIfIF not shortonmarket and SHORTCONDTIONS and Tradetime THEN SELLSHORT 1 CONTRACT AT MARKETEndifI currently get very different results, for example a strategy based on FTSE (current London local time GMT +1) without any code to change trading times 1st pic (left) gave me 68% winning & more gains. But the 2nd picture is same strategy but on GMT+0 with code to adjust to GMT+1hr for BST times of the year. Strangely using the above code adjusting trading times for BST had much worse results, which is counter to what would expect if trading times were corrected to be the right open and close times vs. being trading 1 hour too late outside of BST. Which makes me think either 1. – the PRT does automatically adjust to the local time, aka clock forward or back 1 hr, or 2. – my codes wrong, or 3. my logic is wrong hmm. Or im just missing something so simple, like wrong time for UK trading.
Thank you.
04/12/2022 at 2:15 AM #191619Addition: LSE market opens at 0800, but i do have trade times start as 0900 on both strategies. This is just my own preferences to avoid the volatile 1hr of trade before then my strategy decides to open position.
04/13/2022 at 5:06 AM #191668WHAT IF
PRT could just not take into account these changes during the flow of a backtest ?
When in Live or forward (back)testing, there is nothing wrong that I can see. But I bet you that if I now run a backtest over the past month, that nothing in there knows about daylight savings. It just doesn’t work like that.
In order to understand my last little sentence, think of this one :
If you trade a USD asset, then during backtesting not only your asset will lose and win some, but the currency rate between AUD and USD will also change. In Live you will see your portfolio total change because of this already outside of trading ours but with Fx live (with a position open in a USD asset). But during backtesting ? no way. “It just does not work like that”.
If I would run a backtest over the past 2 months on e.g. (USA) Apple, I will definitely be confronted with the fact that USA changed to daylight savings two weeks earlier than we over here in Europe. For me, in the Netherlands, USA markets just open 1 hour earlier than what I am used to, and this lasts two weeks. This surely will be reflected in the times I see trades taken (which won’t be outside of USA trading hours). But now my own time … So Yes, after these two weeks USA stock markets will normally open at 15:30 again (instead of 14:30). This is because now my OWN time changed.
So both situations will be reflected in the backtest ? It looks like it.My local market then. Hmm … I don’t recall that daylight savings have anything to do with the opening times of local markets. For me it’s just 09:00 (stock market), always. Still I am subject to daylight changes.
Thus, all is about the relative differences.
If I talk to an American about stock opening times, what answer will he give me ?
“That depends where I live”. So the poor guy can’t even travel the states because his time will change as many states as he travels. He will be able to deal with it. He just changes his watch. Even his AutoTrading needs to be adjusted, assumed his laptop changes times when he travels. Meanwhile over here (!) daylight savings start. And btw, somewhere “around that time” in Australia it stops. The poor guy also has ASML on the Dutch market.BBbbbZzzzzzz
-
AuthorPosts