// More information about this indicator can be found at: // http://fxcodebase.com/code/viewtopic.php?f=28&t=61988 //+------------------------------------------------------------------+ //| Copyright © 2018, Gehtsoft USA LLC | //| http://fxcodebase.com | //+------------------------------------------------------------------+ //| Developed by : Mario Jemic | //| mario.jemic@gmail.com | //+------------------------------------------------------------------+ //| Support our efforts by donating | //| Paypal : https://goo.gl/9Rj74e | //+------------------------------------------------------------------+ //| Patreon : https://goo.gl/GdXWeN | //| BitCoin : 15VCJTLaz12Amr7adHSBtL9v8XomURo9RF | //| BitCoin Cash : 1BEtS465S3Su438Kc58h2sqvVvHK9Mijtg | //| Ethereum : 0x8C110cD61538fb6d7A2B47858F0c0AaBd663068D | //| LiteCoin : LLU8PSY2vsq7B9kRELLZQcKf5nJQrdeqwD | //+------------------------------------------------------------------+ #property copyright "Copyright � 2018, Gehtsoft USA LLC" #property link "http://fxcodebase.com" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Gray #property indicator_color2 Green #property indicator_color3 Red double Up[], Dn[], Ne[]; int UpFr, DnFr; int init() { IndicatorShortName("Fractal bar indicator"); IndicatorDigits(Digits); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(0,Ne); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexBuffer(1,Up); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexBuffer(2,Dn); UpFr=0; DnFr=0; return(0); } int deinit() { return(0); } int start() { if(Bars<=3) return(0); int ExtCountedBars=IndicatorCounted(); if (ExtCountedBars<0) return(-1); int limit=Bars-2; if(ExtCountedBars>2) limit=Bars-ExtCountedBars-1; int pos; pos=limit; while(pos>=0) { if (High[pos+2]>High[pos+4] && High[pos+2]>High[pos+3] && High[pos+2]>High[pos+1] && High[pos+2]>High[pos]) { UpFr=pos+2; } if (Low[pos+2]0 && DnFr>0) { if (Close[pos]>High[UpFr]) { Up[pos]=1.; } if (Close[pos]