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

Modified MACD Indicator

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

    Modified MACD Indicator

    As a NOOB NinjaScript guy, I am trying to modify a renamed version of the MACD indicator. Attached is the standard code and I thought that I should be able to change the two PLOT lines:

    Add(new Plot(Color.Green, "Macd"));
    Add(new Plot(Color.DarkViolet, "Avg"));

    to:

    /// Add(new Plot(Color.Green, "Macd"));
    /// Add(new Plot(Color.DarkViolet, "Avg"));

    But now the Indicator doesn't plot anything?

    Thanks.
    Attached Files

    #2
    jtfancher,

    Thank you for your post.

    If you were trying to remove these two plots by commenting them out the add method, there are more changes you would need to make in the OnBarUpdate and Properties section of the code.

    Rather than removing the plots, would it be easier for you to change the Colors to transparent instead?
    Code:
    Add(new Plot(Color.Transparent, "Macd"));
    Add(new Plot(Color.Transparent, "Avg"));
    Last edited by NinjaTrader_Matthew; 07-22-2011, 08:23 AM.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Matthew - thanks. At first I thought no but made a change to the Auto scale field and this worked. Bravo!

      Comment


        #4
        Great to hear!

        Since you're just getting started with NinjaScript, I would suggest keeping a close eye on the log tab of the control center for any errors when adding your project to a chart.

        If you're unable to determine what is causing the errors, you can use try-catch blocks over various segments in your code and that will trap wherever the issue is stemming from.

        Please see our Reference Sample on using Try-Catch blocks to debugg your code:



        Have a great weekend and happy coding!
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 07:51 PM
        0 responses
        8 views
        0 likes
        Last Post Rapine Heihei  
        Started by frslvr, 04-11-2024, 07:26 AM
        5 responses
        98 views
        1 like
        Last Post caryc123  
        Working...
        X