//+------------------------------------------------------------------+ //| AutoFibo.mq4 | //| Hajime Tsuro | //| http://sefx.net | //+------------------------------------------------------------------+ #property copyright "Hajime Tsuro (emija)" #property link "emija_fx(by Twitter)" #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectDelete("Fibo"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ extern int lookback = 35; extern int lastbar = 0; extern color FibColor= LightSeaGreen; int start() { ObjectDelete("Fibo"); int countedBars=IndicatorCounted(); //---- double low; double high; double lowest=1000; double highest=0; datetime lowestBarTime; datetime highestBarTime; for(int i=lookback+lastbar;i>lastbar+1;i--) { low = iLow(Symbol(),Period(),i); high = iHigh(Symbol(),Period(),i); if(low < lowest) { lowest = low; lowestBarTime = iTime(Symbol(),Period(),i); } if(high > highest) { highest = high; highestBarTime = iTime(Symbol(),Period(),i); } } Comment(highest, lowest); if(lowestBarTime