//+------------------------------------------------------------------+ //| SL_ATR.mq4 | //| Copyright © 2011, Vladimir Hlystov | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, Vladimir Hlystov" #property link "cmillion@narod.ru" #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 Blue #property indicator_color4 Red //+------------------------------------------------------------------+ extern int Period_ATR =14;//ïåðèîä ÀÒR //+------------------------------------------------------------------+ double SLSellMin[],SLBayMin[],SLSellMax[],SLBayMax[]; //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_LINE); SetIndexStyle(3,DRAW_LINE); //---- indicator buffers mapping SetIndexBuffer(0,SLSellMin); SetIndexBuffer(1,SLBayMin); SetIndexBuffer(2,SLSellMax); SetIndexBuffer(3,SLBayMax); //---- name for DataWindow and indicator subwindow label SetIndexLabel(0,"SL Sell Min"); SetIndexLabel(1,"SL Bay Min"); SetIndexLabel(2,"SL Sell Max"); SetIndexLabel(3,"SL Bay Max"); //---- initialization done return(0); } //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ int start() { int counted_bars = IndicatorCounted(); if(counted_bars > 0) counted_bars--; int limit = Bars-counted_bars; double ATR; for(int i=0; i