Alert if in amibroker

murthyavr

Well-Known Member
#2
You can use two types of alerts - either price-based or formula-based alerts.

Price based alerts will be scrip specific. Formula based ones will apply to all the scrips in your watchlist of AB.

The syntax is as under:


//Code starts here
Buy = Cross(C,445.00) AND Name()=="FEDERALBNK";
AlertIf(Buy,"","Crossed 445.00",1);

Buy = Cross(MA(10),MA(20));
AlertIf(Buy,"","MA Crossover",1);

Sell = Cross(MA(20),MA(10));
AlertIf(Sell,"","MA Crossover",2);
///////////////////////////End of Code

Copy and paste it in a new afl file.

And run automatic analysis.

You should keep the Alert Output window in AB open to see the alerts.

( I am also a newbie to Amibroker and its coding. I am just sharing to the extent I know..)
 

Similar threads