ASCTrend + MACD
Forums › ProRealTime forum Français › Support ProBuilder › ASCTrend + MACD
- This topic has 2 replies, 2 voices, and was last updated 3 years ago by larouedegann.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
03/07/2021 at 4:52 PM #163368
Bonjour,
j’aimerai coupler l’indicateur ASCTrend avec la ligne MACD
123mcd = MACDline[12,26,9](close)c1 = mcd<0c2 = mcd>0de manière à ce que le DRAWARROWDOWN (de ASCTrend) prenne en compte c2 et DRAWARROWUP la c1.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112//PRC_ASCTrend | indicator//13.01.2021//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//converted from MT4 version// --- settingsRISK=3CountBars=300// --- end of settingsvalue10=3+RISK*2x1=67+RISKx2=33-RISKvalue11=value10shift=CountBars-11-1if islastbarupdate and barindex>CountBars thenwhile(shift>=0) doCounter=shiftiRange=0.0AvgRange=0.0for Counter=shift to shift+9 doAvgRange=AvgRange+Abs(High[Counter]-Low[Counter])nextiRange=AvgRange/10Counter=shiftTrueCount=0while (Counter<shift+9 and TrueCount<1) doif (Abs(Open[Counter]-Close[Counter+1])>=iRange*2.0) thenTrueCount=TrueCount+1endifCounter=Counter+1wendif (TrueCount>=1) thenMRO1=CounterelseMRO1=-1endifCounter=shiftTrueCount=0while (Counter<shift+6 and TrueCount<1) doif (Abs(Close[Counter+3]-Close[Counter])>=iRange*4.6) thenTrueCount=TrueCount+1endifCounter=Counter+1wendif (TrueCount>=1) thenMRO2=CounterelseMRO2=-1endifif (MRO1>-1) thenvalue11=3elsevalue11=value10endifif (MRO2>-1) thenvalue11=4elsevalue11=value10endifvalue2=100-Abs(Williams[value11](close)[shift]) // PercentR(value11=9)$Tablevalue2[shift]=value2$val1[shift]=0$val2[shift]=0value3=0if (value2<x2) theni1=1while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) doi1=i1+1wendif ($Tablevalue2[shift+i1]>x1) thenvalue3=High[shift]+iRange*0.5if (shift = 1 and flagval1=0) thenflagval1=1flagval2=0endif$val1[shift]=value3drawarrowdown(barindex[shift],$val1[shift]) coloured(255,0,255)endifendifif (value2>x1) theni1=1while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) doi1=i1+1wendif ($Tablevalue2[shift+i1]<x2) thenvalue3=Low[shift]-iRange*0.5if (shift = 1 and flagval2=0) thenflagval2=1flagval1=0endif$val2[shift]=value3drawarrowup(barindex[shift],$val2[shift]) coloured(0,255,255)endifendifshift=shift-1wendendifreturnj’ai tout essayé dans les conditions de asctrend, mais je ne suis pas arrivé.
Si quelqu’un à une solution ? c’est avec plaisir.
03/08/2021 at 8:50 AM #163411La version que tu utilises place les flèches dans le passé à partir de la bougie courante, la version ci-dessous le fait en lisant l’historique (code plus simple à comprendre si tu ne maîtrises pas les array), j’ai intégré ta condition sur le MACD.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586// --- settingsRISK=3// --- end of settingsmcd = MACDline[12,26,9](close)c1 = mcd<0c2 = mcd>0value10=3+RISK*2x1=67+RISKx2=33-RISKvalue11=value10shift=0//CountBars-11-1buysig=0sellsig = 0Counter=shiftiRange=0.0AvgRange=0.0for Counter=shift to shift+9 doAvgRange=AvgRange+Abs(High[Counter]-Low[Counter])nextiRange=AvgRange/10Counter=shiftTrueCount=0while (Counter<shift+9 and TrueCount<1) doif (Abs(Open[Counter]-Close[Counter+1])>=iRange*2.0) thenTrueCount=TrueCount+1endifCounter=Counter+1wendif (TrueCount>=1) thenMRO1=CounterelseMRO1=-1endifCounter=shiftTrueCount=0while (Counter<shift+6 and TrueCount<1) doif (Abs(Close[Counter+3]-Close[Counter])>=iRange*4.6) thenTrueCount=TrueCount+1endifCounter=Counter+1wendif (TrueCount>=1) thenMRO2=CounterelseMRO2=-1endifif (MRO1>-1) thenvalue11=3elsevalue11=value10endifif (MRO2>-1) thenvalue11=4elsevalue11=value10endifvalue2=100-Abs(Williams[value11](close)[shift]) // PercentR(value11=9)if (value2<x2) then//signalsif value2[1]>x2[1] and lastsig>=0 and c2 thensellsig = 1lastsig = -1drawarrowdown(barindex[0],High[0]+iRange*0.5) coloured(255,0,255)endifendifif (value2>x1) then//signalsif value2[1]<x1[1] and lastsig<=0 and c1 thenbuysig = 1lastsig = 1drawarrowup(barindex[0],Low[0]-iRange*0.5) coloured(0,255,255)endifendifreturn03/08/2021 at 10:32 AM #163425 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: