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 AaronKoRn, Today, 09:49 PM
      0 responses
      7 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      9 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      10 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,980 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X