//+---------------------------------------------+ //| DojiAlarm.mq4 | //| Copyright © 2008, Limstylz | //+---------------------------------------------+ #property copyright "Copyright © 2008, Limstylz" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Yellow #property indicator_width1 5 double Arrow[]; int init() { SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 242); SetIndexBuffer(0, Arrow); return(0); } int deinit() { ObjectsDeleteAll(0, OBJ_TEXT); return(0); } int start() { double Height, AvgHeight; static datetime hist = 0; int Counter,Current_Bar,Last_Bar,alert = 0; double Doji_Open,Doji_Close; string timeframe; if(hist == Time[0]) { return(0); } hist = Time[0]; switch(Period()) { case 1: timeframe = "M1"; break; case 5: timeframe = "M5"; break; case 15: timeframe = "M15"; break; case 30: timeframe = "M30"; break; case 60: timeframe = "H1"; break; case 240: timeframe = "H4"; break; case 1440: timeframe = "D1"; break; case 10080: timeframe = "W1"; break; case 43200: timeframe = "MN"; break; } for(Current_Bar = 0; Current_Bar < Bars; Current_Bar++) { Counter = Current_Bar; Height = 0; AvgHeight = 0; for(Counter = Current_Bar; Counter <= Current_Bar + 9; Counter++) { AvgHeight = AvgHeight + MathAbs(High[Counter] - Low[Counter]); } Height = AvgHeight / 10; Last_Bar = Last_Bar + 1; Doji_Open = Open[Last_Bar]; Doji_Close = Close[Last_Bar]; if(Doji_Close == Doji_Open) { Arrow[Last_Bar] = High[Last_Bar] + Height*1; //PlaySound ("alert.wav"); } } return(0); } //----End