Forums › ProRealTime English forum › ProOrder support › Machine Learning in ProOrder ProRealTime › Reply To: Machine Learning in ProOrder ProRealTime
04/29/2020 at 3:39 PM
#128846
Here’s try on 1 ML engine, choosing from in this case 5 best optimisation results (from without ML). So it means 1 ML engine can have many parameters. On short timeframe, run optimisation a few days later and add that the first 5 and build a database.
Makes it sense? No! Still fun to try.
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 |
startingvalue = 1 //5, 100, 10 boxsize increment = 1 //5, 20, 10 maxincrement = 5 //5, 10 limit of no of increments either up or down reps = 5 //1 number of trades to use for analysis //2 maxvalue = 5 //20, 300, 150 //maximum allowed value minvalue = 1 //5, minimum allowed value //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 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 if valuex=1 then boxsizeL=5 boxsizeS=50 elsif valuex=2 then boxsizeL=15 boxsizeS=40 elsif valuex=3 then boxsizeL=40 boxsizeS=30 elsif valuex=4 then boxsizeL=5 boxsizeS=25 elsif valuex=5 then boxsizeL=10 boxsizeS=45 endif graph valuex //graph boxsizel //graph boxsizes |