Trend adattivo ATR-ADX
Forums › ProRealTime forum Italiano › Supporto ProOrder › Trend adattivo ATR-ADX
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by robertogozzi.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
05/28/2021 at 1:49 PM #170685
ciao Roberto
per favore si puo’ inserire una strategia a questo indicatore?
Grazie
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137//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=255elsesstop=TDownr=255g=0endifif trend<>trend[1] thendrawtext("•",barindex,sstop,Dialog,Standard,30) coloured(r,g,0)endifreturn sstop coloured(r,g,0) style(line,2)05/28/2021 at 3:11 PM #170693Certo, 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):
12345678Ind = CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[21, 3.5000000000000004, 1.7500000000000002, 14, 30, 0, 1](close)IF close crosses over Ind thenbuy at marketelsif close crosses under Ind thensellshort at marketendifset target pprofit 500set stop ploss 10005/28/2021 at 4:05 PM #17069605/28/2021 at 5:59 PM #170706Puoi ottimizzare qualunque dei numeri evidenziati in ROSA, sia quelli che servono all’indicatore (tra parentesi quadre), sia per il TP e lo SL.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: