//+------------------------------------------------------------------+ //| Copyright © 2012, Vladimir Hlystov | //| http://cmillion.narod.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2012, Vladimir Hlystov" #property link "http://cmillion.narod.ru" #property indicator_chart_window extern int PERIOD=PERIOD_H1; //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ int deinit() { ObjectsDeleteAll(0,OBJ_TRIANGLE); Comment(""); return(0); } //+------------------------------------------------------------------+ int start() { if(Period()>=PERIOD) {Comment("Смените ТФ или измените PERIOD");return;} int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit--; if(limit*Period()0; i--) { if(Min>Low[i]) {Min=Low[i];TimeMin=Time[i];} if(MaxClose[i],Red,Lime)); DrawTRIANGLE(StringConcatenate(PERIOD,"1",Time[i]),TimeMin,Min,TimeMax,Max,Time[i],Close[i],Color(OpenC>Close[i],Red,Lime)); } TimeMin=Time[i];TimeMax=Time[i]; Min=Low[i];Max=High[i]; OpenC=Open[i];Max=High[i]; n=iBarShift(NULL,PERIOD,Time[i-1],false); } } return(0); } //-------------------------------------------------------------------- void DrawTRIANGLE(string Name,datetime T1,double P1,datetime T2,double P2,datetime T3,double P3,color C) { ObjectDelete(Name); ObjectCreate(Name,OBJ_TRIANGLE,0,T1,P1,T2,P2,T3,P3); ObjectSet(Name,OBJPROP_COLOR,C); ObjectSet(Name,OBJPROP_BACK,true); } //-------------------------------------------------------------------- color Color(bool P,color a,color b) { if(P) return(a); else return(b); } //------------------------------------------------------------------