macd pivot

Optuma Forums Optuma Scripting macd pivot

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #58073
    • Topics: 21
    • Replies: 18
    • Posts: 39

    I’m trying to use a showbar to show a weekly macd pivot on a daily chart. When I compare charts side by side the showbar on the daily chart is not at the same point (time), as the macd pivot on the weekly chart. This is the script I have tried.

    o1 = OSC(Week(PERIODAMOUNT=1), BARS1=12, BARS2=24, STYLE=Exponential);
    p1 = PIVOT(Week(PERIODAMOUNT=1), o1, MIN=22, TYPE=Both);
    l1 = (o1 < 0) and (p1 < 0);


    Any advice to solving this issue?

    Thanks Peter

    • Topics: 4
    • Replies: 254
    • Posts: 258

    Hi Peter,

    MACD has its own scripting function, OSC() is for other tools, so the values won’t match.

    Additionally as the Pivot is calculated from the MACD data you don’t need to set a Time Frame override on that line, just the MACD.

    The adjusted script is:

    On the chart the Show Bars on the daily time frame match those on the Weekly:


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

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.