Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 -

        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        31 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X