How to capture multiple conditions in a single condition? - futures io
futures io



How to capture multiple conditions in a single condition?


Discussion in NinjaTrader

Updated
    1. trending_up 1,118 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

How to capture multiple conditions in a single condition?

(login for full post details)
  #1 (permalink)
 RonKiker 
Birmingham, AL
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES, YM, NQ
 
Posts: 34 since Apr 2012
Thanks: 17 given, 23 received

I have 4 conditions that I monitor via indicators on my chart. If any 3 of the 4 conditions are true, I enter the trade. What I'd like to do is develop an indi that monitors these 4 conditions and then signals when any 3 of the 4 are true. It could be any 3 of the 4, and it may not necessarily be the same 3 each time, nor in the same order each time.

I think what I need to do is program a bool variable into each condition. I can handle that. Where I am having trouble is how do I monitor these 4 conditions for a "true" variable and then signal when any 3 of the 4 are true?

Does anyone have any suggestions on how I would program this logic?

Thanks,
Ron

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Is there inherently more opportunity in smaller markets?
Traders Hideout
Experience with AGN (Introducing Broker)
Brokers
TD Sequential for NT or MW?
Platforms and Indicators
TradingView help in improving Anchored Vwap
Platforms and Indicators
1 min chart v-shape scan help please
ThinkOrSwim
 
 
(login for full post details)
  #3 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
 
Posts: 525 since Nov 2011
Thanks: 387 given, 465 received


You can code it like that:

 
Code
int Count = 0;
bool C1, C2, C3, C4;

// *** set conditions C1..C4 ***
// ...

// *** Check Results ***
if (C1)
    Count++;
if (C2)
    Count++;
if (C3)
    Count++;
if (C4)
    Count++;

if (Count >= 3)
{
    // *** Enter Trade ***
}

Reply With Quote
The following user says Thank You to Koepisch for this post:
 
(login for full post details)
  #4 (permalink)
 RonKiker 
Birmingham, AL
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES, YM, NQ
 
Posts: 34 since Apr 2012
Thanks: 17 given, 23 received


Koepisch View Post
You can code it like that:

 
Code
int Count = 0;
bool C1, C2, C3, C4;

// *** set conditions C1..C4 ***
// ...

// *** Check Results ***
if (C1)
    Count++;
if (C2)
    Count++;
if (C3)
    Count++;
if (C4)
    Count++;

if (Count >= 3)
{
    // *** Enter Trade ***
}

Thanks, Koepisch!

That is just the mental kick in the pants that I needed.

Ron

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > How to capture multiple conditions in a single condition?


Last Updated on August 12, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts