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 sam028 with 1 posts (1 thanks)
    3. looks_3 NinjaTrader with 1 posts (0 thanks)
    4. looks_4 albertjay with 1 posts (0 thanks)
    1. trending_up 3,919 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #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?
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
South Korea Suspends Bithumb for Six Months Over AML Fai …
Cryptocurrency
One Wallet Made $200K in Hours: AP Probes Polymarket Cea …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632

|| 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 X 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,715 since May 2010
Thanks Given: 203
Thanks Received: 2,688



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 X 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


© 2026 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 - Downloads - Top
no new posts