Moving Average Accumulation Distribution line is above or below EMA?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #123251 quote
    ChrisTourDuMondeChrisTourDuMonde
    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
    VonasiVonasi
    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
    ChrisTourDuMondeChrisTourDuMonde
    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
    NicolasNicolas
    Keymaster
    Legend

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

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

    BINGO  !

    Thank you Nicolas 🙂

    #123558 quote
    VonasiVonasi
    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.
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

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 VonasiVonasi
6 years, 6 months ago.

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