Has someone tried the example EA "tradingexpert.mq4" in the Tutorial?

 

Hi,

I am new by MQL4. These days I read the tutorial from "https://book.mql4.com/samples/expert". On this side at the end there is an EA called "tradingexpert.mq4". But as I try this in MT4 for automated trading, I doesn't work. The EA seems can not be started.

Maybe has someone experience?

Many thanks

Thomas

Simple Expert Advisor - Simple Programs in MQL4 - MQL4 Tutorial
Simple Expert Advisor - Simple Programs in MQL4 - MQL4 Tutorial
  • book.mql4.com
Simple Expert Advisor - Simple Programs in MQL4 - MQL4 Tutorial
 
Have you opened/pasted the code in the editor and compiled it? Mq4 files indicates the source code and the compiler creates the executable ex4 file...
 

Hi,


yes the mistake is on line 60

there is an > correct is < 


correct is on line 60 

for(int i=1; i<=OrdersTotal(); i++)


....


//--------------------------------------------------------------- 4 --

   // Orders accounting

   Symb=Symbol();                               // Security name

   Total=0;                                     // Amount of orders

   for(int i=1; i<=OrdersTotal(); i++)          // Loop through orders

 
Cologne: yes the mistake is on line 60
  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
              Messages Editor

  2. We have no idea what line is 60. Post all the relevant code and indicate.There are no mind readers here and our crystal balls are cracked.

  3. for(int i=1; i<=OrdersTotal(); i++)
    If there are n orders, their positions are [0 … n-1] not [1 … n]
Reason: