Indicatore Ledge Atr e pattern
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Indicatore Ledge Atr e pattern
- This topic has 1 reply, 2 voices, and was last updated 1 year ago by robertogozzi.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
03/25/2023 at 3:15 PM #212105
Salve, vorrei fare delle modifiche ad un indicatore di massimi e minimi giornalieri con dei pattern se è possibile,
vorrei togliere i livelli di massimi e minimi giornalieri e sostituire a loro posto i livelli volatilità ATR chiamato ledge atr, per il resto vorrei lasciare tutto uguale
Riporto i codici sotto.
Grazie
Indicatore livelli Massimo e Minimo123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112//parametersenableshootingstar=1enablehammer=1enablereversalhigh=1enablereversallow=1//VolumeCheck=1//MinSize=10 //size in pointsnbcandle=5 //number of candle for the relative price verification//Shooting star//1. this candle follows a bearish signal//2. follows the calculation formulaif enableshootingstar thenSc1=High=Highest[5](High)Sc2=Close < (Low+((High-Low)/3))Sc3=Open < (Low+((High-Low)/3))shootingstar=Sc1 and Sc2 and Sc3endif//Hammer//1. this candlestick follows a bullish signal// 2. it follows the calculation formula (mirroring that of a shooting star)if enablehammer=1 thenHc1=Low=Lowest[5](Low)Hc2=Close > High-((High-Low)/3)Hc3=Open > High-((High-Low)/3)hammer=Hc1 and Hc2 and Hc3endif//Reversal High//1. this candlestick follows a bearish signalif enablereversalhigh=1 thenRHc1=High=Highest[5](High)RHc2=Close < Close[1]reversalhigh=RHc1 and RHc2endif//Reversal Low//1. this candle follows a bullish signalif enablereversallow=1 thenRLc1=Low=Lowest[5](Low)RLc2=Close > Close[1]reversallow=RLc1 and RLc2endifif VolumeCheck=1 thenvolumeVerification = Volume[1]=Highest[5](Volume)[1]//volumeVerification = High[1]=Highest[5](High)[1]elsevolumeVerification=1endif//Size checksizeVerification=high[1]-low[1] >= minsize*pointsize//Relative maximum/minimum verificationMaxVerification=high > highest[nbcandle](high[1]) //for bullish signalMinVerification=low < lowest[nbcandle](low[1]) // for bearish signal//price levelcurrMax = dhigh(0)[1]currMin = dlow(0)[1]price1=dhigh(1)price2=dhigh(2)price3=dlow(1)price4=dlow(2)//checkprice=(high crosses over price1 and high > price1+5*pointsize) or (high crosses over price2 and high > price2*5*pointsize) or (high crosses over price3 and high > price3*5*pointsize) or (high crosses over price4 and high > price4*5*pointsize) or (low crosses under price1 and low < price1-5*pointsize) or (low crosses under price2 and low < price2-5*pointsize) or (low crosses under price3 and low < price3-5*pointsize) or (low crosses under price4 and low < price4-5*pointsize)if HighLowCheck then//checkprice=(high crosses over price1) or (high crosses over price2) or (high crosses over price3) or (high crosses over price4) or (low crosses under price1) or (low crosses under price2) or (low crosses under price3) or (low crosses under price4)checkpriceDH0=(high[1] >= currMax and low[1] <= currMax)checkpriceDL0=(high[1] >= currMin and low[1] <= currMin)checkpriceDH1=(high[1] >= price1 and low[1] <= price1)checkpriceDH2=(high[1] >= price2 and low[1] <= price2)checkpriceDL1=(high[1] >= price3 and low[1] <= price3)checkpriceDL2=(high[1] >= price4 and low[1] <= price4)checkprice=(checkpriceDH0 or checkpriceDL0) and (checkpriceDH1 or checkpriceDH2 or checkpriceDL1 or checkpriceDL2)elsecheckprice=1endifSSHm=0RHRL=0allPattern = 0if barindex>20 thenSSHm=0RHRL=0//displayif shootingstar[1] thenDRAWTEXT("S", barindex[1], high) coloured (255,0,0)SSHm = 1endifif hammer[1] thenDRAWTEXT("H", barindex[1], low) coloured (0,255,0)SSHm=-1endif//if reversalhigh and sizeverification and MinVerification and checkprice thenif reversalhigh[1] thenDRAWTEXT("RH", barindex[1], high) coloured (255,0,0)RHRL=1endif//if reversallow and sizeverification and MaxVerification and checkprice thenif reversallow[1] thenDRAWTEXT("RL", barindex[1], low) coloured (0,255,0)RHRL=-1endifendifif (SSHm = 1 or SSHm=-1 or RHRL=1 or RHRL=-1) and (sizeVerification and checkprice and volumeVerification) thenallPattern = 1endifreturn SSHm COLOURED (255, 0, 0) as "ShootingStar or Hammer", RHRL COLOURED (0, 255, 0) as "Reversal", sizeVerification as "SizeVer", high-low as "Size", volumeVerification as "VolumeVer" , checkpriceDH0 as "DH0",checkpriceDL0 as "DL0", checkpriceDH1 as "DH1", checkpriceDH2 as "DH2", checkpriceDL1 as "DL1", checkpriceDL2 as "DL2", allPattern COLOURED (0, 0, 255) as "All"//, barindex//return BarIndexl’altro indicatore chiamato Ledge ATR è il seguente
LEDGE ATR123456789101112131415161718192021222324252627282930defparam drawonlastbaronly=true// --- parametersATRperiod = 20// ---dTR = 0for i = 0 to ATRperioddTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))nextavg = dTR/ATRperiodconverted = round(avg/pointsize*10)/10htr = Dlow(0)+avg[1]ltr = Dhigh(0)-avg[1]if intradaybarindex=0 thenbegin=barindexendifdrawsegment(begin,htr,barindex,htr) coloured(200,100,0)drawsegment(begin,htr+20*pointsize,barindex,htr+20*pointsize) coloured(200,100,0)drawtext("#htr# - (D1atr: #converted#)",barindex,htr+10*pointsize,Dialog,Bold,10) coloured(200,100,0)drawsegment(begin,ltr,barindex,ltr) coloured(200,100,0)drawsegment(begin,ltr-20*pointsize,barindex,ltr-20*pointsize) coloured(200,100,0)drawtext("#ltr# - (D1atr: #converted#)",barindex,ltr-10*pointsize,Dialog,Bold,10) coloured(200,100,0)drawsegment(begin,Dopen(0),barindex,Dopen(0)) coloured(255,140,0)return05/02/2023 at 1:10 AM #213956Nel primo sarebbero da togliere i dati delle variabili CHECKPRICEXXX?
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on
Similar topics: