Amibroker: is it possible to personalize condition per each ticker ?

Discussion in 'Programming' started by stighy, Mar 8, 2013.

  1. stighy


    is it possible to 'personalize' a formula per each ticker ? In AFL, i would like to test 'different' buy condition for different ticker. For example:

    Ticker AAPL, Rule A

    Ticker MSFT, Rule B

    Then, run AFL test each 5 minutes.

    Concrete example:


    Buy = Cross( MACD(), Signal() );

    Alertif(..."MAIL", "Buy Apple beacuase Macd Cross");

    ticker='MSFT' Buy = Close>EMA(Close,100);

    Alertif(..."MAIL", "Buy Apple beacuase Macd Cross");


    Is it possible ?
  2. apfx


    symbol = Name();
    switch ( symbol )
    case "AAPL":
    Buy = Cross ( Signal(), MACD());
    AlertIf(Buy, "", "macd cross");
    break ;

    Buy = Cross ( C, EMA ( 15, C));
    AlertIf(Buy, "", "ema cross");
    break ;