I cant get any ProBackTest strategy to work!
Forums › ProRealTime English forum › ProOrder support › I cant get any ProBackTest strategy to work!
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by
Vonasi.
-
-
03/16/2018 at 12:16 PM #65417
Hi all,
I know I must be doing something stupid but I just cant get any of the strategies to show me any backtest results. First of all I go to an open chart, say DAX, and click the drop down menu next to the button with a chart and a plus next to it. On the Backtesting & automatic trading tab, I then click new, then select the “Creation by programming” tab and paste in the copied code. Finally I click “ProBacktest my strategy.
The backtest seems to run but the open trades are usally alway 0 and if they are not then any trade that has been opened always ends up as even. There is never any winning or losing trades to view.
I’d be very grateful for your help! Thanks!
03/16/2018 at 1:36 PM #65433Easiest is to post your code on here and I’ll run it for you on my Platform.
I’ve had this in the past and it’s a very simple reason, but I’m blowed if I can recall what it was!? 🙂
The 0 bars may be because you have not got tick by tick mode selected?
I guess you have tried a few different Timeframes and markets / instruments?
03/16/2018 at 2:24 PM #65434Thanks for the reply, I’m very grateful. The code I’m using is below. No I havent tried any different time frames but as it’s a DAX breakout, I’ve only tried it with the DAX. Thanks again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586DEFPARAM FLATBEFORE=090100// Festlegen der Code-ParameterDEFPARAM CumulateOrders = false // Kumulieren von Positionen deaktiviert// einmalige werteonce size = 1once profi = 20once in = 1once korrek = 1sl = 35// Verhindert das Trading an bestimmten WochentagendaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0noEntryAfterTime = 100000timeEnterAfter = time < noEntryAfterTime// einen trade nurIF (CurrentTime = 010000) thenonetrade= 0ENDIF// Bedingungen zum Einstieg in Long-PositionenIF (CurrentTime = 085900) thenhigh7= HIGHEST[120](high)low7= LOWEST[120](low)ENDIFIF (close > high7) AND (CurrentTime >= 090100) thenonetrade= 1ENDIFIF (CurrentTime >= 090100) AND not daysForbiddenEntry AND (onetrade = 0) AND timeEnterAfter THENBUY size CONTRACT AT high7 STOPENDIFIF (LONGONMARKET = 1) thenonetrade= 1in= 1korrek= 0//l1 = POSITIONPRICE + 0.0008l2= POSITIONPRICE - sl//sell at l1 LIMITsell at l2 stopENDIF// Bedingungen zum Einstieg in Short-PositionenIF close < low7 AND (CurrentTime >= 090100) thenonetrade= 1ENDIFIF (CurrentTime >= 090100) AND not daysForbiddenEntry AND (onetrade = 0) AND timeEnterAfter THENSELLSHORT size CONTRACT AT low7 STOPENDIFIF (SHORTONMARKET = 1) thenonetrade= 1in= 1korrek= 0//s1 = POSITIONPRICE - 0.0008s2= POSITIONPRICE + sl//EXITSHORT at s1 LIMITEXITSHORT at s2 STOPENDIF// korrekturIF (LONGONMARKET < 1) AND (SHORTONMARKET < 1) thenin= 0ENDIFIF in = 0 and korrek = 0 thend1= POSITIONPERF(1) > 0d2= POSITIONPERF(1) < 0IF d1 and size > 1 thensize = size - 1korrek = 1ELSIF d2 thensize = size + 1korrek = 1ENDIFENDIF// Stops und TargetsSET STOP pLOSS 60SET TARGET pPROFIT sl// PerformanceIF STRATEGYPROFIT > profi thensize= 1profi= profi + 20ENDIF03/16/2018 at 2:56 PM #65435I got it going on 1 min TF and it looks very promising!
I see you’ve been trying to get it going on Daily, but you are Flat Before 090100 and no trades after 100000 so you miss the Daily Open at 000000 every day.
Try rejigging your time constraints or better still work it as a lower TF Strategy??
PS Always use that blue PRC icon Insert PRT Code to add code to a post then you get it formatted all nice and friendly like! 🙂
03/16/2018 at 3:40 PM #65442Thanks, but I still can’t get it to work. How are you altering the TF? On the actual chart before clicking the button?
03/16/2018 at 3:43 PM #6544303/16/2018 at 6:45 PM #65466 -
AuthorPosts
Find exclusive trading pro-tools on