//+-------------------------------------------------------------------+ //| TB-SL HiLo Arrows-v1.3 | //| krelian99@web.de | //| | //| This indicator is not for general and usual trading use, it | //| was coded by krelian99 a senior active member of TSD forum for a | //| specefic purpose of trailing stop,The arrow is sppoted at every | //| bar that is higher than its previous and next bar in down trend, | //| same at the bar that is lower than its previous and next bar in | //| up trend,so logically arrow appears after completion of one next | //| bar , it count difference even 1 pip. | //| | //| original idea by mntiwana | //+-------------------------------------------------------------------+ #property copyright "Krelian99 at TSD" #property link "krelian99@web.de" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 DeepSkyBlue int limit; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; string PatternText[2000]; //+------------------------------------------------------------------+ //| CuStom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW,EMPTY , 1, Red); SetIndexArrow(0,234); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_ARROW,EMPTY , 1, DeepSkyBlue); SetIndexArrow(1,233); SetIndexBuffer(1,ExtMapBuffer2); //---- return(0); } //+------------------------------------------------------------------+ //| CuStor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| CuStom indicator iteration function | //+------------------------------------------------------------------+ int start() { int N; int N1; int N2; int N3; //int N4; string text; int counted_bars=IndicatorCounted(); limit=Bars-counted_bars; for(N = 1; N < limit; N++) { PatternText[N] = CharToStr(N); N1 = N; N2 = N + 1; N3 = N + 2; //---- //---- check for possible errors if(counted_bars<0) { Alert("NO Bars.."); return(-1); } double gap = 2.0*iATR(NULL,0,20,N)/5.0; // Check for a Bearish pattern if ((High[N3]Low[N2] && Low[N1]>Low[N2])||(Low[N3]==Low[N2] && Low[N1]>Low[N2])||(Low[N3]>Low[N2] && Low[N1]==Low[N2])) { ExtMapBuffer2[N2]=Low[N2]-gap; } //---- } // End of for loop return(0); } //+------------------------------------------------------------------+