In my opinion, CrapQuotes has created a total mess with v60x, as it is the stepping stone to MQL5, but with (some) backward compatibility to MQL4.
For instance, for indicators we had in MQL4
Code: Select all
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
//----
return(0);
}
In Empty4-Build 60x that is now replaced by:
Code: Select all
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
However, the old format is still supported in Empty4-60x. That means that 95% of the Empty4 developers will continue to use the old format and will have to convert later -- because one thing is for certain, one day CrapQuotes will turn around and declare that the old way is no longer supported (eg. in v70x).
The next step, no doubt, will be is to get away from the internal indicator functions (such as: iMA(...)) and replace them with the IndicatorCreate(), to create a handle and to use CopyBuf() when you want to use the values, like this is now done in MQL5.
In this total mess, I find it hard to create "future-proof" code, as the MQL language/compiler is undergoing rapid changes. That means that us, coders, are too busy changing code, that we have no more time to actually make money. Thoughts?