#property copyright "Volatily Scalp"
#property link      "VolatilyScalp.Blogspot.Com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 OrangeRed
#property indicator_color2 Lime
#property indicator_color3 Yellow
#property indicator_level1 0

extern string Curency1 = "EURUSD";
extern string Curency2 = "USDCHF";
double BUFFER1[],BUFFER2[],BUFFER3[];
int init()
{
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,BUFFER1);
    SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,BUFFER2);
      SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexBuffer(2,BUFFER3);
   return(0);
}

void start()
{

   int counted_bars=IndicatorCounted();


   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
   for(int i=0; i<limit; i++)
   {
      BUFFER1[i]=NormalizeDouble((iClose(Curency1,0,i)-iMA(Curency1,0,20,0,0,PRICE_MEDIAN,i)),Digits)/NormalizeDouble(iATR(Curency1,0,20,i),Digits);
      BUFFER2[i]=NormalizeDouble((iClose(Curency2,0,i)-iMA(Curency2,0,20,0,0,PRICE_MEDIAN,i)),Digits)/NormalizeDouble(iATR(Curency2,0,20,i),Digits);
      BUFFER3[i]=MathAbs(MathAbs(BUFFER1[i])-MathAbs(BUFFER2[i]));
   }
}


