dodałem nowy bufor i hula

Kod: Zaznacz cały
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 OrangeRed
//--- input parameters
double SYGPopSw;
double SYG;
double SYGPopSwA[];
double SYGA[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(0,SYGA);
SetIndexBuffer(1,SYGPopSwA);
//---- name for DataWindow and indicator subwindow label
short_name="Proby";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//----
SetIndexDrawBegin(0,300);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, counted_bars=IndicatorCounted();
if(Bars<=300) return(0);
i=Bars-300-1;
if(counted_bars>=300) i=Bars-counted_bars-1;
while(i>=0)
{
if (iMA(NULL,0,100,8,MODE_EMA,PRICE_CLOSE,i)>iMA(NULL,0,200,8,MODE_EMA,PRICE_CLOSE,i))
{
SYGA[i]=1;
}
else if (iMA(NULL,0,100,8,MODE_EMA,PRICE_CLOSE,i)<iMA(NULL,0,800,8,MODE_EMA,PRICE_CLOSE,i))
{
SYGA[i]=-1;
}
else
{
SYGA[i]=SYGA[i+1];
}
SYGPopSwA[i]= SYGA[i+1] ;
i--;
}
return(0);
}
//+------------------------------------------------------------------+