Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Level II Strategy
Collapse
X
-
Level II Strategy
Hi Professionals, I am having difficulty compiling the attached strategy to execute an entry order when level 2 volume for bid is twice as ask (for current price). Can anyone please help?Tags: None
-
Hello shahabjet1,
Are you getting an error message?
if so, we focus on the error message. What is the full error message and on what line? (You can provide a screenshot if you would like)
Taking a peak at the code, I have some confusion myself. The class type is strategy but there is indicator generated code at the bottom that can't exist for a strategy. If you are using the NinjaScript Editor to create scripts I wouldn't think this script would even be possible to make.Chelsea B.NinjaTrader Customer Service
-
Comment
-
Hello shahabjet1,
Thank you for providing the screenshot of the error messages.
This is confirming that a strategy cannot have generated code for indicators. This script has generated code at the bottom that shouldn't exist.
Is this actually a strategy and not an indicator?
Was this strategy created as a new strategy in the NinjaScript Editor?
Was this strategy created outside of NinjaTrader in a text editor?
Have you copied invalid code from an indicator into this strategy?
I recommend that you start again and make a new blank strategy in the NinjaScript Editor.
Then only copy the logic from OnBarUpdate() to the new blank strategy.Chelsea B.NinjaTrader Customer Service
Comment
-
Hi, I fixed it all and it was working; then I decided to add SMA indicator and now I am getting a minor error, I might be doing something tiny wrong, can you please check to see what's causing SMA indicator to give error please? Attached.Attached Files
Comment
-
Comment
-
The code is also in my above message if needed... must be a simple error something obvious that I am doing wrong
Comment
-
Yes all is fixed. Like I mentioned the code was working and only when I added using SMA check its giving me that error
Comment
-
Hello shahabjet1,
I would not be expecting this error for a newly generated strategy. The using statements of a newly generated strategy should be correct in a new script and that error should not occur.
Are you 100% that you have generated a new strategy as I directed?
Can this be reproduced again when generating yet a another new strategy that has no code copied into it?Chelsea B.NinjaTrader Customer Service
Comment
-
-
Hello shahabjet1,
I think that it's the using statements but i'm not sure.
We will know for sure if we schedule call if you create a new script, do not copy and paste any code, and just add private SMA SMA1; to it. If that new script is also effected, I will need to schedule a call with you so that I can investigate on your end. There might be missing files or something if new scripts are affected.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
43 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
47 views
0 likes
|
Last Post
|

Comment