SP500 M1 curve follower
Forums › ProRealTime English forum › ProOrder support › SP500 M1 curve follower
- This topic has 34 replies, 6 voices, and was last updated 3 years ago by
phoentzs.
-
-
01/29/2022 at 1:01 PM #18696102/01/2022 at 1:59 AM #187190
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 time123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596///Spread set to 0.6 pointsdefparam preloadbars = 10000defparam CUMULATEORDERS = falsepossize = 5pointsp = 35 //points where profit is to be locked in //20 SP500pointsb = 45 //points where stop is to be taken //36 SP500fast = average[20,0](close) //11,4 20,0medium = average[200,0](close) //13,4 200,0myRSI = RSI[2](close)RSIlong = myRSI crosses over 90 //90...95RSIshort = myRSI crosses under 10 //5...10long = fast > mediumshort = fast < medium// trading windowONCE BuyTime = 150000ONCE SellTime = 220000// position managementIF Time >= buyTime AND Time <= SellTime THENIf countofposition = 0 thenIf long thenBUY possize CONTRACT AT marketEndIfEndIfIf countofposition = 0 thenIf short thensellshort possize CONTRACT AT marketEndIfEndIfendif//UmkehrIf longonmarket and close >= positionprice + pointsp thenIf close < close[1] thenSELL AT MARKETEndIfElsIf longonmarket and close <= positionprice - pointsb then //and shortSELLSHORT possize*2 CONTRACT AT MARKET //*2EndIfIf shortonmarket and close <= positionprice - pointsp thenIf close > close[1] thenEXITSHORT AT MARKETEndIfElsIf shortonmarket and close >= positionprice + pointsb then //and longBUY possize*2 CONTRACT AT MARKET //*2EndIf//SET STOP pLOSS bSET TARGET pPROFIT 45 //50SET STOP %LOSS 2.6IF Time >= 10000 AND Time <= 150000 THENIf longonmarket and (PositionPerf * PositionPrice / PipSize) >= 30 then //35 and time=90000sell at marketendifIf shortonmarket and (PositionPerf * PositionPrice / PipSize) >= 25 then //5 and time=90000exitshort at marketendifendif////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//abendsIf longonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35sell at marketendifIf shortonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 1 then //5 and dayofweek=x11exitshort at marketendif1 user thanked author for this post.
02/01/2022 at 6:22 AM #18719302/01/2022 at 10:26 AM #18720902/01/2022 at 1:24 PM #187227 -
AuthorPosts
Find exclusive trading pro-tools on
Similar topics: