Insearchfor: t "Some operator is missing".
OrderClose(NULL,NULL,Bid,NULL,CLR_NONE) Print ("*Bollinger 1986 Close Buy Order");
- Obviously something is missing there.
-
Don't use NULL, invalid symbol, invalid size, invalid slippage.
- You can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, MarketInfo does not. OrderSend does not.
- Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
- Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
- MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].
-
Check your return codes for errors, and report them including GLE/LE.
Don't look at it unless you have an error.
Don't just silence the compiler, it is trying to help you.
Don't post code that still has warnings.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
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
Hey guys,
Sorry to bump in here, I'm trying to set up my first robot, woohoo. So far i succeeded in defining inputs for the indicators which do display! Orders are being opened as well but I'm a bit struggling with defining code to close them. At this moment I would just like to close the trades when a buy trade is moving below the middle bollinger and sell trade is moving above. When I set this as below I see that "Some operator is missing".
The full code is below.
Do you have any idea what I'm doing wrong? :(
Full code is below