//+------------------------------------------------------------------+ //| iK_trend_v01.mq4 | //| Ivan Katsko | //| ICQ:372739628 | //+------------------------------------------------------------------+ #property copyright "Ivan Katsko" #property link "ICQ:372739628" //---- indicator settings #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 Red #property indicator_color2 DarkViolet #property indicator_color3 Blue #property indicator_color4 Green #property indicator_width1 2 #property indicator_width2 2 #property indicator_width3 2 #property indicator_width4 2 //---- indicator parameters extern int PeriodMA=3; extern int History=100; extern int VerExtr=4; extern int Flat=4; extern int TimeFrame=0; //extern bool Draw=true; //---- indicator buffers double up, upp, min, minmin; double BuySell; double SL[]; double TP[]; double Trend[]; double Trade[]; double Delta[]; double DeltaMA[]; bool New_Bar=false; static datetime New_Time; //+------------------------------------------------------------------+ int init() { New_Time=Time[0]; min=MarketInfo(Symbol(),MODE_SPREAD)*Point; //---- IndicatorBuffers(6); //---- SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexStyle(3,DRAW_LINE); SetIndexDrawBegin(0,VerExtr); IndicatorDigits(Digits+5); //---- SetIndexBuffer(0,SL); SetIndexBuffer(1,TP); SetIndexBuffer(2,Trend); SetIndexBuffer(3,Trade); SetIndexBuffer(4,Delta); SetIndexBuffer(5,DeltaMA); //---- if(TimeFrame==0)TimeFrame=Period(); IndicatorShortName("iK_trend_6("+PeriodMA+","/*+History+","*/+VerExtr+","+TimeFrame+")"); //---- return(0); } //+------------------------------------------------------------------+ int start() { //Alert("На start min=",min/Point); int limit; int counted_bars=IndicatorCounted(); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; // limit=History; //---- Разница двух МА-шек for(int i=0; i