I have a simple expert to manage orders (like move to break-even) with a simple GUI. I would like to extend the basic code with a plugin infrastructure where I will add the functionality of some indicators (like spread monitor, time of day etc). Indicators that don't use buffers but write text on screen and then I could make small gui option panels to modify parameters on the fly. Standard indicator OnCalculate code:
Code: Select all
//+------------------------------------------------------------------+
//| 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[]){
int counted_bars=IndicatorCounted();
int limit;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=MathMin(Bars-1,Bars-counted_bars);
for (int i=limit; i>=0; i--)
{
//Do work
}
return(rates_total);
}
Thank you in advance