standard PRT code for MACD

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #189636 quote
    mwilkens111
    Participant
    New

    Can anyone provide the code for the standard MACD provided by Prorealtime? I would like to start with that and then modify from there on.

    Thank you

    Markus

    #189640 quote
    robertogozzi
    Moderator
    Master

    There you go:

    // MACD 12,26,9 (formula)
    //
    // https://en.wikipedia.org/wiki/MACD
    // https://www.ig.com/uk/glossary-trading-terms/moving-average-convergence-divergence-definition
    //
    MyMACD       = ExponentialAverage[12](close) - ExponentialAverage[26](close)
    MySignalLine = ExponentialAverage[9](MyMACD)
    MyHistogram  = MyMACD - MySignalLine
    RETURN MyMACD AS "Macd",MySignalLine AS "Signal",MyHistogram AS "Histogram"
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

standard PRT code for MACD


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
3 years, 11 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 03/08/2022
Status: Active
Attachments: No files
Logo Logo
Loading...