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

Plotting 2 SMAs within one Indicator

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

    Plotting 2 SMAs within one Indicator

    Greetings!

    I've discovered (I think) that two SMAs of different lengths can not be plotted from within one Indicator. The indicator would compile, but the process would stop dead in its tracks upon seeing the second SMA plot request. I deleted the second SMA plot request, and it ran fine.

    e.g. SMAFast.Set(SMA(8));
    SMASlow.Set(SMA(30));

    Any thoughts?

    Thanks! :-)

    #2
    You don't want to "Set" to a whole DataSeries. You want to set to individual values. Try this:

    Code:
    SMAFast.Set(SMA(8)[COLOR=Red][0][/COLOR]);     
    SMASlow.Set(SMA(30)[COLOR=Red][0][/COLOR]);
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you!

      I am an idiot ... I had 5 plots, and in the "Properties" section, allocated values 0,1,2,4,and 5. So it didn't recognize a 5th plot ... (should have been values 0,1,2,3,4) ... Grrr.

      I can't tell you how much time I spent trying to figure out something so stupid!

      Thank you again!

      :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Balage0922, Today, 07:38 AM
      0 responses
      3 views
      0 likes
      Last Post Balage0922  
      Started by JoMoon2024, Today, 06:56 AM
      0 responses
      6 views
      0 likes
      Last Post JoMoon2024  
      Started by Haiasi, 04-25-2024, 06:53 PM
      2 responses
      19 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      6 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Working...
      X