//+------------------------------------------------------------------+ //| SlakerZ.mq4 | //+------------------------------------------------------------------+ #property copyright "" #property link "" #property indicator_chart_window input string __________1__________="xxxxxxxxxxxxxxxxxxxxx"; input string __________2__________="=ARROW CODE=";//ARROW DETAILS input string __________3__________="xxxxxxxxxxxxxxxxxxxxx"; input int ARROWUP =217;//ARROW CODE input int ARROWDN =218;//ARROW CODE input color ARROWUPc=clrWhite;//Arrow Up Color input color ARROWDNc=clrWhite;//Arrow Dn Color //---------------------------------------------------------------------------------------- //--- indicator buffers double ArrUpBuffer[]; double ArrDnBuffer[]; //--- //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping IndicatorBuffers(2); SetIndexBuffer(0,ArrUpBuffer);SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,2,ARROWUPc);SetIndexArrow(0,ARROWUP); SetIndexBuffer(1,ArrDnBuffer);SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,2,ARROWDNc);SetIndexArrow(1,ARROWDN); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ //| 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 i,limit; static datetime LastTime; limit=rates_total-prev_calculated; if(prev_calculated>0)limit=limit+2; for(i=limit-2;i>=0;i--) { if( iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_LOW,i+1) LastTime) { Alert(Symbol(), " ", Period(), "m Lower"); LastTime = Time[0]; } } if( iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,i+1)>iBands(_Symbol,_Period,20,2.0,0,PRICE_CLOSE,MODE_UPPER,i+1)) { ArrDnBuffer[i+1]=iBands(_Symbol,_Period,20,2.0,0,PRICE_CLOSE,MODE_UPPER,i+1)+35*pix_y(); if(i < 2 && Time[0] > LastTime) { Alert(Symbol(), " ", Period(), "m Upper"); LastTime = Time[0]; } } } //--------------- return(rates_total); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double pix_y() { return((ChartGetDouble(0,CHART_PRICE_MAX,0)-ChartGetDouble(0,CHART_PRICE_MIN,0))/ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,0)); } //+------------------------------------------------------------------+