Moving Average Accumulation Distribution line is above or below EMA?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #123251 quote
    ChrisTourDuMonde
    Participant
    Junior

    Hello,

    It s probably super simple but i can’t make it so ..

    Do you know how i could test if the accumulation distribution line is above or below an Exponential moving average ?

    Thanks

    myAD = AccumDistr(open)
    
    EMA150 = exponentialaverage[150][myAD]
    
    if myAD > EMA150 then
    
    drawvline(barindex) coloured(0,255,0)
    
    else
    
    drawvline(barindex) coloured(255,0,0)
    
    endif
    
    return
    
    accumulation-distribution.png accumulation-distribution.png
    #123268 quote
    Vonasi
    Moderator
    Master

    You might need to ensure that you have enough bars to do the first average calculation. Often this is an issue why indicators do not display. Not tested – just a guess.

    if barindex >= 150 then
    myAD = AccumDistr(open)
    EMA150 = exponentialaverage[150][myAD]
    
    if myAD > EMA150 then
    drawvline(barindex) coloured(0,255,0)
    else
    drawvline(barindex) coloured(255,0,0)
    endif
    endif
    
    return
    #123270 quote
    ChrisTourDuMonde
    Participant
    Junior

    Thanks for the Reply,

    Unfortunately i run in the same error :

    “Error in the indicator ”

    “A positive integer field is expected with myAD”

    #123272 quote
    Nicolas
    Keymaster
    Master

    You used brackets for the data serie in your EMA instruction while it needs parenthesis:

    EMA150 = exponentialaverage[150](myAD)
    #123276 quote
    ChrisTourDuMonde
    Participant
    Junior

    BINGO  !

    Thank you Nicolas 🙂

    #123558 quote
    Vonasi
    Moderator
    Master

    “A positive integer field is expected with myAD”

    That key bit of information might have been quite useful in your first post!

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

Moving Average Accumulation Distribution line is above or below EMA?


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Vonasi
5 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/25/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...