NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 03-24-2007, 05:17 PM   #1
Freddie
 
Join Date: Feb 2007
Location: , ,
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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
Attached Images
File Type: jpg ScalpProblem.JPG (104.2 KB, 12 views)
Freddie is offline  
Reply With Quote
Old 03-24-2007, 05:19 PM   #2
Freddie
 
Join Date: Feb 2007
Location: , ,
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Sorry here's a better screen capture without the message caught in the middle.
Attached Images
File Type: jpg ScalpProblem.JPG (97.9 KB, 14 views)
Freddie is offline  
Reply With Quote
Old 03-24-2007, 06:24 PM   #3
Forex Ninja
Junior Member
 
Join Date: Feb 2007
Location: , ,
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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.
Attached Files
File Type: txt Correction.txt (218 Bytes, 16 views)
Forex Ninja is offline  
Reply With Quote
Old 03-25-2007, 04:03 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

Thanks for helping out Forex Ninja.
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-25-2007, 06:05 AM   #5
Forex Ninja
Junior Member
 
Join Date: Feb 2007
Location: , ,
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

No prob.
Forex Ninja is offline  
Reply With Quote
Old 03-25-2007, 09:51 AM   #6
Freddie
 
Join Date: Feb 2007
Location: , ,
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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.
Freddie is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:36 AM.