Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MACD Up/Down Question

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

    MACD Up/Down Question

    Hello

    I'm using the MACD Up/Down indicator (downloaded from this forum) and I'd like to include the indicator's output in a custom strategy.

    To check whether the histogram is green or red, am I right in thinking that I need to check if
    diffArr = DiffUp =>Green Hist
    diffArr = DiffDown =>Red Hist

    My code looks like this:

    if (MACDUpDown(12, 26, 9).diffArr[0] = MACDUpDown(12, 26, 9).DiffUp[0])
    ...

    but I got two error messages, one telling me that "diff" isn't defined and one saying that "diffArr" can't be accessed.

    Could you kindly point me in the right direction?

    Thanks in advance.

    #2
    laocoon,

    You can only access things that have been exposed either as plots or as additional DataSeries/variables. Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=4991

    If you are trying to access a plot, be sure you are accessing the actual plot's name as defined in the Properties region of the indicator.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Add functionality of coloring MACD and MACD EMA based on slope

      I'm new to NinjaScript. I would like to color the MACD plot and the MACD EMA plot based on an upward or downward slope. I don't use the Histogram. Can you point me to some examples that could be applied to such a modification?

      Thanks

      Comment


        #4
        Welcome to NinjaScript - you can check into those codes / tweaks posted in our sharing for ideas and possible starting points - http://www.ninjatrader-support2.com/...ch=MACD&desc=1

        For achieving a MultiColoredPlot based on your Rising / Falling conditions, please refer to this sample from us -

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X