Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
EXPORT issue
Collapse
X
-
Hello TazoTodua,
Thank you for your note.
Without the full code we're unable to test on our end.
If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.
Please also include the log and trace files.
I look forward to your reply.Alan P.NinjaTrader Customer Service
-
AlanP, here is a simple test, you can reproduce and finally see the problem, that frustratest many of us:
just create a new indicator, and in OnBarUpdate, add this line:
double smth = base.TMA(14)[0];
compile, and try to export the script. you will get error.
then, before that line, add this line:
NinjaTrader.NinjaScript.Indicators.TMA x = null;
compile, try to export - YOU WILL GET IT TO WORK (it successfully proceeds, and asks you to include the TMA or not).
BUT if you will do the same steps for LinReg (or EMA or SMA), you will fail. even doing the mentioned "workaround"...
So, actually, there is two problems:
1) NT cant automatically include (during export) the files that are preceded with `base.` keyword. So, please fix that, as all „based" scripts were marked to be included.
2) after that, check some indis, like EMA, LINREG, SMA (and some other I dont tested), why even declaring the Type doesnt help the exporter tool, to resolve them? (like i showed above).
Comment
-
Hello TazoTodua,
In your indicator if you use,
instead of,Code:double smth = TMA(14)[0];
The script compiles and exports with no issue.Code:double smth = base.TMA(14)[0];
Using base before the indicators name is not the supported method of writing an indicator.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Comment
-
1) can you tell me then, why in many indicators, the other indicators are called with `base.`prefix? why the programmers do that in such manner? ( i see bunch of scripts doing that)
2) I talked about SMA/EMA , LINREG problem.
Why cant you tell me two words about them? why declaration of the type doesnt solve the problem for them, while it solves for others?
Comment
-
Hello TazoTodua,
1) For stock scripts this should not be the case, if you do have an example could you provide it for me to review that specific use case? In general using base should only be used when you actually need to reference the base class which in this case you don't. Its possible those other scripts do, we would need a specific example if this is the question at hand or comparing that script versus your use.
2), again using the incorrect keyword can cause problems in NinjaScript as you are not only using standard C# here. The base modifier should only be used when you access the base class. NinjaScript indicators are not setup to require you to use base. so it should not be used in this use case. For more information on base, please see https://docs.microsoft.com/en-us/dot.../keywords/base
If you have some kind of custom inheritance in your script where you do actually need to use base., that would be a situation that we would likely suggest to avoid as custom inheritance is not something we can support.
I look forward to your reply.Alan P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment