Working with bools - futures io
futures io



Working with bools


Discussion in NinjaTrader

Updated
    1. trending_up 1,127 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)
 kbaran 
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?
For the experts of Metastock
Platforms and Indicators
TradingView help in improving Anchored Vwap
Platforms and Indicators
1 min chart v-shape scan help please
ThinkOrSwim
Losing faith
Elite Quantitative Trading
MacdBB V402 NT804 + gradient + pullback not working on N …
NinjaTrader
 
 
(login for full post details)
  #3 (permalink)
 wavey 
Germany / Italy
 
Experience: Advanced
Platform: a few...
Trading: Index Futures
 
Posts: 69 since Nov 2009
Thanks: 47 given, 33 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)
 kbaran 
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

Your Charts Should Speak To You w/Bob Cometta

Elite only
 

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