NexusFi: Find Your Edge


Home Menu

 





OR operator rather than AND in condition builder


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one toddma with 3 posts (0 thanks)
    2. looks_two NinjaTrader with 1 posts (0 thanks)
    3. looks_3 albertjay with 1 posts (0 thanks)
    4. looks_4 sam028 with 1 posts (1 thanks)
    1. trending_up 3,399 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

OR operator rather than AND in condition builder

  #1 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

Another basic question question -

Does anyone know if there is a way in the condition builder to have condition1 or condition2 or condition3 = true? rather than all conditions must be true?

Or is this something that can only be done in code?
If its only in code - what would that look like? instead of "&&" - something else?

Thanks in advance -

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

|| for OR
&& for AND

I don't use the Strategy Wizard, but I don't think it's possible to do what you want without coding.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,714 since May 2010
Thanks Given: 203
Thanks Received: 2,686



toddma View Post
Another basic question question -

Does anyone know if there is a way in the condition builder to have condition1 or condition2 or condition3 = true? rather than all conditions must be true?

Or is this something that can only be done in code?
If its only in code - what would that look like? instead of "&&" - something else?

Thanks in advance -

Each condition set (set 1, set 2, set 3 etc...) is "or" while the conditions within each set are "and".

Follow me on Twitter Reply With Quote
  #4 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

but if you wanted to have:

if "A" is true
&
if ("B" or "C" is true)

Then enter long - how would you do that using different sets?

Sorry -
I can see that you could set them up as
two separate sets - but the problem is when you need the "OR" statement to be 10 or more items (as an example)

Started this thread Reply With Quote
  #5 (permalink)
 albertjay 
Los Angeles CA
 
Experience: Advanced
Platform: NT
Trading: ES
Posts: 12 since Aug 2015
Thanks Given: 3
Thanks Received: 5

This is a very late reply, but it may help someone reading this:

Toddma, yes, you can do that. Here's an example:

if(Condition....

&& (this > that || they < us))

{
Do something
}

The above is a simple way of doing what you want. The || in the parenthesis is the OR statement.

Reply With Quote




Last Updated on May 26, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts