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 sjsj2732, 03-23-2026, 04:31 AM
        0 responses
        42 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        294 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        290 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        135 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        98 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X