Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Divergence Line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Divergence Line

    I'd like to draw a line from the lowest MACD low of 20 bars ago to the lowest MACD low of 50 bars ago. So far I've got a line from the current MACD to the MACD 50 bars ago. If MIN(Low, 50)[0] is the lowest price in 50 bars from current, how would you write the Y value for the lowest MACD low in 50 bars from current? Would it just be:

    MIN(MACD, 50)[0] or what?

    DrawLine("MACDLine", true, 0, MACD(12, 26, 9)[0], 50, MACD(12, 26, 9)[50], Color.Yellow, DashStyle.Solid, 3);

    Thanks

    #2
    Hi kenb2004,

    If MIN(Low, 50)[0] is the lowest price in 50 bars from current, how would you write the Y value for the lowest MACD low in 50 bars from current? Would it just be:

    MIN(MACD, 50)[0]
    Exactly. That's the lowest MACD value over the last 50 bars.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Can you tell me what this means?

      CurrentBar == Bars.Count - 1

      I'd like the line to start and end at the lowest lows. Can you point me to any examples of how lowestbar() is used. I believe this is the correct way to capture the number of bars from current and use Min to capture the Value.

      Thanks

      Comment


        #4
        All these items are documented here:
        Count
        CurrentBar
        LowestBar

        If you are unsure how they may be used in various expression, start printing them and checking out the values returned.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Can you tell me what this means?

          CurrentBar == Bars.Count - 1

          Comment


            #6
            You could use that expression to test if the bar is the last bar on the chart.

            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            630 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            566 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X