Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 ghoul, Today, 06:02 PM
|
1 response
10 views
0 likes
|
Last Post Today, 06:27 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
44 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
180 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM |
Comment