//+------------------------------------------------------------------+ //| fakeyib.mq4 | //| daniel g | //| | //+------------------------------------------------------------------+ #property copyright "DanielGadot" #property link "" #property indicator_chart_window #property indicator_color1 Green #property indicator_color2 Red #property indicator_buffers 2 int inPosition = 0; double entryBuyStop,entrySellStop,buyTp,sellTp; bool IB = false; double up[],down[]; double range = 0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,up); SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1); SetIndexArrow(0,217); SetIndexLabel(0,NULL); SetIndexBuffer(1,down); SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1); SetIndexArrow(1,218); SetIndexLabel(1,NULL); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { /* if (IB == true){ if (MarketInfo(Symbol() ,Bid > entryBuyStop) || MarketInfo(Symbol(), Ask) < entrySellStop) { inPosition++; } if (inPosition > 0){ if (MarketInfo(Symbol() ,Bid > buyTp) || MarketInfo(Symbol(), Ask) < sellTp){ IB = false; inPosition = 0; } } }*/ int counted_bars = IndicatorCounted(); if (counted_bars < 0) return (-1); if (counted_bars > 0) counted_bars--; // last counted bar will be recalculatedī for( int i = Bars - counted_bars; i >= 0; i--) { if(High[i]Low[i+1]){ // IB = true; //range = High[i] - Low[i]; //entryBuyStop = High[i]; //entrySellStop = Low[i]; //buyTp = entryBuyStop + range; //sellTp = entrySellStop - range; up[i] = Low[i] - iATR(Symbol(),0,500,i)/3; } } return(0); } //+------------------------------------------------------------------+