Similar topics:
Forums › ProRealTime English forum › ProOrder support › SP500 M1 curve follower
Here is my code with SMA entry. Completely simple trend approach, nothing more. Totally simple. But the performance is amazing.
Optimized over 200000bars
Spread 0.6
German time
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 |
///Spread set to 0.6 points defparam preloadbars = 10000 defparam CUMULATEORDERS = false possize = 5 pointsp = 35 //points where profit is to be locked in //20 SP500 pointsb = 45 //points where stop is to be taken //36 SP500 fast = average[20,0](close) //11,4 20,0 medium = average[200,0](close) //13,4 200,0 myRSI = RSI[2](close) RSIlong = myRSI crosses over 90 //90...95 RSIshort = myRSI crosses under 10 //5...10 long = fast > medium short = fast < medium // trading window ONCE BuyTime = 150000 ONCE SellTime = 220000 // position management IF Time >= buyTime AND Time <= SellTime THEN If countofposition = 0 then If long then BUY possize CONTRACT AT market EndIf EndIf If countofposition = 0 then If short then sellshort possize CONTRACT AT market EndIf EndIf endif //Umkehr If longonmarket and close >= positionprice + pointsp then If close < close[1] then SELL AT MARKET EndIf ElsIf longonmarket and close <= positionprice - pointsb then //and short SELLSHORT possize*2 CONTRACT AT MARKET //*2 EndIf If shortonmarket and close <= positionprice - pointsp then If close > close[1] then EXITSHORT AT MARKET EndIf ElsIf shortonmarket and close >= positionprice + pointsb then //and long BUY possize*2 CONTRACT AT MARKET //*2 EndIf //SET STOP pLOSS b SET TARGET pPROFIT 45 //50 SET STOP %LOSS 2.6 IF Time >= 10000 AND Time <= 150000 THEN If longonmarket and (PositionPerf * PositionPrice / PipSize) >= 30 then //35 and time=90000 sell at market endif If shortonmarket and (PositionPerf * PositionPrice / PipSize) >= 25 then //5 and time=90000 exitshort at market endif endif ////morgens //If longonmarket and time=90000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35 //sell at market //endif //If shortonmarket and time=90000 and (PositionPerf * PositionPrice / PipSize) >= 15 then //5 and dayofweek=x11 //exitshort at market //endif // ////mittag //If longonmarket and time=120000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35 //sell at market //endif //If shortonmarket and time=120000 and (PositionPerf * PositionPrice / PipSize) >= 25 then //5 and dayofweek=x11 //exitshort at market //endif //abends If longonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35 sell at market endif If shortonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 1 then //5 and dayofweek=x11 exitshort at market endif |
Find exclusive trading pro-tools on