/*============================================================= Info: Godbot EA // Timeframe M5 EURUSD Name: Godbot.mq4 Author: Erich Pribitzer Version: 1.2.1 Update: 2011-03-28 Notes: while(true) changed to while (binx #include #include // Godbot EA timeframe M5 extern string GB_SETTINGS = "==== GODBOT EA V1.2/M5 SETTINGS ===="; // extern int GB_TRADE_TF = PERIOD_M5; extern int GB_BANDS_PERIOD = 23; extern int GB_BANDS_DEVIA = 2; extern int GB_BANDS_SHIFT = 0; extern int GB_MA = 178; extern int GB_BANDS_TF = PERIOD_M30; extern int GB_DEMA_PERIOD = 56; extern int GB_DEMA_TF = PERIOD_D1; // extern bool GB_TIMEFILTER = true; int GB_oldBar = 0; double GB_dema[]; int init() { Print("Init GodBot V1.2"); BA_Init(); OL_Init(OL_ALLOW_ORDER,OL_RISK_PERC,OL_RISK_PIPS,OL_PROFIT_PIPS,OL_TRAILING_STOP,OL_LOT_SIZE,OL_INITIAL_LOT,OL_CUSTOM_TICKVALUE,OL_SLIP_PAGE,OL_STOPSBYMODIFY,OL_MAX_LOT,OL_MAX_ORDERS,OL_MAGIC,OL_ORDER_DUPCHECK,OL_OPPOSITE_CLOSE, OL_ORDER_COLOR, OL_MYSQL_LOG); ArrayResize(GB_dema,BA_INIT_BARS); return(0); } int deinit() { OL_Deinit(); return(0); } int start() { OL_ReadBuffer(); //---- if(GB_oldBar!=iBars(NULL,GB_TRADE_TF)) { GB_oldBar=iBars(NULL,GB_TRADE_TF); if(GB_oldBar bandHi); bool sellClose=(close > bandLow && open < bandLow); bool buy =(close > bandLow && open < bandLow && GB_dema[0] > GB_dema[1] && GB_dema[1] > GB_dema[2] && ma2 < ma1); bool sell = (close < bandHi && open > bandHi && GB_dema[0] < GB_dema[1] && GB_dema[1] < GB_dema[2] && ma2 > ma1); OL_SyncBuffer(); // close sell int binx=0; if(sellClose ) { while (binx= 0; i--) { lastEMA =weight*iClose(symbol, timeframe,i) + (1.0-weight)*lastEMA; lastEMA_of_EMA =weight*lastEMA + (1.0-weight)*lastEMA_of_EMA; buffer[i]=(2.0*lastEMA - lastEMA_of_EMA); } }