Download MetaTrader 5
To add comments, please log in or register
They are already making profit using the Market. You can join them!
rjngh2005
26
rjngh2005 2016.03.31 01:32 

I have downloaded the MT4 software from FXCM USA

 

However when I start metaeditor  and i open the sample it says words like onInit and onTick

These are mt5  language code words

when I enter the following code from the book  as follows

 

//--------------------------------------------------------------------
// create.mq4
// To be used as an example in MQL4 book.
//--------------------------------------------------------------------
int Count=0;                                    // Global variable
//--------------------------------------------------------------------
int init()                                      // Spec. funct. init()
   {
   Alert ("Funct. init() triggered at start");  // Alert
   return;                                      // Exit init()
   }
//--------------------------------------------------------------------
int start()                                     // Spec. funct. start()
   {
   double Price = Bid;                          // Local variable
   Count++;                                     // Ticks counter
   Alert("New tick ",Count,"   Price = ",Price);// Alert
   return;                                      // Exit start()
   }
//--------------------------------------------------------------------
int deinit()                                    // Spec. funct. deinit()
   {
   Alert ("Funct. deinit() triggered at exit"); // Alert
   return;                                      // Exit deinit()
   } 

//--------------------------------------------------------------------

This code does not work when I compile it...

I have to modify all return statements to return(0);

 

Please advise how to change or modify the behaviour of the metaeditor so that it behaves like MT4 and not MT5

Keith Watford
Moderator
7870
Keith Watford 2016.03.31 02:27  

You can't change it. A lot of mql5 was absorbed into mql4 some time ago. However, the old functions still work as before.

If your posted code came from the book, then it has the errors that you have spotted. Fault the book, not mql4.

rjngh2005
26
rjngh2005 2016.03.31 17:22  

well...thanks for the reply...

I like the statement...'You can't change it'


Thanks...I shall modify my code accordingly...

Not a problem...I am used to this type of stuff...I have been coding 8 different languages since 1984  however I have started working on mt4 just recently.

whroeder1
13593
whroeder1 2016.04.01 00:25  

rjngh2005:

However when I start metaeditor  and i open the sample it says words like onInit and onTick

These are mt5  language code words

Not since February 3, 2014 (Build 600) Two years ago; RTFM.
Upcoming MetaTrader 4 and MQL4 Upgrades - Big Changes Are Underway - MQL4 forum
/
To add comments, please log in or register