/*[[ Name := EA50-50 Author := Copyright (c) 2005, iExpertAdvisor, LLC Link := http://www.iExpertAdvisor.com Notes := BUY or SELL on Moving Average crossover ]]*/ define: OrderFlag(0), Xbars(4); vars: FastMa0(0), FastMa1(0), SlowMa0(0), SlowMa1(0), SetBuyOrder(0), SetSellOrder(0), status(0); FastMa0=iMA(8,MODE_EMA,0); FastMa1=iMA(8,MODE_EMA,1); SlowMa0=iMA(13,MODE_EMA,0); SlowMa1=iMA(13,MODE_EMA,1); If (TotalTrades > 0) then { If( xBars > 0 ) then { status = UserFunction( "fnBarExit", 4 ); } Exit; }; // Test if Fast MA (8) has crosses above the Slow MA (13) If( (FastMa1SlowMa0) )then { If( OrderFlag == 0 ) then { SetBuyOrder=1; SetSellOrder=0; } else { SetSellOrder=1; SetBuyOrder=0; } }; // Test if Fast MA (8) has crosses below the Slow MA (13) If( (FastMa1>SlowMa1) and (FastMa0