You may use the "Switch" operator, or just test the value of myOrderType :
isPendingOrder=false;
if(myOrderType >= 2) isPendingOrder=true;
or:
isPendingOrder=(myOrderType >= 2) ;
isPendingOrder=false;
if(myOrderType >= 2) isPendingOrder=true;
or:
isPendingOrder=(myOrderType >= 2) ;
You may use the "Switch" operator, or just test the value of myOrderType :
isPendingOrder=false;
if(myOrderType >= 2) isPendingOrder=true;
or:
isPendingOrder=(myOrderType >= 2) ;
isPendingOrder=false;
if(myOrderType >= 2) isPendingOrder=true;
or:
isPendingOrder=(myOrderType >= 2) ;
I've had other needs for something like this so I thought I'd ask. As for the pendingOrder=true, good solution, I just get paranoid about them coming out with a new order type someday and code breaking.
Thanks so much for taking the time!
-Christian
if(myOrderType==OP_BUYLIMIT || myOrderType==OP_BUYSTOP || myOrderType==OP_SELLLIMIT || myOrderType==OP_SELLSTOP);
I use same condition for mine but without semicolon for if() statement.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I really feel I must be missing something. I want to test if an integer is one of several values. Here is what I'm doing now:
I'm looking for something like we would have in a dBase type language like
Can't seem to find anything better than a whole bunch of ||'s. Curious if it is there. Anyone care to educate me?
Thanks!!
-Christian