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

Discussion in 'App Development' started by stighy, Mar 8, 2013.

  1. stighy

    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:

    ticker='AAPL';

    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");

    Etc.

    Is it possible ?
     
  2. apfx

    apfx

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

    case"MSFT":
    Buy = Cross ( C, EMA ( 15, C));
    AlertIf(Buy, "", "ema cross");
    break ;
    }