In the future, please use the CODE button (Alt-S) when inserting code.
If you reference the documentation for the OrderSend() function, what does it state about the return datatype and possible values?
bool OrderSend( MqlTradeRequest& request, // query structure MqlTradeResult& result // structure of the answer );Return Value
In case of a successful basic check of structures (index checking) returns true. However, this is not a sign of successful execution of a trade operation. For a more detailed description of the function execution result, analyze the fields of result structure.
Does it state that the return value is an enumeration of which TRADE_RETCODE_DONE is a possible value?
No, it states that the return value is a bool (boolean, true or false).
Second problem ...
Why are you trying to obtain OHLC data, and trade data, and trying to execute trades in what is supposed to be the initialisation event handler — OnInit()?
You should only be initialising the EA and nothing else. Your code should be in the OnTick() event handler.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Could somebody please help me?
i am trying to get the below code to compile in mql5 and keep receiving 2 errors for expression is always false for line number 44 and 66 (I have highlighted below)