MACD indicator help

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #65531 quote
    Jonas HolgerssonJonas Holgersson
    Participant
    New

    Hello.

     

    Im new to this and trying to make a indicator that uses EMA5 and 14 and MACD.

    i want one indicator that shows 1 if EMA5 above EMA14 and The blue line is above the red in MACD.

    Also if possible, id like it to show -1 if EMA5 below EMA14 and blue line under red in MACD

    else show 0.

    I get the EMA5/14 part. but cant figure out how to code the MACD.

    Thankfully accepting pointers:)

    #65538 quote
    GertradeGertrade
    Participant
    Veteran

    Hi jonas,

    That’s what I coded according to what was requested.

     

    macdline0 = MACDline[12,26,9](close)
    macd0 = MACD[12,26,9](close)
    
    ema5 = ExponentialAverage[5](close)
    ema14 = ExponentialAverage[14](close)
    
    macdbull = macdline0 > macd0
    macdbear = macdline0 < macd0
    
    emabull = ema5 > ema14
    emabear = ema5 < ema14
    
    if macdbull and emabull then
    dir = 1
    elsif macdbear and emabear then
    dir = -1
    else
    dir = 0
    endif
    
    return dir
    
    Nicolas thanked this post
    #65539 quote
    GraHalGraHal
    Participant
    Master

    Have you taken account that the PRT MACD is not like everybody’s else’s MACD?? See / read below

    Surely such a basic Indicator as the MACD can’t be wrong in the standard PRT listings???

Viewing 3 posts - 1 through 3 (of 3 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

MACD indicator help


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/17/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...