MT5 compile error

 

I'm trying to compile a program written by someone else, and I'm getting an error. I'm showing in the code section the part of the code that's giving me a problem, a section that's designed to execute a buy.

The line that's giving me a problem, per the compiler, is:


MqlTradeRequest req= {0};


And the error being reported is:

cannot convert 0 to enum 'ENUM_TRADE_REQUEST_ACTIONS' MultipleOrdersEA MT5 Rev 1.4.mq5 517 29


Here's the relevant code (I tried using the Code control but I'm apparently not understanding how that works, because the code appears but the rest of the message disappears):


***

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
  • www.mql5.com
Trade Operation Types - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019.05.06)
              Messages Editor

  2. MqlTradeRequest req/*= {0}*/;

    The code below that, initializes the structure.

 
Robert Raleigh:


Please insert the code correctly: when editing a message, press the button  Codeand paste your code into the pop-up window.

Reason: