• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 fredfred, Today, 03:41 AM
      2 responses
      8 views
      0 likes
      Last Post fredfred  
      Started by TraderYoda, Today, 03:33 AM
      0 responses
      1 view
      0 likes
      Last Post TraderYoda  
      Started by pjsmith, Today, 02:56 AM
      0 responses
      3 views
      0 likes
      Last Post pjsmith
      by pjsmith
       
      Started by ntbone, Yesterday, 08:10 PM
      0 responses
      11 views
      0 likes
      Last Post ntbone
      by ntbone
       
      Started by chrislou, 08-28-2015, 03:27 AM
      14 responses
      2,884 views
      0 likes
      Last Post nkhoi
      by nkhoi
       
      Working...
      X