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

AddDataSeries destroys the chart

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

    AddDataSeries destroys the chart

    Hi all,

    I have an issue adding an additional DataSeries. This fully destroys the chart. Have a look at the attached image. Above is ok, below is the destroyed chart.

    Thanks for your help...
    Attached Files

    #2
    Hello Sweet&Sour,

    Thanks for your post.

    The chart is not destroyed as it is still there. What has happened is that it appears the indicator is now being calculated using ^SP500 instead of AAPL. The ^SP500 is around 2900 which is what your indicator is plotting at. Because the indicator has its autoscale set to true, the chart adjusts to show the indicator plots as well as the AAPL dataseries which in this case appears quite small as its typical value is only 185 whilst ^SP500 is at 2900.

    If you want your indicator to only calculate based on the chart bars (AAPL) then in your code you would need to add a line in the OnBarUpdate() such as: if (BarsInProgress !=0) return; however this may not be a satisfactory solution depending on what you want to do by adding the ^SP500 data to your indicator.

    We highly recommend reviewing the helpguide section on multi time frame/multi instrument scripts as there are many considerations when doing so: https://ninjatrader.com/support/help...nstruments.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul,

      BarsInProgress != 0 solved my issue.
      I'm just checking afterwards whether or not, the SPX closes for at least 3 bars above the sma50.

      Thanks...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Kaledus, Today, 01:29 PM
      5 responses
      12 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by alifarahani, Today, 09:40 AM
      5 responses
      23 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PhillT, Today, 02:16 PM
      2 responses
      7 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Working...
      X