I have updated the EA a bit. Have tested it using constants that were MACD.

The optimum in a backtest of this year 2008 was discovered with the following principles:MACD fast MA interval: 8 MACD slow MA interval: 14 MACD signal interval: 2 Here's the altered code for those who want to try it for themselfs:

Inserted Code // ------------------------------------------------------------------ //| EA #1 | //| ===== | //| Date: 03.08.2008 | //| Author: AdamP | // ------------------------------------------------------------------ #define MAGICNUMBER 01082008 extern double Lots = 1.0; extern double TakeProfit = 200; extern double StopLoss = 50; extern int FastMA = 8; extern int SlowMA = 14; extern int Signal = 2; extern int RSIperiod = 14; // ------------------------------------------------------------------ //| Count open positions | // ------------------------------------------------------------------ int CalculateCurrentOrders() int buys=0,sells=0; // Go through all orders for(int I=0;ilt;OrdersTotal();I ) // We're only interested in trades that are in the trading pool // Closed or canceled orders Aren't interesting for us if(OrderSelect(I,SELECT_BY_POS,MODE_TRADES)==false ) break; // Count positions that were opened by us for the current currency if(OrderSymbol()==Symbol() OrderMagicNumber()==MAGICNUMBER) if(OrderType()==OP_BUY) buys ; if(OrderType()==OP_SELL) sells ; // Return open positions if(buysgt;0) return(buys); else return(-sells); // ------------------------------------------------------------------ //| Calculate optimal lot size | // ------------------------------------------------------------------ double LotsOptimized() return(Lots); // ------------------------------------------------------------------ //| Check for bullish market conditions | // ------------------------------------------------------------------ bool isBullishMarket() // Calculate current and previous MACD and and current signal line double SignalCurrent=iMACD(NULL,PERIOD_D1,FastMA,SlowMA,S ignal,PRICE_CLOSE,MODE_SIGNAL,0); double MacdCurrent=iMACD(NULL,PERIOD_D1,FastMA,SlowMA,Sig nal,PRICE_CLOSE,MODE_MAIN,0); double MacdPrevious=iMACD(NULL,PERIOD_D1,FastMA,SlowMA,Si gnal,PRICE_CLOSE,MODE_MAIN,1); double RsiCurrent = iRSI(Symbol(),PERIOD_W1,RSIperiod,PRICE_CLOSE,1); return ((RsiCurrent gt; 50.0) (MacdPrevious lt; MacdCurrent) (MacdCurrent gt; SignalCurrent)); // ------------------------------------------------------------------ //| Check for bearish market conditions | // ------------------------------------------------------------------ bool isBearishMarket() // Calculate current and previous MACD and and current signal line double SignalCurrent=iMACD(NULL,PERIOD_D1,FastMA,SlowMA,S ignal,PRICE_CLOSE,MODE_SIGNAL,0); double MacdCurrent=iMACD(NULL,PERIOD_D1,FastMA,SlowMA,Sig nal,PRICE_CLOSE,MODE_MAIN,0); double MacdPrevious=iMACD(NULL,PERIOD_D1,FastMA,SlowMA,Si gnal,PRICE_CLOSE,MODE_MAIN,1); double RsiCurrent = iRSI(Symbol(),PERIOD_W1,RSIperiod,PRICE_CLOSE,1); return ((RsiCurrent lt; 50.0) (MacdPrevious gt; MacdCurrent) (MacdCurrent lt; SignalCurrent)); // ------------------------------------------------------------------ //| Check for open order conditions | // ------------------------------------------------------------------ void CheckForOpen() double TP, SL; // Only trade on beginning of a new bar if (Volume#91;0#93; gt; 1) return; // Check for buy condition if (isBullishMarket()) OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,As k-StopLoss*Point,Ask TakeProfit*Point,,MAGICNUMBER,0,Green); // Check for sell condition if (isBearishMarket()) OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,B id StopLoss*Point,Bid-TakeProfit*Point,,MAGICNUMBER,0,Red); // ------------------------------------------------------------------ //| Start function | // ------------------------------------------------------------------ void start() IsTradeAllowed()==false) return; // If we have no open position check for opening one if(CalculateCurrentOrders()==0) CheckForOpen(); I have changed the following variables:TakeProfit: 200 StopLoss: 50 Lot size: 5.0 The result is nice: From 1st of january until now, the initial deposit of $10.000 would be nearly $100.000 (see attached image )

Perhaps I need to add: should I do a backtest with the very same values from january 2007 till now, then that EA could have halfed my bank account (discontinued out at 50 percent )

Having a lot size of 3.0 it would have been nearly $90.000 although...