Australian (ASX) Stock Market Forum

Reply to thread

[code]period = 20; // number of averaging periods

m = MA( Close, period ); // simple moving average

Buy = Cross( Close, m ); // buy when close crosses ABOVE moving average

Sell = Cross( m, Close ); // sell when closes crosses BELOW moving average


Buy = Ref( Buy, -0 );

Sell = Ref( Sell, -0 );


BuyPrice = SellPrice = Close;


if( Status( "action" ) == actionExplore )

{

    Filter = Buy OR Sell;

    AddColumn( IIf( Buy, BuyPrice, Null ), "Buy", 1.3, colorBlue );

    AddColumn( IIf( Sell, SellPrice, Null ), "Sell", 1.3, colorDarkRed );

}[/code]


Top