My LR Chanel on MACD Histogram doesn't work

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #75891 quote
    thomas2004chthomas2004ch
    Participant
    Senior

    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:

    REM Dieses Beispiel berechnet den MACD Indikator.
    
    //Parameters :
    // Len = 100
    // percent = 0.002
    
    fastMA = exponentialAverage[p](close)
    slowMA = exponentialAverage[q](close)
    
    myMACD = fastMA - slowMA
    line1 = exponentialAverage[r](myMACD)
    
    hist = myMACD - line1
    
    once j=0
    de48=DPO[Len*2](hist)
    if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] then
    flag=1
    endif
     
    n=(Len*2)-4
    p=(n/2)-1
    d100=DPO[n](hist)
    moy100=hist-d100
    co=(moy100-moy100[1]+(hist[p])/n)*n
    if flag=1 and flag[1]=0 then
    test=linearregression[Len](co)
    test1=linearregressionslope[Len](co)
    a=test1
    b=test-test1*Len
    endif
     
    if flag=0 then
    reg=undefined
    else
    j=j+1
    reg=a*j+b
    endif
     
    RETURN reg COLOURED(255,0,0) as "channel center"
     
    
    #75901 quote
    NicolasNicolas
    Keymaster
    Legend

    Where 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.

    #75935 quote
    thomas2004chthomas2004ch
    Participant
    Senior

    Hi 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).

    #75937 quote
    thomas2004chthomas2004ch
    Participant
    Senior

    Now I find out where I see the LR Channel code. It is here:

    Linear Regression Channel with percent upper and lower lines

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

My LR Chanel on MACD Histogram doesn't work


ProBuilder: Indikatoren & Custom Tools

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by thomas2004chthomas2004ch
8 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indikatoren & Custom Tools
Language: German
Started: 07/13/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...