//+------------------------------------------------------------------+ //| GANN_HILO.mq5 | //| Copyright 2012, . | //| m100shiri@yahoo.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2012," #property link "m100shiri@yahoo.com" #property version "1.00" #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_type1 DRAW_LINE #property indicator_style1 STYLE_SOLID #property indicator_width1 1 #property indicator_color1 Blue input int Lb=10; double ssl[],Hld,Hlv,ssl_ima_h[],ssl_ima_l[]; int ssl_handle; int ssl_handle_h,ssl_handle_l; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,ssl,INDICATOR_DATA); ssl_handle_h=iMA(NULL,0,Lb,0,MODE_SMA,PRICE_HIGH); ssl_handle_l=iMA(NULL,0,Lb,0,MODE_SMA,PRICE_LOW); PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0); //--- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- int ssl_handle_h_copied=CopyBuffer(ssl_handle_h,0,0,rates_total,ssl_ima_h); int ssl_handle_l_copied=CopyBuffer(ssl_handle_l,0,0,rates_total,ssl_ima_l); for(int i=0; issl_ima_h[i+1]) Hld=1; else { if(close[i]