Combined Supertrend Further Discusion
Forums › ProRealTime English forum › ProOrder support › Combined Supertrend Further Discusion
- This topic has 42 replies, 9 voices, and was last updated 6 years ago by verdi55.
-
-
01/28/2018 at 7:50 PM #60762
We are all multimillionaires…
Try this : I just added my famous exponential growth routine.
Starting capital on 01.08.2010 is € 1000, and we start trading with only 1 initial DAX mini contract. The system reinvests profits and grows in position size until a maximum number of 1000 DAX mini contracts is reached.
who wants to be a millionaire ?123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195Defparam cumulateorders = false//exponential growth of position size - reinvestment of profitcp = countofpositionpp = positionperfpprice = positionpriceSP = strategyprofitnumber = 1 + ((SP + pp * pprice * ABS(cp)) / 250)n = round(number)If n <= 1 thenn = 1endifIf n > 1000 thenn = 1000endifpossize = n////////////////////////////////////////////////////////////////Andrew Abraham Trend Trader//Posted by @Nicolas in PRC Library/////////////////////////////////////////////////////////////Length = 21Multiplier = 3avrTR = weightedaverage[Length](AverageTrueRange[1](close))highestC = highest[Length](high)lowestC = lowest[Length](low)hiLimit = highestC[1]-(avrTR[1]*Multiplier)lolimit = lowestC[1]+(avrTR[1]*Multiplier)if(close > hiLimit AND close > loLimit) THENret = hiLimitELSIF (close < loLimit AND close < hiLimit) THENret = loLimitELSEret = ret[1]ENDIF///////////////////////////////////////////////////////////////Simplified supertrend (without volatility component ATR)//Posted by @verdi55 in PRC Library/////////////////////////////////////////////////////////////ONCE direction = 1ONCE STlongold = 0ONCE STshortold = 1000000000000factor = 0.005indicator1 = medianpriceindicator3 = closeindicator2 = indicator3 * factorSTlong = indicator1 - indicator2STshort = indicator1 + indicator2If direction = 1 and STlong < STlongold thenSTlong = STlongoldendifIf direction = -1 and STshort > STshortold thenSTshort = STshortoldendifIf direction = 1 and indicator3 < STlong thendirection = -1endifIf direction = -1 and indicator3 > STshort thendirection = 1endifSTlongold = STlongSTshortold = STshortIf direction = 1 thenST = STlongelseST = STshortendif///////////////////////////////////////////////////////////////PRC_adaptive SuperTrend (r-square method) | indicator//Posted by @Nicolas in PRC Library/////////////////////////////////////////////////////////////Period = 10mult = 2Data = customcloseSumX = 0SumXX = 0SumXY = 0SumYY = 0SumY = 0if barindex>Period then// adaptive r-squared periodsfor k=0 to period-1 dotprice = Data[k]SumX = SumX+(k+1)SumXX = SumXX+((k+1)*(k+1))SumXY = SumXY+((k+1)*tprice)SumYY = SumYY+(tprice*tprice)SumY = SumY+tpricenextQ1 = SumXY - SumX*SumY/periodQ2 = SumXX - SumX*SumX/periodQ3 = SumYY - SumY*SumY/periodiRsq=((Q1*Q1)/(Q2*Q3))avg = supertrend[mult,round(Period+Period*(iRsq-0.25))]EndIf//////////////////////////////////////////////////////////////////OriginalST = Supertrend[3,5]/////////////////////////////////////////////////////////////////margin = 7*pointsizeIf countofposition = 0 and abs(ret[1]-ST[1]) > margin and abs(ret-ST) > margin ThenIf close > ret and close > ST and close > avg ThenBuy possize contract at marketElsIf close < ret and close < ST and close < avg ThenSellshort possize contract at marketEndIfElsIf longonmarket and ((abs(ret[1]-ST[1]) < margin and abs(ret-ST) < margin) or ((close < ret and close < ST and close < avg and close < OriginalST) and (close[1] < ret[1] and close[1] < ST[1] and close[1] < avg[1] and close[1] < OriginalST[1]))) ThenSell at marketElsIf shortonmarket and ((abs(ret[1]-ST[1]) < margin and abs(ret-ST) < margin) or ((close > ret and close > ST and close > avg and close > OriginalST) and (close[1] < ret[1] and close[1] < ST[1] and close[1] > avg[1] and close[1] < OriginalST[1]))) ThenExitshort at marketEndIfSL = 20//15//20 // Initial SLTP = 0//30TSL = 1 // Use TSL?TrailingDistance =5// 20//20//20 // Distance from close to TSLTrailingStep =5// 20//20//3 // Pips locked at start of TSL//************************************************************************IF TSL = 1 THEN//reset the stoploss valueIF NOT ONMARKET THENnewSL = 0CAND = 0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL = 0 AND CLOSE - TRADEPRICE(1) >= TrailingDistance*PipSize THENnewSL = TRADEPRICE(1) + TrailingStep*PipSizeENDIF//next movesCAND = BarIndex - TradeIndexIF newSL > 0 AND CLOSE[1] >= HIGHEST[CAND](CLOSE) THENnewSL = CLOSE[1] - TrailingDistance*PipSizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL = 0 AND TRADEPRICE(1) - CLOSE[1] >= TrailingDistance*PipSize THENnewSL = TRADEPRICE(1) - TrailingStep*PipSizeENDIF//next movesCAND = BarIndex - TradeIndexIF newSL > 0 AND CLOSE[1] <= LOWEST[CAND](CLOSE) THENnewSL = CLOSE[1] + TrailingDistance*PipSizeENDIFENDIF//stop order to exit the positionsIF newSL > 0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFSET STOP pLOSS SLset target pprofit tpENDIFNow look at the result ! 40 Millions out of € 1000 within 8 years, constant growth, almost no drawdown. And all of this by simple combination of 4 different supertrends ! No parameter optimization required anymore, forever !
1 user thanked author for this post.
01/28/2018 at 7:57 PM #60766Lo se, he añadido también un sistema de reinversión pero mi pregunta es…es esto un juego para ver quién consigue el mejor backtest?? de que sirve el backtest si luego realmente no tiene nada que ver con las operaciones en real?..
Se supone que proreatime es una plataforma de pago y debería ser fiable.A mi no me interesa tener un gran backtest, me interesa un backtest modesto pero fiable 100 o 80%…Invertir hors de trabajo para nada la verdad que no es mi idea..
01/28/2018 at 8:02 PM #6076701/28/2018 at 8:27 PM #60770Apologies @Juanan71 for me saying … logically the value TP = 0 is corrupting all the figures … I checked the top 3 profit makers (in the results) as I couldn’t believe there was 0 MAE (maximum adverse excursion). But the figures are correct, all 3 trades opened and took off and never looked back!!! See attached figures and one trade as an example.
I am going to set the Strat going live tomorrow, but only while I am sitting there watching it! 🙂 It be interesting to see how a trade develops!!! I’ll just stop the Strat if it starts losing … I do this all the time anyway on my own Strats! 🙂
I’ll let you know how I get on!!!
GraHal
01/28/2018 at 8:49 PM #60773Warning: Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced clients who have sufficient financial means to bear such risk. The articles, codes and content on this website only contain general information. They are not personal or investment advice nor a solicitation to buy or sell any financial instrument. Each investor must make their own judgement about the appropriateness of trading a financial instrument to their own financial, fiscal and legal situation.
01/28/2018 at 9:14 PM #6077401/28/2018 at 9:36 PM #6077601/28/2018 at 9:49 PM #6077801/28/2018 at 9:56 PM #6077912SELL AT newSL STOPEXITSHORT AT newSL STOPdo not sell at a difference from the positionprice, but at the exact price given by newSL.
Furthermore, when newSL = 0, these commands are not carried out, because of
1234IF newSL > 0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFGuys, don’t let yourselves be fooled – there is no money printing machine. Something must be wrong with this system, but I’m too lazy to find out what.
01/28/2018 at 10:10 PM #60780Lo se, he añadido también un sistema de reinversión pero mi pregunta es…es esto un juego para ver quién consigue el mejor backtest?? de que sirve el backtest si luego realmente no tiene nada que ver con las operaciones en real?.. Se supone que proreatime es una plataforma de pago y debería ser fiable.A mi no me interesa tener un gran backtest, me interesa un backtest modesto pero fiable 100 o 80%…Invertir hors de trabajo para nada la verdad que no es mi idea..
English Forum ???
01/28/2018 at 10:24 PM #60781Juanan71 easiest is to type in your native tongue then right click and select translate to english and then copy and paste the english into the comments box.
Oh you need to be using Chrome browser to follow above, but you can also use the Translate button at the top of each page.
01/28/2018 at 10:45 PM #60782There is a simple bug with tp.
tp is always 0 (check by graphing it).
So then the code says all the time :
1set target pprofit 0which, according to the manual, should switch off all target profit orders. However, it does not, and this is where all these fake 0 profit positions come from.
Just leave the
1set target pprofit tpcommand away (this should not change anything , but it does) , and all the nice profits are gone, too bad…
Does this seem right @nicolas ?
01/28/2018 at 11:25 PM #6078301/29/2018 at 7:23 AM #60794It isn’t very weird GraHal, thanks for testing it.
I am following this thread and working verdi55 suoertrend simplified.
I found a bit complex to use multiple supertrend of different kinds when we have simplified one done by our colleague.
vendri55 take it easy, once I use a in real money to reinvest the profit of my strategy poisoned for this idea and with 2 wrong trades it consume my profits.
…just tell us if you get millonaire though 😉
01/29/2018 at 7:40 AM #60795 -
AuthorPosts
Find exclusive trading pro-tools on