// PriceAction // Author: sae076[a]gmail.com #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 LawnGreen #property indicator_color2 Red double CrossUp[]; double CrossDown[]; string SignalText; int init() { SetIndexStyle(0, DRAW_ARROW, 3); SetIndexArrow(0, 233); SetIndexBuffer(0, CrossUp); SetIndexStyle(1, DRAW_ARROW, 3); SetIndexArrow(1, 234); SetIndexBuffer(1, CrossDown); return (0); } int deinit() { ObjectsDeleteAll(0, OBJ_TEXT); return(0); return (0); } int start() { int counted_bars=IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars > 0) counted_bars--; int limit = Bars - counted_bars; for (int i=limit; i>=0; i--) { double L1 = Low[i+1]; double L = Low[i]; double H1 = High[i+1]; double H = High[i]; double O1 = Open[i+1]; double O = Open[i]; double C1 = Close[i+1]; double C = Close[i]; double O2 = Open[i+2]; double C2 = Close[i+2]; double H2 = High[i+2]; if( MathAbs(Low[i+1] - Low[i])/Point < 3 && Close[i+1] < Close[i] && High[i+1] < Close[i] ) //DBLHC up { CrossUp[i]=Low[i]-15*Point; ObjectCreate("PA_dblhc_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], Low[i] - 50*Point); ObjectSetText("PA_dblhc_"+Symbol()+TimeToStr(Time[i]), "DBLHC up", 8, "Alial", Green); } if( MathAbs(High[i+1] - High[i])/Point < 3 && Close[i+1] > Close[i] && Low[i+1] > Close[i] ) //DBHLC dn { CrossDown[i]=High[i]+15*Point; ObjectCreate("PA_dbhlc_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], High[i] + 50*Point); ObjectSetText("PA_dbhlc_"+Symbol()+TimeToStr(Time[i]), "DBHLC dn", 8, "Alial", Red); } if( MathAbs(L1-L)/Point < 3 && MathAbs(O1-C1) > MathAbs(O-C) && MathAbs(H1-L1) > 1.2*MathAbs(H-L) && H < (H1-L1)/2+L1 ) //TBL { CrossDown[i]=High[i]+15*Point; CrossUp[i]=Low[i]-15*Point; ObjectCreate("PA_tbl_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], Low[i] - 75*Point); ObjectSetText("PA_tbl_"+Symbol()+TimeToStr(Time[i]), "TBL up|dn", 8, "Alial", White); } if( MathAbs(H1-H)/Point < 3 && MathAbs(O1-C1) > MathAbs(O-C) && MathAbs(H1-L1) > 1.2*MathAbs(H-L) && L > (H1-L1)/2+L1 ) //TBH { CrossDown[i]=High[i]+15*Point; CrossUp[i]=Low[i]-15*Point; ObjectCreate("PA_tbh_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], High[i] + 75*Point); ObjectSetText("PA_tbh_"+Symbol()+TimeToStr(Time[i]), "TBH up|dn", 8, "Alial", White); } if( MathAbs(L1-L)/Point < 3 && O1-C1>0 && O-C<0 && MathAbs(H1-H)/Point < 3) // rail_up { CrossUp[i]=Low[i]-15*Point; ObjectCreate("PA_railup_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], Low[i] - 50*Point); ObjectSetText("PA_railup_"+Symbol()+TimeToStr(Time[i]), "RAIL up", 8, "Alial", Green); } if( MathAbs(C1-O)/Point<10 && MathAbs(C-O)/Point<10 && O+(H-O)/2 > H1 && (H-L) > (H1-L1)*1.5 ) { CrossDown[i]=High[i]+15*Point; ObjectCreate("PA_pindn_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], High[i] + 50*Point); ObjectSetText("PA_pindn_"+Symbol()+TimeToStr(Time[i]), "PIN dn", 8, "Alial", Red); } if( MathAbs(C1-O)/Point<10 && MathAbs(C-O)/Point<10 && O-(O-L)/2 < L1 && (H-L) > (H1-L1)*1.5 ) // pin up { CrossUp[i]=Low[i]-15*Point; ObjectCreate("PA_pinup_"+Symbol()+TimeToStr(Time[i]), OBJ_TEXT, 0, Time[i], Low[i] - 50*Point); ObjectSetText("PA_pinup_"+Symbol()+TimeToStr(Time[i]), "PIN up", 8, "Alial", Green); } } return (0); }