- Willem Huisman: normally you write:No you don't. Doubles are rarely equal. Understand the links in:
if(statement == tp1)TP_Exist = true;
The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum - Willem Huisman: It is a long line of code to check if there is an Takeprofit on a trade. Will it also work with this?non-zero is true. Therefor tp1||tp2||tp3||tp4 is true||true||true||true which is true. True is one. Therefor you are testing statement == 1.000000
if(statement == (tp1 || tp2 || tp3 || tp4)TP_Exist = true;
whroeder1:
- No you don't. Doubles are rarely equal. Understand the links in:
The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum - non-zero is true is one. Therefor you are testing TP = 1.000000
Basicly the idea was to manage the trades. I use the TP function of a trade to determine where they belong. For example when close signal is given, all trades with Symbol, type, must be selected to close. Cant do it with magic number since they are changing from categorie

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
simple question:
normally you write:
It is a long line of code to check if there is an Takeprofit on a trade. Will it also work with this?
To compare 1 statement if, with OR, OR,OR,OR in smallest code as possible