I know how to draw Ma of CCi or RSi on the screen, but how write function witch can be very usefull in almost all ea with CCI,RSi,Laguerre?
I'm trying to do indi, but bad results .
Please look:
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
extern int MA_Period=13;
extern int MA_Shift=0;
extern int MA_Method=0;
extern double gamma=100;
extern int CountBars=950;
//---- buffers
double ExtBuffer0[], ExtBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
SetIndexBuffer(0, ExtBuffer0);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1, ExtBuffer1);
SetIndexDrawBegin(0,gamma);
// SetIndexStyle(1,DRAW_LINE);
// SetIndexBuffer(0,ExtMapBuffer1);
//if(!SetIndexBuffer(0, ExtBuffer0) &&
// !SetIndexBuffer(1, ExtBuffer1)) return(-1);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int cbars=IndicatorCounted(),i;
//----
if(cbars > 0) cbars--;
for(i = Bars - cbars - 1; i >= 0; i--)
{
ExtBuffer1[i] = iCCI(NULL, 0,gamma, PRICE_CLOSE, i);
// Alert("ema =",ExtBuffer0[i]);
ExtBuffer0[i] = iMAOnArray(ExtBuffer1[i], Bars, MA_Period, MA_Shift, MA_Method, i);
//Alert("ema =",ExtBuffer0[i]);
}
//----
return(0);
}



Reply With Quote
please
