MTF backtesting having different results using same timeframes
Forums › ProRealTime English forum › ProOrder support › MTF backtesting having different results using same timeframes
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by Philstrading.
-
-
06/25/2020 at 9:39 AM #137103
Hi
When backtesting I’m ggetting vastly different results when it should be the same so wondeiring if someone has an explanation. Below is the format and results of the code.
So essentially If I run a 4hr code with a 1hr section of code, when running the code on a lower timeframe say 15 minutes I get a different result to that when running the code timeframe written as 15 minutes within the code.
Essentially whether I run it on a 15 minutes, 30 minutes or whatever, shouldnt the results be the same as that when run in the timeframe of the code? I understand why the results would be different when running on the Lower timeframes specified if I change the code to that timeframe, but not when it is different to the result when running it on the 1hour in this instance, when ran on the LTF and the code timeframe hasnt changed.
Why?
Thanks in advance…
Backtesting in MTF code formats12345678910111213141516171819202122232425262728293031323334353637383940Timeframe (4 hours, updateonclose)"Mycode"Timeframe (1 hour, updateonclose) // ran on 1hrresult= £6881.20//----------------------------------------------////---------------------------------------------//Timeframe (4 hours, updateonclose)"Mycode"Timeframe (1 hour, updateonclose) // ran on 30 minutes"Mycode"result= £9,246.80//----------------------------------------------////---------------------------------------------//Timeframe (4 hours, updateonclose)"Mycode"Timeframe (1 hour, updateonclose) // ran on 15 minutes"MyCode"result= £9,761.60//----------------------------------------------////---------------------------------------------//// If any of these are changed to the lower timeframe ran on for th eMTF they are different results again.Timeframe (4 hours, updateonclose)"Mycode"Timeframe (1 hour, updateonclose) // ran on 1hrresult= £6881.20//----------------------------------------------////---------------------------------------------//Timeframe (4 hours, updateonclose)"Mycode"Timeframe (30 minutes, updateonclose) // ran on 30 minutes"Mycode"result= £5,226.00//----------------------------------------------////---------------------------------------------//Timeframe (4 hours, updateonclose)"Mycode"Timeframe (15 minutes, updateonclose) // ran on 15 minutes"MyCode"result= £4,302.4006/25/2020 at 10:52 AM #137110The lower the TF the most likely your trade exits BEFORE the larger TF’s bar is closed, so conditions (if you use UpdateOnClose) are still effective and will make another trade to be entered but… since there’s always some pullback on higher TF’s it’s most likely subsequent trades are losers!
On a 4h bar setup, your strategy may enter several 15-minute trades (if TP and SL are tight), on a 30-minute TF there will be less chances to enter multiple trades, on a 1-hour TF that will be very difficult.
Think at what may happens to a MTF strategy like this one:
1234Timeframe (1 Day, updateonclose)"Mycode"Timeframe (4 hour, updateonclose) // ran on 1minresult= ???tens of trades will show at the end of the day, but will many of them have reliable setups (therefore be profitable) after some hours have elapsed since new day inception?
06/25/2020 at 11:02 AM #137112I use this snippet to prevent trades from entering multiple times within the same 4h bar (same conditions):
1234567891011121314151617timeframe(4h,UpdateOnClose)BarCount = BarIndex(my code)timeframe(1h,UpdateOnClose)(my code)timeframe(default) //1 minute (or whatever small TF you like)IF IntraDayBarIndex = 0 THENTradeON = 1ENDIFTradeBar = BarCount //must use a different name for the lower TFIF TradeBar <> TradeBar[1] THEN //if one bar elapsed, then re-enable tradingTradeON = 1ENDIFIF MyConditions AND Not OnMarket AND TradeON THENBUY 1 contract AT MarketTradeON = 0 //disable further trades till next higher barENDIF06/25/2020 at 11:20 AM #137116Ok thanks Robert
I will have to traul through that and figure the process once the fuzz has cleared.. 🙂
-
AuthorPosts
Find exclusive trading pro-tools on