Forums › ProRealTime English forum › ProOrder support › Machine Learning in ProOrder ProRealTime › Reply To: Machine Learning in ProOrder ProRealTime
It’s giving me the same kind of results (in the millions with 30x capital). In fact it seems to have picked up a “spare £13 million”… Not sure @GraHal, is anyone else able to replicate these results?
Maybe there is a caching issue and even though it shows tick by tick it’s not doing tick by tick, although I have started a fresh session in PRT this morning and get the same high results.
Maybe the other day I had other backtests running in the same chart and when I changed the TF of coffee it would show me a warning saying that tick by tick wasn’t available for the date range for another system (and I did click for it to test the new TF without tick by tick, but perhaps it was also unticking my Renko ML1 StpLoss system, (although it’s not visually removing my tick in the tick by tick backtest box)?
Here’s the code instead of the itf: The only change is with:
1 |
StratAvgA = StratAvgA + (((PositionPerf(i)*countofposition[i]*100000)*-1)*-1) |
where I replaced 100,000 with Close. Oddly no difference in profit on Coffee although it did make a big difference when I made that change for the Ehlers’ Univ Osc ML2 system with coffee?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
//------------------------------------------------------------------------- // Main code : Nneless Renko DJI 1M v1 ML1 Cycle Limit Reset - // Orig a 1 Min system (no ML), then 1 Month (no ML) and then 1 Month with ML and now Daily with ML // The 30 x capital was a test to break the system. //------------------------------------------------------------------------- //https://www.prorealcode.com/topic/why-is-backtesting-so-unreliable/#post-110889 // Definition of code parameters DEFPARAM CumulateOrders = False // Cumulating positions deactivated // The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time. //DEFPARAM FLATBEFORE = 143000 // Cancel all pending orders and close all positions at the "FLATAFTER" time //DEFPARAM FLATAFTER = 210000 Capital = 10000 + strategyprofit //Current profit made by the closed trades of the running strategy. N = 30*Capital / Close //30 //ValueX for the Renko Stop Loss. //Heuristics Algorithm 1 Start If (onmarket[1] = 1 and onmarket = 0) or (longonmarket[1] = 1 and longonmarket and countoflongshares < countoflongshares[1]) or (longonmarket[1] = 1 and longonmarket and countoflongshares > countoflongshares[1]) or (shortonmarket[1] = 1 and shortonmarket and countofshortshares < countofshortshares[1]) or (shortonmarket[1] = 1 and shortonmarket and countofshortshares > countofshortshares[1]) or (longonmarket[1] and shortonmarket) or (shortonmarket[1] and longonmarket) Then optimise = optimise + 1 EndIf //Settings 1 StartingValue = 10 //10 Stop Loss ResetPeriod = 0.5 //0.5 Specify no of months after which to reset optimisation Increment = 5 //20 MaxIncrement = 10 //10 Limit of no of increments either up or down Reps = 2 //Number of trades to use for analysis //2 MaxValue = 150 //150 //Maximum allowed value MinValue = increment //Minimum allowed value once monthinit = month once yearinit = year If (year = yearinit and month = (monthinit + ResetPeriod)) or (year = (yearinit + 1) and ((12 - monthinit) + month = ResetPeriod)) Then ValueX = StartingValue WinCountB = 0 StratAvgB = 0 BestA = 0 BestB = 0 monthinit = month yearinit = year EndIf once ValueX = StartingValue once PIncPos = 1 //Positive Increment Position once NIncPos = 1 //Negative Increment Position once optimise = 0 ////Initialize Heuristicks Engine Counter (Must be Incremented at Position Start or Exit) once Mode1 = 1 //Switches between negative and positive increments //once WinCountB = 3 //Initialize Best Win Count //GRAPH WinCountB coloured (0,0,0) AS "WinCountB" //once StratAvgB = 4353 //Initialize Best Avg Strategy Profit //GRAPH StratAvgB coloured (0,0,0) AS "StratAvgB" If optimise = Reps Then WinCountA = 0 //Initialize current Win Count StratAvgA = 0 //Initialize current Avg Strategy Profit HeuristicsCycle = HeuristicsCycle + 1 For i = 1 to Reps Do If positionperf(i) > 0 Then WinCountA = WinCountA + 1 //Increment Current WinCount EndIf StratAvgA = StratAvgA + (((PositionPerf(i)*countofposition[i]*Close)*-1)*-1) Next StratAvgA = StratAvgA/Reps //Calculate Current Avg Strategy Profit //Graph (PositionPerf(1)*countofposition[1]*100000)*-1 as "PosPerf1" //Graph (PositionPerf(2)*countofposition[2]*100000)*-1 as "PosPerf2" //Graph StratAvgA*-1 as "StratAvgA" //once BestA = 300 //GRAPH BestA coloured (0,0,0) AS "BestA" If StratAvgA >= StratAvgB Then StratAvgB = StratAvgA //Update Best Strategy Profit BestA = ValueX EndIf //once BestB = 300 //GRAPH BestB coloured (0,0,0) AS "BestB" If WinCountA >= WinCountB Then WinCountB = WinCountA //Update Best Win Count BestB = ValueX EndIf If WinCountA > WinCountB and StratAvgA > StratAvgB Then Mode1 = 0 ElsIf WinCountA < WinCountB and StratAvgA < StratAvgB and Mode1 = 1 Then ValueX = ValueX - (Increment*NIncPos) NIncPos = NIncPos + 1 Mode1 = 2 ElsIf WinCountA >= WinCountB or StratAvgA >= StratAvgB and Mode1 = 1 Then ValueX = ValueX + (Increment*PIncPos) PIncPos = PIncPos + 1 Mode1 = 1 ElsIf WinCountA < WinCountB and StratAvgA < StratAvgB and Mode1 = 2 Then ValueX = ValueX + (Increment*PIncPos) PIncPos = PIncPos + 1 Mode1 = 1 ElsIf WinCountA >= WinCountB or StratAvgA >= StratAvgB and Mode1 = 2 Then ValueX = ValueX - (Increment*NIncPos) NIncPos = NIncPos + 1 Mode1 = 2 EndIf If NIncPos > MaxIncrement or PIncPos > MaxIncrement Then If BestA = BestB Then ValueX = BestA Else If reps >= 10 Then WeightedScore = 10 Else WeightedScore = round((reps/100)*100) EndIf ValueX = round(((BestA*(20-WeightedScore)) + (BestB*WeightedScore))/20) //Lower Reps = Less weight assigned to Win% EndIf NIncPos = 1 PIncPos = 1 ElsIf ValueX > MaxValue Then ValueX = MaxValue ElsIf ValueX < MinValue Then ValueX = MinValue EndIF optimise = 0 EndIf // Heuristics Algorithm 1 End //Renko Definitions boxSize = 100 // Orig 110 //StartingValue = 10 //10 Stop Loss //ResetPeriod = 0.5 //0.5 Specify no of months after which to reset optimisation //Increment = 5 //20 //MaxIncrement = 10 //10 Limit of no of increments either up or down //Reps = 2 //Number of trades to use for analysis //2 //MaxValue = 150 //150 //Maximum allowed value //MinValue = increment //Minimum allowed value once renkoMax = ROUND(close / boxSize) * boxSize once renkoMin = renkoMax - boxSize IF high > renkoMax + boxSize THEN WHILE high > renkoMax + boxSize renkoMax = renkoMax + boxSize renkoMin = renkoMin + boxSize WEND ELSIF low < renkoMin - boxSize THEN WHILE low < renkoMin - boxSize renkoMax = renkoMax - boxSize renkoMin = renkoMin - boxSize WEND ENDIF c1 = renkoMax + boxSize c2 = renkoMin - boxSize // Conditions to enter long positions If c1 then Buy N CONTRACT at renkoMax + boxSize stop EndIf // Conditions to enter short positions If c2 then Sellshort N CONTRACT at renkoMin - boxSize stop EndIf // Stops and targets //SET STOP PLOSS ValueX //Orig 75 Set stop trailing ValueX//100 SET TARGET PPROFIT 500 //Orig 150 GRAPH ValueX coloured(0,255,0) |