TS STRATEGIA con trend-V2
Forums › ProRealTime forum Italiano › Supporto ProOrder › TS STRATEGIA con trend-V2
- This topic has 4 replies, 2 voices, and was last updated 9 months ago by Gaspare.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
02/09/2024 at 6:36 PM #227773123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137//PRC_Adaptive-ATR-ADX-Trend-V2 | indicator//29.06.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//translated from tradingview code// --- settings//atrLen = 21//m1 = 3.5 //"ATR Multiplier - ADX Rising"//m2 = 1.75 //"ATR Multiplier - ADX Falling"//adxLen = 14//adxThresh = 30 //"ADX Threshold"//aboveThresh = 1 //true, title = "ADX Above Threshold uses ATR Falling Multiplier Even if Rising?")//useHeiken = 1 //(false, title = "Use Heiken-Ashi Bars (Source will be ohlc4)")// --- end of settingssource = MedianPrice// DI-Pos, DI-Neg, ADXhR = high-high[1]lR = -(low-low[1])if hr>lr thendmPos=max(hr,0)elsedmPos=0endifif lr>hr thendmNeg=max(lr,0)elsedmNeg=0endifsTR = (sTR[1] - sTR[1]) / adxLen + trsDMPos = (sDMPos[1] - sDMPos[1]) / adxLen + dmPossDMNeg = (sDMNeg[1] - sDMNeg[1]) / adxLen + dmNegDIP = sDMPos / sTR * 100DIN = sDMNeg / sTR * 100DX = abs(DIP - DIN) / (DIP + DIN) * 100aadx = average[adxLen](DX)// Heiken-Ashiif barindex<2 thenxClose = closexOpen = openelsexClose = TotalPricexOpen = (xOpen[1] + close[1]) / 2endifxHigh = max(high, max(xOpen, xClose))xLow = min(low, min(xOpen, xClose))// Trailing ATRv1 = abs(xHigh - xClose[1])v2 = abs(xLow - xClose[1])v3 = xHigh - xLowtrueRange = max(v1, max(v2, v3))if useHeiken thenatr = WilderAverage[atrLen](trueRange)elseatr = AverageTrueRange[atrLen]endifif aadx>aadx[1] and (adx < adxThresh or not aboveThresh) thenm=m1elsif aadx<aadx[1] or (adx > adxThresh and aboveThresh) thenm=m2elsem = m[1]endifif DIP >= DIN thenmUp=melsemUp=m2endifif DIN >= DIP thenmDn=melsemDn=m2endifif useHeiken thensrc=xClosec=Xcloset=(xHigh+xLow)/2elsesrc=sourcec=closet=MedianPriceendifup = t - mUp * atrdn = t + mDn * atrif max(src[1], c[1]) > TUp[1] thenTUp = max(up,TUp[1])elseTUp = upendifif min(src[1], c[1]) < TDown[1] thenTDown = min(dn, TDown[1])elseTDown = dnendif//trendif min(src,min(c,close))>TDown[1] thentrend=1elsif max(src,max(c,close))<TUp[1] thentrend=-1elsetrend=trend[1]endifif trend=1 thensstop=TUpr=0g=153elsesstop=TDownr=255g=0endifif trend<>trend[1] thendrawtext("•",barindex,sstop,Dialog,Standard,12) coloured(r,g,0)endifreturn sstop coloured(r,g,0) style(line,2)
Ciao Roberto
per favore puoi trasformare questo indicatore in strategia?
Grazie
02/10/2024 at 10:31 AM #227797Chiedo scusa Roberto
annulla tutto, ho ritrovato la strategia
Grazie
1 user thanked author for this post.
02/10/2024 at 12:13 PM #22780002/10/2024 at 3:47 PM #227808123456789Ind = CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[21, 3.5000000000000004, 1.7500000000000002, 14, 30, 0, 1](close)IF close crosses over Ind and Long and MyAdx thenbuy 1 contract at marketelsif close crosses under Ind and Short and MyAdx thensellshort 1 contract at marketendif//set stop ploss 100//SET TARGET pPROFIT 500Certo, eccone una estremamente semplice che entra su un incrocio e poi fa lo Stop & Reverse
su quello opposto (se non ha ancora raggiunto lo SL o il TP):
Ciao
02/10/2024 at 3:49 PM #227809 -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
Find exclusive trading pro-tools on
Similar topics: