• 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

Adding an instrument in a indicator turns SMA return to negative number

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

  • NinjaTrader_ChrisL
    replied
    Hello jkt1120, Thanks for your post.

    It sounds like the script is running into invalid data points between the RTY series and the VIX series. Comparing 100 tick VIX and RTY charts shows the VIX is sparse compared to the RTY. If the script accesses the secondary VIX series on every index of the primary series you should check that the series index is valid with IsValidDataPoint(). Printing out the values of the rawDuration series could also shed light on what's being calculated for the SMA result.

    I look forward to hearing of your results.

    Leave a comment:


  • Adding an instrument in a indicator turns SMA return to negative number

    When I add the VIX instrument to my indicator with Add ("VX 05-19", PeriodType.Tick, 100); Which is the same tick value as the primary instrument YM
    , the value from my YX average = SMA(rawDuration, fbPeriod); suddenly goes from a valid number to a negative number like -8975 after compiled successfully.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Hyper, Today, 09:45 AM
0 responses
1 view
0 likes
Last Post Hyper
by Hyper
 
Started by ATMtrader0001, Today, 05:05 AM
1 response
13 views
0 likes
Last Post NinjaTrader_Kate  
Started by Florozmer, Today, 09:32 AM
0 responses
7 views
0 likes
Last Post Florozmer  
Started by EnveousColnago, Today, 08:31 AM
1 response
5 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by odeifuor, Today, 09:05 AM
0 responses
1 view
0 likes
Last Post odeifuor  
Working...
X