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 pechtri, 06-22-2023, 02:31 AM
      9 responses
      122 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by frankthearm, 04-18-2024, 09:08 AM
      16 responses
      64 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by habeebft, Today, 01:18 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by benmarkal, Today, 12:52 PM
      2 responses
      13 views
      0 likes
      Last Post benmarkal  
      Started by f.saeidi, Today, 01:38 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X