Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Syntax Problems
Collapse
This topic is closed.
X
X
-
Yes, only after you unlock the code can you make any manual edits. If this was coming from a strategy built by the Wizard you likely have something corrupted in your NinjaTrader and would need a fresh reinstall.
1. Backup all of your files: NinjaScript, workspaces, etc.
2. Uninstall NT
3. Delete My Documents\NinjaTrader 6.5 (YOU WILL LOSE EVERYTHING)
4. Clear internet browser cache
5. Reinstall NT
6. What is corrupt is likely one of your NinjaScripts so do not reintroduce those until you can establish a base line working scenario with what you are trying to do. Slowly reintroduce your NinjaScripts afterwards till you find one that is breaking it. If you do not find any, that is great.Josh P.NinjaTrader Customer Service
Comment
-
Since last post, I believe I have corrected all errors except one new one:
"Your strategy likely holds one or more recursive properties which could cause Ninja Trader to crash: BufferLong BufferShort. Do you want to edit these properties?"
Can you tell me how to correct?
Also, what is the best way to send you my code? It seems to be too long for sending through the forum. Should I send an email with an attachment or what way would you suggest?
Stan Katz
[email protected]
Comment
-
When you post under the main body part there is a section called "Additional Options". There is a button called "Manage Attachments" from there.
Your code most likely is due to an error in your Properties region in terms of capitalization of your variables. Please ensure you adhere to the capitalization requirements.
The "private int fast = 20;" in the Variables region of your code needs to be lower cased too.Code:[Description("Period for fast MA")] [Category("Parameters")] public int [B][COLOR=Red]F[/COLOR][/B]ast { get { return [COLOR=Red][B]f[/B][/COLOR]ast; } set { [COLOR=Red][B]f[/B][/COLOR]ast = Math.Max(1, value); } }Josh P.NinjaTrader Customer Service
Comment
-
Thanks, Josh, hope this works: LinRegCrossovers Strategy attached.
Stan Katz
[email protected]Attached Files
Comment
-
skat100,
You still have not fixed the problem we discussed earlier. Close is a reserved word. You cannot use it as an input parameter.
Please address the BufferLong and BufferShort as I discussed in my earlier post too. You need to be mindful of capitalization. The public variable is capitalized and the private one needs to be lower case.Josh P.NinjaTrader Customer Service
Comment
-
These lines:
if (Position.MarketPosition == MarketPosition.Short
&& BarsSinceEntry() >= BSE
&& Position.GetProfitLoss(Close[0], (PerformanceUnit.Currency) < BSEp)) ;
You cannot use ; right after an if-statement. There are several occurrences of this. Please go through and fix that too.Josh P.NinjaTrader Customer Service
Comment
-
Syntax Errors
Thanks, Josh. I fixed those wrong ; I'm surprised the compiler did not catch them?.
Did you see the error message about the properties (paramters) listings being considered to be duplicates of the variables declarations? Should I delete either the properties listing or the variables listing? I did not make these duplications; perhaps they were made by the Wizard?
Comment
-
Stan,
I already responded to your email you sent in to support. Please keep all communication about this case on the forums here. It makes it extremely difficult to offer you quality support when we have to track your responses across different mediums. Thank you.
Your code is in a very jumbled mess right now. Whenever you make a change or get a new error I will need to see the latest rendition of your code or else I cannot advise you on what to do.Josh P.NinjaTrader Customer Service
Comment
-
Syntax Errors
Sorry about all this, Josh. Attached is latest code. I hope it's in better shape than when you last looked at it.Attached Files
Comment
-
Condition set 4 and 6 still have the ; issue I mentioned earlier for the if-statements.
You changed your Properties region improperly. Please take a note of which ones are capitalized and which ones are not in my prior post. You are also still using Close. You cannot use this word to create a parameter. It is reserved.
Please open up SampleMACrossOver and take a look at how they create parameters. You need to maintain the exact structure. Everything needs to be done exactly the way you see it there. Open up the Variables region and the Properties region. Be extremely mindful of which is public and which is private as well as with which are capitalized and which are not.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment