inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: FastAvg( 0 ), SlowAvg( 0 ) ;
FastAvg = XAverage( Price, FastLength ) ;
SlowAvg = XAverage( Price, SlowLength ) ;
If CurrentBar > 1 then begin
if FastAvg crosses over SlowAvg then
Buy ( "XMA2CrossLE" ) next bar at market ;
if FastAvg crosses under SlowAvg then
Sell ( "XMA2CrossSE" ) next bar at market ;
end;