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

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 ?
 
Quote from 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 ?

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 ;
}
 
Back
Top