NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-09-2009, 01:10 PM   #1
skikg
Member
 
Join Date: Jul 2009
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default Statements if/true/false

How do I write if statements in Ninja that = true else false? Also after I write a number of true false conditions how do I compile them into one statement?

Ex: if Condition one = true and condition two = true and condition three = true then plot.....

If you have a good example and I can see the code this would greatly be appreciated.
skikg is offline  
Reply With Quote
Old 12-09-2009, 01:37 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Code:
if (condition1 && condition2 && condition3)
{
    // do something;
}
else
{
    // do something else;
}
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-09-2009, 01:45 PM   #3
skikg
Member
 
Join Date: Jul 2009
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Josh,

Found it under Control statements, The learning continues....
skikg 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strategy.CalculateOnBarClose=true vs. Indicator.CalculateOnBarClose=false karimatka Strategy Development 7 05-23-2011 03:39 AM
Live Print statements jerimac2 Automated Trading 2 09-29-2009 10:42 AM
IF Statements bologc NinjaScript File Sharing Discussion 3 09-03-2009 08:48 AM
Simulation, true or false? RVRoman General Programming 1 09-02-2008 02:34 AM
statements ignored Burga1 General Programming 8 06-30-2008 10:36 PM


All times are GMT -6. The time now is 12:00 AM.