Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Simple SMA of a custom indicator not working
Collapse
X
-
Simple SMA of a custom indicator not working
Hi, I am trying to take a SMA of a custom indicator while creating a second cusom indicator. I am using the following statement in ninja script sma_compare = SMA(Zcustom(),Length), where Zcustom is a custom indicator. But it is not working. Please help.
Tags: None
-
2 Photos
Comment
-
Hello stratfreak,
I'm not certain I'm fully understanding.
You have shown an error in the log that would completely this script from running.
However you are stating the log does not show anything.
The script is called test, and the fatal error occurred with test.
Is this a new blank test script that just prints the value of Zcustom() with no other code?
May I confirm this script does not call AddDataSeries() anywhere in the code?
If you make a second test script and once again only print the value of Zcustom() is the new test script also affected?
Does Zcustom() call AddDataSeries()?Chelsea B.NinjaTrader Customer Service
Comment
-
Yes, I am adding two statements with add data series in zcustom() . Zcustom word was just used as an example. The actual name is test.
Comment
-
Hello stratfreak,
Do you see the error in the log about AddDataSeries()?
'test' tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state.
This a fatal error that will prevent the script from running.
Have you followed the directions in the error?
From the help guide:
"Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments"
Is the host scripts adding the same data series?Chelsea B.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment