My LR Chanel on MACD Histogram doesn't work
Forums › ProRealTime Deutsch forum › ProBuilder Support › My LR Chanel on MACD Histogram doesn't work
- This topic has 3 replies, 2 voices, and was last updated 6 years ago by thomas2004ch.
-
-
07/13/2018 at 7:30 AM #75891
Hi,
I try to apply the LR-Chanel indicator created by Nikolas on the MACD Histogram but it shows nothing when I add this onto the MACD.
My code looks as follow:
12345678910111213141516171819202122232425262728293031323334353637383940REM Dieses Beispiel berechnet den MACD Indikator.//Parameters :// Len = 100// percent = 0.002fastMA = exponentialAverage[p](close)slowMA = exponentialAverage[q](close)myMACD = fastMA - slowMAline1 = exponentialAverage[r](myMACD)hist = myMACD - line1once j=0de48=DPO[Len*2](hist)if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] thenflag=1endifn=(Len*2)-4p=(n/2)-1d100=DPO[n](hist)moy100=hist-d100co=(moy100-moy100[1]+(hist[p])/n)*nif flag=1 and flag[1]=0 thentest=linearregression[Len](co)test1=linearregressionslope[Len](co)a=test1b=test-test1*Lenendifif flag=0 thenreg=undefinedelsej=j+1reg=a*j+bendifRETURN reg COLOURED(255,0,0) as "channel center"07/13/2018 at 10:02 AM #75901Where is from the original code of the LR channel please?
In your code, flag will never be equal to 1 and thus calculation of the channel will never start. Condition at line 17 will surely never be true, that’s where the trouble is, at the first glance.
07/13/2018 at 8:47 PM #75935Hi Nicolas,
I forgot where I exactly see this code. It is definitely from this forum. I though it was from you.
>>…Condition at line 17 will surely never be true…
Why? If I replace the ‘hist’ with ‘close’ or ‘high’ or ‘low’. It works (without the MACD code).
07/13/2018 at 8:50 PM #75937Now I find out where I see the LR Channel code. It is here:
-
AuthorPosts
Find exclusive trading pro-tools on