//+------------------------------------------------------------------+
//| SSL.mq4 |
//| ssl fast Kalenzo |
//| bartlomiej.gorski@gmail.com |
//+------------------------------------------------------------------+
//mod2008forextsdml
#property copyright "Kalenzo"
#property link "bartlomiej.gorski@gmail.com"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 CornflowerBlue
#property indicator_style1 STYLE_DOT
extern int Lb = 10;
double ssl[];
double Hlv[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(2);
SetIndexBuffer(0,ssl); SetIndexDrawBegin(0,Lb+1);
SetIndexBuffer(1,Hlv);
return(0);
}
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,limit;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//
//
//
//
//
for(i=limit;i>=0;i--)
{
Hlv[i] = Hlv[i+1];
if(Close[i]>iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1)) Hlv[i] = 1;
if(Close[i]<iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1)) Hlv[i] = -1;
if(Hlv[i] == -1)
ssl[i] = iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
else ssl[i] = iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1);
}
return(0);
}
Comments