//+------------------------------------------------------------------------------+
//| Àâòîð : Ñåðãåé - ìîé ñàéò - "http://wsforex.ru/" |
//+------------------------------------------------------------------------------+
// Ïèøó òîðãîâûå ñèñòåìû |
//+------------------------------------------------------------------------------+
//| Àâòîð : Ñåðãåé - ìîé ñàéò - "http://wsforex.ru/" |
//+------------------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Orange
extern int FletBars=20;
extern int period=3;
double MaStd[];
double std[];
//+------------------------------------------------------------------------------+
//| Àâòîð : Ñåðãåé - ìîé ñàéò - "http://wsforex.ru/" |
//+------------------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,MaStd);
SetIndexBuffer(1,std);
IndicatorShortName("_Flet: "+"FletBars "+FletBars+": "+"MA "+period+": ");
//----
return(0);
}
//+------------------------------------------------------------------------------+
//| Àâòîð : Ñåðãåé - ìîé ñàéò - "http://wsforex.ru/" |
//+------------------------------------------------------------------------------+
int start(){
//----
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(int k=limit-1;k>=0;k--){
std[k]=iStdDev(Symbol(),0,FletBars,0,0,PRICE_CLOSE,k);
}
//----
for(int i=limit-1; i>=0; i--){
MaStd[i]=iMAOnArray(std, 0, period, 0, MODE_SMMA, i);
}
return(0);
}
//+------------------------------------------------------------------------------+
//| Àâòîð : Ñåðãåé - ìîé ñàéò - "http://wsforex.ru/" |
//+------------------------------------------------------------------------------+
Comments