![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Feb 2007
Location: , ,
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
I've started programming and I cannot understand why my "If, else if" portion is not working. I've attached a screen capture showing my program and the errors on the bottom. Can anyone give me some guidance? It's telling me that it does not recognize else in "else if" even though it colors it blue on the screen.
thx in advance, Fred |
|
|
|
|
|
#2 |
|
Join Date: Feb 2007
Location: , ,
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
Sorry here's a better screen capture without the message caught in the middle.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2007
Location: , ,
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Freddie,
When you're using a branching command like if/else, you have to make sure to place braces in the right places. Also, you should use == instead of = when writing the conditions for the 'if' portion of the command. And keep in mind that two ampersands && are used for the logical 'AND.' Hopefully the attached document will help to clear things up. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Thanks for helping out Forex Ninja.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2007
Location: , ,
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
No prob.
|
|
|
|
|
|
#6 |
|
Join Date: Feb 2007
Location: , ,
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
Thx Forex Ninja. I'll give it a try. Not that familiar with the programming language so it will take a bit of time to get famaliar with it.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|