-
double price = (InpType==ORDER_TYPE_BUY)?
Invalid constant. Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL4 Reference
-
if(!OrderSelect(i, SELECT_BY_POS)) break; if(OrderSymbol()!=Symbol() && OrderMagicNumber()!=MagicNumber) continue; if((OrderCloseTime() == 0) && OrderMagicNumber()==MagicNumber)
Drop the second IF. You will never find a closed order (OCT!=0) in the loop.
-
if(OrderType() == OP_BUY||OrderType() == OP_SELL) cnt = 1; if(!(OrderType() == OP_BUY||OrderType() == OP_SELL)) cnt = 1; }
The function will always return one.
- JSJTradeworx: it just does not do what I want.
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This EA must Open 1 Market Order upon Initialization, and the fill a grid with Pending Orders. SO now, upon Initiation, it opens multiple Market orders, and no Pendings. I get no error when I compile but it just does not do what I want. I am new to coding, if someone can just point to my mistake, I can find fix.
Thanks