Trade is shown in backtest Price chart but not Equity Curve
Forums › ProRealTime English forum › ProRealTime platform support › Trade is shown in backtest Price chart but not Equity Curve
- This topic has 22 replies, 5 voices, and was last updated 4 years ago by Nicolas.
-
-
09/11/2020 at 11:31 AM #143935
Two weeks after I submitted a report to PRT I have had the sort of response that doesn’t give me any hope they will ever get to the bottom of it. Meanwhile, I have found that I get different back test results depending on the start date of the test.
- Testing from 3 July – 11 September, I see no trades after 11 August.
- Testing from 3 August – 11 September, I see trades up to 1 September, which includes the original missing live trade of 25 August.
You can see this in the screenshots, and you can see the start and finish dates at the top of the Detailed Report. The finish dates in both screenshots are 11 September.
Therefore my new theory is that the backtest doesn’t always test until the finish date, and that this depends on the start date. This is consistent with my other posts above. I would very much appreciate knowing if you find this too if you run the code, and if so, any insight into why this might happen and how to stop it from happening.
Trade the Dax at 8am; long only.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475// HB DAX 8am v1.3 LONG// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// The system will cancel all pending orders and close all positions at "FLATAFTER" time. No new ones will be allowed until after the "FLATBEFORE" time.DEFPARAM FLATBEFORE = 080000// Cancel all pending orders and close all positions at the "FLATAFTER" timeDEFPARAM FLATAFTER = 210000PoundsPerPoint = 0.58// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0timeframe(daily, updateonclose)ATRdaily = AverageTrueRange[5]ThreeDayMove = abs(lowest[3] - highest[3])BigMove = ThreeDayMove > ATRdaily * 1.6///**PVI = PositiveVolumeIndex(close)PVIlow = lowest[40](PVI) //20 on the dailyPVIok = PVI > PVIlow + 110 //100///**timeframe (3 hours, updateonclose)dojidef = 3.5 //optimised// Calculate Heikin Ashi candlesif barindex>1 thenhaclose3hr=(open+close+low+high)/4haopen3hr=(haopen3hr[1]+haClose3hr[1])/2xHigh3hr = Max(haOpen3hr, haClose3hr)xLow3hr = Min(haOpen3hr, haClose3hr)hahigh3hr = Max(High,xHigh3hr)halow3hr = Min(Low,xLow3hr)endifLong3hr = (haclose3hr > haopen3hr)IF Long3hr THENdojiL = abs((hahigh3hr - haclose3hr) / (halow3hr - haopen3hr + 0.1))IF dojiL < dojidef THENLong3hr = 0 //don't enter if it's a doji, ie long wick and tailENDIFENDIFShort3hr = (haclose3hr < haopen3hr)IF Short3hr THENdojiS = abs((hahigh3hr - haopen3hr) / (halow3hr - haclose3hr + 0.1))IF dojiS > dojidef THENShort3hr = 0 //don't enter if it's a doji, ie long wick and tailENDIFENDIFtimeframe(5 minutes)if barindex>1 thenhaclose5m=(open+close+low+high)/4haopen5m=(haopen5m[1]+haclose5m[1])/2endifIF time = 080000 THENLong5m = (haopen5m[10] > haclose5m[14]) // 30.56% 2/1/19 - 5/20IF Long5m AND Long3hr AND NOT Short3hr AND not BigMove AND not daysForbiddenEntry AND PVIok THEN //AND AwayFromMH//BUY PoundsPerPoint PERPOINT AT MARKETBUY PoundsPerPoint CONTRACT AT MARKETENDIFSET STOP pLOSS 118 //optimisedENDIF09/11/2020 at 6:56 PM #143960I tried this using your code against the Germany 30 (DFB) and get the same results that you do, see attached.
1 user thanked author for this post.
09/11/2020 at 6:59 PM #143962Hmm seems to be an issue with the submit which removed the second attachment, here it is:
09/16/2020 at 3:17 PM #144445@AutoStrategist, thank you for confirming my results.
Recent results can be missing from the backtest, depending on the start date.
@Nicolas, @GraHal, @Vonasi, I think that this should cause concern.In the screenshots above I show:
- backtest dates from 3 Aug – 11 Sept give 5 trades, from 4 Aug – 1 Sept. It is believable that the 1 Sept trade is the last trade before 11 Sept.
- backtest dates from 3 July – 11 Sept give 7 trades, from 6 July – 11 Aug. Trades after 11 Aug are not shown, including the 1 Sept trade.
Surely this can’t be right?
09/16/2020 at 3:27 PM #14444609/16/2020 at 5:56 PM #144462I’ve just tried this, and no, the variables are not the same; PVIok is zero for the shorter backtest time, when the 1 September trade doesn’t run. Screenshots attached.
Very interesting, and it makes sense that the trade doesn’t run when this variable is zero. However… why is it different? The only thing that I’m changing is the earlier backtest date, from 3 August (when the trade happens) to 3 July (when it doesn’t).
09/24/2020 at 5:14 PM #145260@Nicolas, you’ll see from my post above that your question was a good one. Do you have any suggestions for why changing the backtest start date affects a variable in the test?
09/24/2020 at 5:20 PM #145263ok that means that the PVI (Positive Volume Index) indicator value is not the same, because it doesn’t rely on period of calculation. So it seems obvious that the condition result is not the same and therefore quantity of orders too.
-
AuthorPosts
Find exclusive trading pro-tools on