new version of mql4

 

I am confused about new version of mql4.

Can anyone send me some sample indicators (like moving average etc.)? So I will learn by myself.

Thank You.

Sorry for my poor English.

 
metbright:

I am confused about new version of mql4.

Can anyone send me some sample indicators (like moving average etc.)? So I will learn by myself.

Thank You.

Sorry for my poor English.


Most of the "old" mql4 code still works . . . you will find examples here: https://www.mql5.com/en/code
 

I am really confused new function .

like these

void OnStart();
void OnInit();
void OnDeinit(const int reason);
void OnTick();
void OnTimer();
double OnTester();
void OnChartEvent(const int id,         // Event ID
                  const long& lparam,   // Parameter of type long event
                  const double& dparam, // Parameter of type double event
                  const string& sparam  // Parameter of type string events
  );
int OnCalculate (const int rates_total,      // size of input time series
                 const int prev_calculated,  // bars handled in previous call
                 const datetime& time[],     // Time
                 const double& open[],       // Open
                 const double& high[],       // High
                 const double& low[],        // Low
                 const double& close[],      // Close
                 const long& tick_volume[],  // Tick Volume
                 const long& volume[],       // Real Volume
                 const int& spread[]         // Spread
   );
 


In the old version I can use these

int init();
int deinit();
int start();

but now I can't.

 
Have a read of "Changes in MQL4 Language" in the first post here - https://www.mql5.com/en/forum/148851
 

metbright:

In the old version I can use these

int init();

int deinit();

int start();

but now I can't.


Yes you can. Delete all the OnCalculate() stuff and write,

int start()
{

// you can write code like before, there are some small changes 
// the compiler will notify you about them if neccessary
// or learn about the new mql4 functions its not difficult
// and there are some useful new features to use

return(0);
}
 
Thank you so much to every one, I'll will try.
 

So i will ask one more question?

What are the difference between "extern" and "input" ?

 

does pretty much the same thing except input variables are constant(value of the variable cannot be changed in the code) and input has more options, you can make drop down lists, use friendly descriptions that appear in the properties dialoge ..

 
SDC:

does pretty much the same thing except input variables are constant(value of the variable cannot be changed in the code) and input has more options, you can make drop down lists, use friendly descriptions that appear in the properties dialoge ..


I understood, thank you very much.


One more question haha.

I can't use debugger in MetaEditor the icon is gray out.

Reason: