//+------------------------------------------------------------------+ //| _BZ_Skyline.mq4 | //| Skyline, 2008 | //| http://www.forexpertutti.it | //+------------------------------------------------------------------+ #property copyright "Skyline,2008" #property link "www.forexpertutti.it" //---- #property indicator_chart_window #property indicator_buffers 7 #property indicator_color1 White #property indicator_color2 RoyalBlue #property indicator_color3 Red #property indicator_color4 LimeGreen #property indicator_color5 LimeGreen #property indicator_color6 SlateBlue #property indicator_color7 SlateBlue //---- #property indicator_style1 2 #property indicator_style2 2 #property indicator_style3 2 #property indicator_style4 2 #property indicator_style5 2 #property indicator_style6 2 #property indicator_style7 2 //---- extern double myEntryTrigger =4; extern double myProfitTarget =10; extern double myStopLoss =7; extern int Shift =0; extern color myHourColor =DarkGray; extern int myStyle =STYLE_DOT; extern bool ShowLables =false ; //---- double OpenLine[]; double BuyLine1[]; double BuyLine2[]; double SellLine1[]; double SellLine2[]; double TargetLine1[]; double TargetLine2[]; double StopLossLine1[]; double StopLossLine2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,OpenLine); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,BuyLine1); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,SellLine1); SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,TargetLine1); SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,TargetLine2); SetIndexStyle(5,DRAW_LINE); SetIndexBuffer(5,StopLossLine1); SetIndexStyle(6,DRAW_LINE); SetIndexBuffer(6,StopLossLine2); //---- SetIndexShift(0,Shift); SetIndexShift(1,Shift); SetIndexShift(2,Shift); SetIndexShift(3,Shift); SetIndexShift(4,Shift); SetIndexShift(5,Shift); SetIndexShift(6,Shift); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- for( int i=ObjectsTotal() - 1; i>=0; i--) { string name=ObjectName( i ); if(StringFind( name, "HourStart")>= 0) ObjectDelete( name ); if(StringFind( name, "Hour")>= 0) ObjectDelete( name ); if(StringFind( name,"OpenText")>= 0) ObjectDelete( name ); if(StringFind( name, "SellEntry")>= 0) ObjectDelete( name ); if(StringFind( name, "BuyEntry" )>= 0) ObjectDelete( name ); if(StringFind( name, "ProfitTarget1")>= 0) ObjectDelete( name ); if(StringFind( name, "ProfitTarget2")>= 0) ObjectDelete( name ); } //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int limit; //---- if(TimeHour(Time[0])!= TimeHour(Time[1])) { double level= (High[1] + Low[1] + Close[1])/3; SetTimeLine("HourStart", "Hour", 0, White, level+10*Point); // draw the vertical bars that marks the time span } //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; //---- limit=Bars-counted_bars; for(int i=0; i