Working with bools - futures io
futures io futures trading



Working with bools


Discussion in NinjaTrader

Updated
    1. trending_up 1,088 views
    2. thumb_up 0 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
 

Working with bools

(login for full post details)
  #1 (permalink)
Boynton Beach, FL
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
 
Posts: 24 since Jul 2011
Thanks: 0 given, 3 received

I know that there is probably an easy way to do this, but I just can't figure it out.

Is there a way to use one true bool to make another bool true and the first one false? This is not working, bool2 does not become true, and bool1 remains true. The point is that bool2 needs to be true the second time condition1 is true, but I don't know how to make this code count. Any help would be appreciated, Thanks... Example:

protected override void OnBarUpdate(){

if (condition1) // uparrow and short
bool1 = true; // this works

if (bool1 && condition1) // bool1 true, uparrow and short
bool1 = false; // this does not work
bool2 = true; // this does not work

if(condition2)
bool1 = false;
bool2 = false;
}

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
MACD line not plotting after change of plot order
NinjaTrader
Reading A set of Trading Signals
EasyLanguage Programming
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
Second Entry Indicator (Looking for testers/feedback)
NinjaTrader
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
 
 
(login for full post details)
  #3 (permalink)
Germany / Italy
 
Experience: Advanced
Platform: a few...
Trading: all that move nicely, extend your horizons
 
Posts: 68 since Nov 2009
Thanks: 46 given, 32 received



kbaran View Post
I know that there is probably an easy way to do this, but I just can't figure it out.

Is there a way to use one true bool to make another bool true and the first one false? This is not working, bool2 does not become true, and bool1 remains true. The point is that bool2 needs to be true the second time condition1 is true, but I don't know how to make this code count. Any help would be appreciated, Thanks... Example:

protected override void OnBarUpdate(){

if (condition1) // uparrow and short
bool1 = true; // this works

if (bool1 && condition1) // bool1 true, uparrow and short
bool1 = false; // this does not work
bool2 = true; // this does not work

if(condition2)
bool1 = false;
bool2 = false;
}

how about working with a BoolSeries so you can check via an index if the bool1 is true now and your # of bars back?

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Boynton Beach, FL
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
 
Posts: 24 since Jul 2011
Thanks: 0 given, 3 received

wavey

Thanks for the reply, but I tried a bool series and I could not get that to work. I also tried counting with an int and that hasn't worked. Still trying to figure a way.

Update, I found a way using bar index.

Thanks

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Working with bools


Last Updated on August 28, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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