Boynton Beach, FL
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 24 since Jul 2011
Thanks Given: 0
Thanks Received: 3
|
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;
}
|