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 fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment