Position d’un indicateur par rapport à un autre
Forums › ProRealTime forum Français › Support ProScreener › Position d’un indicateur par rapport à un autre
- This topic has 4 replies, 2 voices, and was last updated 5 months ago by
finplus.
Currently, there are 0 users and 1 guest visiting this topic.
View all attachments
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
Bonjour, j’utilise les deux indicateurs suivants :
TrendEnvelop et ATRADX Trend V2123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180//////////////////////////////// Trend Envelopppes (développé par Nicolas)timePeriod=14Deviation=0.1price1=customclosedsma = WeightedAverage[timePeriod](price1)valuesHigh = (1 + deviation / 100) * dsmavaluesLow = (1 - deviation / 100) * dsmainputs=price1if (inputs > valuesHigh)thentrend = 1elsif (inputs < valuesLow) thentrend = -1endifif (trend > 0) thenalpha1 = 0if ( valuesLow < valuesLow[1]) thenvaluesLow = valuesLow[1]endifif trend[1]>0 thenoutputs0 = valuesLowoutputs1 = valueshighalpha0 = 255endifelsealpha0=0if (valuesHigh > valuesHigh[1]) thenvaluesHigh = valuesHigh[1]endifif trend[1]<0 thenoutputs1 = valuesHighoutputs0 = valueslowalpha1 = 255endifendifreturn outputs0 coloured(65,105,225,alpha0) as "EnvelopUp", outputs1 coloured(255,0,0,alpha1) as "Envelopdn"//PRC_Adaptive-ATR-ADX-Trend-V2 | indicator//29.06.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//translated from tradingview code// --- settingsatrLen = 21m1 = 3.5 //"ATR Multiplier - ADX Rising"m2 = 1.75 //"ATR Multiplier - ADX Falling"adxLen = 14adxThresh = 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=MedianPriceendifupATR = t - mUp * atrdnATR = t + mDn * atrif max(src[1], c[1]) > TUp[1] thenTUp = max(upATR,TUp[1])elseTUp = upATRendifif min(src[1], c[1]) < TDown[1] thenTDown = min(dnATR, TDown[1])elseTDown = dnATRendif//trendif min(src,min(c,close))>TDown[1] thentrendATR=1elsif max(src,max(c,close))<TUp[1] thentrendATR=-1elsetrendATR=trendATR[1]endifif trendATR=1 thensstop=TUpelsesstop=TDownendifreturn sstop as "ATR ADX Trend"J’aurai aimé identifié les valeurs dont EnvelopUp est au dessus de l’ATR ADX Trend et les valeurs dont EnvelopDn est au dessous de l’ATR ADX Trend.
Quelqu’un peut-il m’aider ?
Merci.
Bonjour,
Afin d’éviter les call dans le screener, si les noms de variables de l’un des indicateurs sont tous différents de ceux de l’autre (s’il y en a de même nom, modifier les noms), tu peux recopier chacun des 2 indicateurs sans leur dernière ligne return dans un screener, puis ajouter à la fin du screener:
123cond= outputs0 > sstop // EnvelopUp est au dessus de l’ATR ADX Trendscreener[cond]ou pour l’autre screener:
123cond= outputs1 < sstop // EnvelopDn est en dessous de l’ATR ADX Trendscreener[cond] -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
Find exclusive trading pro-tools on
Similar topics: