Super Z Strategy
Forums › ProRealTime English forum › ProOrder support › Super Z Strategy
- This topic has 7 replies, 3 voices, and was last updated 5 years ago by
mykologen.
-
-
10/04/2020 at 1:56 AM #146301
Here is another strategy I converted from TV.
Results attached.Can I request a 200k results for this please?
Even if looks a bit curve fitted, its could be because of trailing stop function there.The entries are decent most of the times so might need an expert’s optimisation.
Please run, feedback and improve.
Super123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200//Converted from TV strategy// Converted by boonetdefparam cumulateorders = falseTimeframe(1 hour)stmult = 2stperiod = 9atr = max(max((high-low),abs(high-close[1])),abs(low-close[1]))uplev= low - (stmult * atr[stperiod])dnlev= high + (stmult * atr[stperiod])uptrend=0.0if close[1] > uptrend[1] thenuptrend = max(uplev,uptrend[1])elseuptrend = uplevendifdowntrend = 0.0if close[1] < downtrend[1] thendowntrend = min(dnlev,downtrend[1])elsedowntrend = dnlevendiftrend = 0if close > downtrend[1] thentrend = 1elsif close < uptrend[1] thentrend = -1endifif trend=1 thenstline = uptrendelsif trend =-1 thenstline = downtrendendifbullish = close crosses over stlinebearish = close crosses under stlineTimeframe(default)// Conditions to enter long positionsIF NOT LongOnMarket AND bullish THENBUY 1 CONTRACTS AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket AND bearish THENSELLSHORT 1 CONTRACTS AT MARKETENDIF//SET STOP loss 500//Break evenbreakevenPercent = 0.13PointsToKeep = 20startBreakeven = tradeprice(1)*(breakevenpercent/100)once breakeven = 0//1 on - 0 off//reset the breakevenLevel when no trade are on marketif breakeven>0 thenIF NOT ONMARKET THENbreakevenLevel=0ENDIF// --- BUY SIDE ---//test if the price have moved favourably of "startBreakeven" points alreadyIF LONGONMARKET AND close-tradeprice(1)>=startBreakeven*pipsize THEN//calculate the breakevenLevelbreakevenLevel = tradeprice(1)+PointsToKeep*pipsizeENDIF//place the new stop orders on market at breakevenLevelIF breakevenLevel>0 THENSELL AT breakevenLevel STOPENDIF// --- end of BUY SIDE ---IF SHORTONMARKET AND tradeprice(1)-close>startBreakeven*pipsize THEN//calculate the breakevenLevelbreakevenLevel = tradeprice(1)-PointsToKeep*pipsizeENDIF//place the new stop orders on market at breakevenLevelIF breakevenLevel>0 THENEXITSHORT AT breakevenLevel STOPENDIFendif// trailing atr stoponce trailingstoptype = 1 // trailing stop - 0 off, 1 ononce tsincrements = .01 // set to 0 to ignore tsincrementsonce tsminatrdist = 1//3once tsatrperiod = 14 // ts atr parameteronce tsminstop = 12 // ts minimum stop distanceonce tssensitivity = 1 // [0]close;[1]high/lowif trailingstoptype thenif barindex=tradeindex thentrailingstoplong = 2//4 // ts atr distancetrailingstopshort = 2//4 // ts atr distanceelseif longonmarket thenif tsnewsl>0 thenif trailingstoplong>tsminatrdist thenif tsnewsl>tsnewsl[1] thentrailingstoplong=trailingstoplongelsetrailingstoplong=trailingstoplong-tsincrementsendifelsetrailingstoplong=tsminatrdistendifendifendifif shortonmarket thenif tsnewsl>0 thenif trailingstopshort>tsminatrdist thenif tsnewsl<tsnewsl[1] thentrailingstopshort=trailingstopshortelsetrailingstopshort=trailingstopshort-tsincrementsendifelsetrailingstopshort=tsminatrdistendifendifendifendiftsatr=averagetruerange[tsatrperiod]((close/10)*pipsize)/1000//tsatr=averagetruerange[tsatrperiod]((close/1)*pipsize) // (forex)tgl=round(tsatr*trailingstoplong)tgs=round(tsatr*trailingstopshort)if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thentsmaxprice=0tsminprice=closetsnewsl=0endifif tssensitivity thentssensitivitylong=hightssensitivityshort=lowelsetssensitivitylong=closetssensitivityshort=closeendifif longonmarket thentsmaxprice=max(tsmaxprice,tssensitivitylong)if tsmaxprice-tradeprice(1)>=tgl*pointsize thenif tsmaxprice-tradeprice(1)>=tsminstop thentsnewsl=tsmaxprice-tgl*pointsizeelsetsnewsl=tsmaxprice-tsminstop*pointsizeendifendifendifif shortonmarket thentsminprice=min(tsminprice,tssensitivityshort)if tradeprice(1)-tsminprice>=tgs*pointsize thenif tradeprice(1)-tsminprice>=tsminstop thentsnewsl=tsminprice+tgs*pointsizeelsetsnewsl=tsminprice+tsminstop*pointsizeendifendifendifif longonmarket thenif tsnewsl>0 thensell at tsnewsl stopendifif tsnewsl>0 thenif low crosses under tsnewsl thensell at market // when stop is rejectedendifendifendifif shortonmarket thenif tsnewsl>0 thenexitshort at tsnewsl stopendifif tsnewsl>0 thenif high crosses over tsnewsl thenexitshort at market // when stop is rejectedendifendifendifendif1 user thanked author for this post.
10/04/2020 at 1:59 AM #14630210/04/2020 at 2:21 AM #14630510/04/2020 at 8:21 AM #14631410/04/2020 at 1:20 PM #146374Hi Boonet,
I poured your code in the the layout of vectorial. This is a good example to test retry.
One pic is similar to yours with retry off. I didn’t match be/ts/sl though. (here sl2%,ts1%) (no rsi stochastic or something else, but with mri)
the second pic, I activated retry and the problem became visible. Too many signals in one area, which means big problems & low quality.
The bigger the Stoploss, trailing stop, the less meaning have a signal, as they don’t get out and keep stuck to the position and curvetting will show nice graph.
I can post the code now, but maybe I can improve a bit.
1 user thanked author for this post.
10/04/2020 at 2:42 PM #14638610/04/2020 at 6:42 PM #14641410/04/2020 at 9:18 PM #146421 -
AuthorPosts
Find exclusive trading pro-tools on