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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X