, the value from my YX average = SMA(rawDuration, fbPeriod); suddenly goes from a valid number to a negative number like -8975 after compiled successfully.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Adding an instrument in a indicator turns SMA return to negative number
Collapse
X
-
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.
Tags: None
-
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.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
475 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
315 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
253 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
340 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
305 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment