[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] AFL - AlertIf



PureBytes Links

Trading Reference Links




This 
makes an audio alert and sends text to the alert window when price crosses the 
various trend lines (studies). The code is placed at the top of the built in 
price indicator....
<SPAN 
class=964060218-24042003> 
<FONT 
color=#0000ff size=2> 
Study(<FONT color=#ff00ff 
size=2>"s1",<FONT color=#ff00ff 
size=2>1);<FONT color=#0000ff 
size=2>
Study(<FONT color=#ff00ff 
size=2>"s2",<FONT color=#ff00ff 
size=2>1);<FONT color=#0000ff 
size=2>
Study(<FONT color=#ff00ff 
size=2>"s3",<FONT color=#ff00ff 
size=2>1);
 
Buy=Cross<FONT 
size=2>(C, <FONT 
size=2>Study("s1"<FONT 
size=2>,1<FONT 
color=#0000ff>));<FONT 
color=#0000ff>
Sell=<FONT 
size=2>Cross(Study<FONT 
size=2>("s1",<FONT 
size=2>1), C<FONT 
color=#282828 size=2>);
Buy1=Cross(<FONT 
size=2>C, Study<FONT 
size=2>("s2",<FONT 
size=2>1<FONT 
color=#0000ff>));
Buy2=Cross(<FONT 
size=2>C, Study<FONT 
size=2>("s3",<FONT 
size=2>1<FONT 
color=#0000ff>));
Sell1=Cross(<FONT 
size=2>Study("s2"<FONT 
size=2>,1), <FONT 
size=2>C<FONT 
color=#0000ff>);
Sell2=Cross(<FONT 
size=2>Study("s3"<FONT 
size=2>,1), <FONT 
size=2>C<FONT 
color=#0000ff>);
 
sound= "SOUND g:\\DOWNLOADS\\Amibroker\\strategy 
alert.wav"<FONT 
color=#0000ff>;
sound2= "SOUND 
c:\\windows\\media\ding.wav"<FONT 
color=#0000ff>;
 
AlertIf(<FONT color=#000000 
size=2>Buy, sound2, <FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>C,<FONT 
color=#ff00ff size=2>3.2)+ <FONT 
color=#ff00ff size=2>" Violation", 
1<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>+2<FONT color=#282828 
size=2>+4<FONT color=#282828 
size=2>+8<FONT color=#282828 
size=2>,1 
);
AlertIf(Buy1, sound2, <FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>C,<FONT 
color=#ff00ff size=2>3.2)+ <FONT 
color=#ff00ff size=2>" s2 Violation", 
1<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>+2<FONT color=#282828 
size=2>+4<FONT color=#282828 
size=2>+8<FONT color=#282828 
size=2>,1 
);
AlertIf(<FONT color=#000000 
size=2>Sell, sound,<FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>C,<FONT 
color=#ff00ff size=2>3.2)+ <FONT 
color=#ff00ff size=2>" Violation", 
2<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>+2<FONT color=#282828 
size=2>+4<FONT color=#282828 
size=2>+8<FONT color=#282828 
size=2>,1 
);
AlertIf(Sell1, sound, <FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>C,<FONT 
color=#ff00ff size=2>3.2)+ <FONT 
color=#ff00ff size=2>" s2 Violation", 
2<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>+2<FONT color=#282828 
size=2>+4<FONT color=#282828 
size=2>+8<FONT color=#282828 
size=2>,1 
);
AlertIf(Buy2, sound2, <FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>C,<FONT 
color=#ff00ff size=2>3.2)+ <FONT 
color=#ff00ff size=2>" s3 Violation", 
1<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>+2<FONT color=#282828 
size=2>+4<FONT color=#282828 
size=2>+8<FONT color=#282828 
size=2>,1 
);
AlertIf(Sell2, sound, <FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>C,<FONT 
color=#ff00ff size=2>3.2)+ <FONT 
color=#ff00ff size=2>" s3 Violation", 
2<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>+2<FONT color=#282828 
size=2>+4<FONT color=#282828 
size=2>+8<FONT color=#282828 
size=2>,1 
);
 
 Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: Adrian Zaremba 
[mailto:headcutter@xxxxxxxx]Sent: Thursday, April 24, 2003 1:48 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] AFL - 
AlertIfIs there anyone that is using AlertIf function? 
It doesnt seem to work. If you can post ANY code that is working and using 
AlertIf or transform this code so it will work that would be terrific. The 
help files didint help me at all.Thanks.Buy = Cross( Close, MA( 
Close, 10 ) );Sell = Cross( MA( Close, 10 ), Close );Short = Cross( MA( 
Close, 10 ), Close );Cover = Cross( Close, MA( Close, 10 ) );AlertIf( 
Buy,"","Buy alert",1,1+2 );AlertIf( Sell,"","Sell alert",2,1+2 
);AlertIf( Short,"","Short alert",3,1+2 );AlertIf( Cover,"","Cover 
alert",4,1+2 );Send 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.