#property version "1.00" #property strict #property indicator_chart_window #property description "This is and indicator to display inside bars as diffrent Colors" #property description "It will also sound an alarm and send a push notification" #property indicator_buffers 2 #property indicator_color1 clrRoyalBlue #property indicator_color2 clrRoyalBlue #property indicator_width1 6 #property indicator_width2 6 double CandleHigh[],CandleLow[]; datetime candletime=0; datetime currenttime=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,CandleHigh); SetIndexBuffer(1,CandleLow); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexStyle(1,DRAW_HISTOGRAM); //--- 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[]) //--- { currenttime=Time[0]; for(int i=MathMax(Bars-2-IndicatorCounted(),1);i>=0;i--) { double hi=high[i],lo=low[i],prevhi=high[i+1],prevlo=low[i+1]; double bodyhi=MathMax(close[i],open[i]); double bodylo=MathMin(close[i],open[i]); double prvbodyhi=MathMax(close[i+1],open[i+1]); double prvbodylo=MathMin(close[i+1],open[i+1]); if(hiprevlo) { CandleHigh[i]=bodyhi; CandleLow[i]=bodylo; CandleHigh[i+1]=prvbodyhi; CandleLow[i+1]=prvbodylo; if(currenttime!=candletime && ) { Alert((string)Period()+"M ",Symbol()," "+"Just made an IndsideBar"); candletime=Time[0]; SendNotification((string)Period()+"M "+Symbol()+" "+"Just made an IndsideBar"); } candletime=Time[0]; } } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+