void OnTick()
{
// current chart, current period, 10,candles, no shift, simple, close price
double SlowMovingAverage = iMA(NULL, 0,10,0, MODE_EMA,PRICE_CLOSE,0);
// current chart, current period, 10,candles, no shift, simple, close price
double LastMovingAverage = iMA(NULL, 0,10,0, MODE_EMA,PRICE_CLOSE,1);
// current chart, current period, 10,candles, no shift, simple, close price
double FastMovingAverage = iMA(NULL, 0,5,0, MODE_EMA,PRICE_CLOSE,0);
// current chart, current period, 10,candles, no shift, simple, close price
double LastFastMovingAverage = iMA(NULL, 0,5,0, MODE_EMA,PRICE_CLOSE,1);
// if the fast EMA is now above
if ((LastMovingAverage < LastFastMovingAverage)
&&(FastMovingAverage > SlowMovingAverage))
// Chart output for but Signal
Comment ("Buy");
if ((LastMovingAverage > LastFastMovingAverage)
&&(FastMovingAverage < SlowMovingAverage))
// if the fast EMA is now below
Comment ("Sell");
// Ask Price
{ Comment("Current Ask price is ", Ask); }
// Bid Price
{ Comment("Current Ask price is ", Bid); }
}