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 2 years ago by phoentzs.
-
-
01/12/2022 at 11:44 AM #18524401/12/2022 at 1:06 PM #185249
okay one last attempt
how does this one look SnorreDK ?
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152///Spread set to 0.9 pointsdefparam preloadbars = 10000possize = 5pointsL = 1.0056 //points where profit is to be locked in LONG//25pointsS = 0.9954 //points where profit is to be locked in SHORT//25pointsL1 = 0.991 //points where stop is to be taken //36 SP500pointsS1 = 1.01 //points where stop is to be taken //36 SP500fast = average[11,4](close) //11medium = average[14,4](close) //13TIMEFRAME (10 MINUTES, updateonclose)A = 26B = 8S = 1.3A1 = Average[A,B](low)A2 = Average[A*s,B](low)c3 = a1 > a2TIMEFRAME (default, UPDATEONCLOSE)//If countofposition = 0 then//If fast > medium then//BUY possize CONTRACT AT open + averagetruerange[3](close)*2 stop//EndIf//EndIfIf countofposition = 0 thenIf fast > medium and c3 thenBUY possize CONTRACT AT open + 5*pipsize stopEndIfEndIfIf longonmarket and close >= positionprice * pointsL thenIf close < close[1] thenSELL AT MARKETEndIfElsIf longonmarket and close <= positionprice * pointsL1 thenSELLSHORT possize*2 CONTRACT AT MARKETEndIfIf shortonmarket and close <= positionprice * pointsS thenIf close > close[1] thenEXITSHORT AT MARKETEndIfElsIf shortonmarket and close >= positionprice * pointsS1 thenBUY possize*2 CONTRACT AT MARKETEndIfSET TARGET %PROFIT 0.54SET STOP %LOSS 1.201/12/2022 at 2:53 PM #18526601/12/2022 at 5:09 PM #185278I mean the code in the very first post on this topic. Lines 4-6 should be given in percent and recoded in lines 17-31.
There you go:
12345678910111213141516171819202122232425262728293031323334353637//Spread set to 0.9 pointsdefparam preloadbars = 10000possizePC = 0.05 //0.05%pointspPC = 0.4 //0.40%pointsbPC = 1.0 //1.00%//possize = close / 100 * possizePCpointsp = close / 100 * pointspPC //points where profit is to be locked in //20 SP500pointsb = close / 100 * pointsbPC //points where stop is to be taken //36 SP500//fast = average[11,4](close) //11medium = average[14,4](close) //13If countofposition = 0 thenIf fast > medium thenBUY possize CONTRACT AT open + averagetruerange[3](close)*2 stopEndIfEndIfIf longonmarket and close >= positionprice + pointsp thenIf close < close[1] thenSELL AT MARKETEndIfElsIf longonmarket and close <= positionprice - pointsb thenSELLSHORT possize*2 CONTRACT AT MARKETEndIfIf shortonmarket and close <= positionprice - pointsp thenIf close > close[1] thenEXITSHORT AT MARKETEndIfElsIf shortonmarket and close >= positionprice + pointsb thenBUY possize*2 CONTRACT AT MARKETEndIfSET TARGET pPROFIT 16 //50SET STOP %LOSS 1.11 user thanked author for this post.
01/13/2022 at 1:23 PM #185341I have to ask for your opinion now because that’s buzzing around in my head. With this simple system here (just changed the trend input and introduced fixed trading hours) I was able to achieve pretty good results on pretty much every index in the M1 and also in the M5. Which makes me a little cautious. Safe, robust … you would have to test it. The system is on the market for a long time if the profit is higher and the loss is higher, and it also works as a scalper with a larger SL, with a super hit rate.
What do you think of this type of code? Or am I missing something obvious?
01/13/2022 at 1:42 PM #18534201/13/2022 at 1:54 PM #18534501/28/2022 at 3:53 AM #186781I played around with the code, changed entry, added exits. The whole thing is optimized to 75000bars, so the last year. It has been running in demo for me for over a week and is making incredible profits. I’m close to trying it live. A strategy that makes good profits long and short is rare these days. The joke is I have no idea why it works so well. What do you think?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162//-------------------------------------------------------------------------// Hauptcode : T2 Curvefolger M5 SP500//-------------------------------------------------------------------------///Optimiert 75000barsdefparam preloadbars = 10000defparam CUMULATEORDERS = falseONCE a = 40ONCE b = 40ONCE c = 50ONCE x1 = 2ONCE x2 = 2possize = 5pointsp = a //points where profit is to be locked in //20 SP500pointsb = b //points where stop is to be taken //36 SP500timeframe(4hour, updateonclose)Bull = close > close[1]Bear = close < close[1]myclose = closemyhigh = highmylow = lowtimeframe(default)myRSI = RSI[2](close)RSIExlong = myRSI < 10RSIExshort = myRSI > 90long = Bullshort = Bear// 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*x1 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*x2 CONTRACT AT MARKET //*2EndIf//endifSET TARGET pPROFIT c //50SET STOP %LOSS 1.3If longonmarket and RSIExlong and (PositionPerf * PositionPrice / PipSize) >= 20 thensell at marketendifIf shortonmarket and RSIExshort and (PositionPerf * PositionPrice / PipSize) >= 25 thenexitshort at marketendifIF Time >= 10000 AND Time <= 150000 THENIf longonmarket and (PositionPerf * PositionPrice / PipSize) >= 30 thensell at marketendifIf shortonmarket and (PositionPerf * PositionPrice / PipSize) >= 40 thenexitshort at marketendifendif//abendsIf longonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 35 thensell at marketendifIf shortonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 50 thenexitshort at marketendif//TrailingStop in Punkten////************************************************************************//trailing stop functiontrailingstartL = 40 //LONG trailing will start @trailinstart points profit //30trailingstartS = 40 //SHORT trailing will start @trailinstart points profittrailingstepL = 9 //trailing step to move the "stoploss" //1trailingstepS = 1 //trailing step to move the "stoploss"Distance = 1 * PipSize//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstartL*pipsize THENnewSL = tradeprice(1)+trailingstepL*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstepL*pipsize THENnewSL = newSL+trailingstepL*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstartS*pipsize THENnewSL = tradeprice(1)-trailingstepS*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstepS*pipsize THENnewSL = newSL-trailingstepS*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENIF LongOnMarket THENIF (close - Distance) > newSL THENSELL AT newSL STOPELSIF (close + Distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnMarket THENIF (close - Distance) > newSL THENEXITSHORT AT newSL LIMITELSIF (close + Distance) < newSL THENEXITSHORT AT newSL STOPELSEEXITSHORT AT MarketENDIFENDIFendif//************************************************************************01/28/2022 at 10:56 AM #186816Hello Phoentz
If you find it useful I went back in time to see if it was stable, it seems overly optimized …. even if I see that some people don’t care about the past but only the present.
Good dayHello
Mauro T.01/28/2022 at 11:09 AM #18682001/28/2022 at 6:08 PM #18686801/29/2022 at 3:13 AM #186911I created several versions to test and just let them run. In the last 2 weeks in particular the market has been extremely turbulent with major swings. The results are to be proud of. I think these systems deserve even more in a trend phase. What is apparent is that the systems without doubling the reversal have had a much harder time, but have not really lost so far. I created the versions with different input conditions, the code core is always the same. Recognizable by the name of the strategy. Bollinger inputs somehow don’t work at all in this market phase, I don’t know why yet. Simple inputs that come up often seem to work best. The variants without special inputs, which simply enter the trend without any extra setup, work best. I didn’t expect that. I think the most important thing is that the first trade of the strategy is taken in the direction with the highest probability. The code does the rest. I think.
can you post me your version?01/29/2022 at 5:50 AM #186920Bollinger inputs somehow don’t work at all in this market phase
That could be similar to me myself not being able to trade this manually. Swings are even 1% the hour easily on any large index, and I can’t make money out of it.
Without really investigating it (the code(s) you are dealing with at this moment), I think this is related to most systems (me too) depend on lag. And before you know it (before you are sure) you are too late and the lot reverses.
Someone (you, @phoentzs ?) should really abuse this with code which is not too late and without emotion. You could earn greenhouses, nice cars, normal houses, each day an other. And me ? I am fighting for a “stupid” 500, manually. And the fight is because being in a 10K loss first. Tiring. 🙁
hahaBut ditch the code in time, because this won’t last forever …
01/29/2022 at 11:22 AM #18694001/29/2022 at 12:17 PM #186947 -
AuthorPosts
Find exclusive trading pro-tools on