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

To add comments, please log in or register
thomas2004
372
thomas2004  

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
Carl Schreiber
Moderator
8856
Carl Schreiber  
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...
Cologne
5
Cologne  

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

William Roeder
20228
William Roeder  
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]
To add comments, please log in or register