-
We have no idea what the direction of your output. Next time use:
#define PRINT(A) PrintFormat("%s=%g",#A, (A))
-
Always post all relevant code. We have no idea what enPositionType is.
-
Terminal version? 1340 works fine for me.
2021.09.14 08:07:48.395 testscr AUDCAD,Daily: ((p==1)&&(t==OP_BUY))=1
2021.09.14 08:07:48.395 testscr AUDCAD,Daily: (t==OP_BUY)=1
2021.09.14 08:07:48.395 testscr AUDCAD,Daily: (p==1)=1
2021.09.14 08:07:48.395 testscr AUDCAD,Daily: (p==0)=0
int p=1, t=OP_BUY; PRINT((p == 0)); PRINT((p == 1)); PRINT((t == OP_BUY)); PRINT(((p == 1) && (t == OP_BUY)));
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Why is not giving true with two true results?
Print((PositionsTotal() == 0));
Print((PositionsTotal() == 1));
Print((enPositionType == POSITION_TYPE_BUY));
Print(((PositionsTotal() == 1) && (enPositionType == POSITION_TYPE_BUY)));
2021.09.14 06:30:43.688 2021.09.01 04:45:00 false
2021.09.14 06:30:43.688 2021.09.01 04:45:00 true
2021.09.14 06:30:43.688 2021.09.01 04:45:00 true