Filter of Stock for Amibroker (AFL)
duyqpc almost 11 years ago Amibroker (AFL)
Sell = Red
Buy = Blue
Time : Daily
Amiboker : Ver 5.2, Ver 5.3, Ver 5.4, …Ver 5.x
-- From Ha Noi, Viet Nam --
Indicator / Formula
Copy & Paste Friendly
_SECTION_BEGIN("T+4 day ");
Title = " ..:: duy ::.. - Filter of Stock " + " " + FullName() + " " + Date( ) ;
// 4-Day-Range Switch
prev=AMA2(C,1,0);
d=IIf(C>Ref(Max(Max(H,Ref(H,-3)),Max(Ref(H,-1),Ref(H,-2))),-1),Min(Min(L,Ref(L,-3)),Min(Ref(L,-1),Ref(L,-2))),
IIf(C<Ref(Min(Min(L,Ref(L,-3)),Min(Ref(L,-1),Ref(L,-2))),-1),Max(Max(H,Ref(H,-3)),Max(Ref(H,-1),Ref(H,-2))),PREV));
a=Cross(Close,d);
b=Cross(d,Close);
state=IIf(BarsSince(a)<BarsSince(b),1,0);
s=state>Ref(state,-1);
ss=state<Ref(state,-1);
sss=state==Ref(state,-1);
col=IIf(state == 1 ,51,IIf(state ==0,4,1));
Plot(C,"",Col,128);
PlotShapes( shapeUpArrow * s ,6,0,L);
PlotShapes( shapeDownArrow *ss ,4,0,H);
Filter = s OR sss OR sss AND V >= 50000;
AddColumn(C,"close",1.2);
AddColumn( IIf( s, 66,1 ), "buy", formatChar, 1, bkcolor =IIf (s,colorGreen, colorRed ));
AddColumn( IIf( Ss, 83,1 ), "sell", formatChar, 1, bkcolor =IIf (Ss,colorRed, colorGreen ));
_SECTION_BEGIN("");
_N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}}: "+_DEFAULT_NAME()+" : {{OHLCX}} {{VALUES}}"
+"\n"+EncodeColor(colorRed)+
WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,","")+
WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","")+
WriteIf( sss ,"No trading signals today.","") );
AlertIf( s, "SOUND D:\songs\bhi.mp3", "Audio alert", 2 );
AlertIf( ss, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 5 );
_SECTION_END();2 comments
Leave Comment
Please login here to leave a comment.
Hi Duyqpc,
Thanks a lot for this amazing indicator. These signals give very good trades!
We just need to be careful during the consolidation periods, as usual with any trading system.
Blessings to Vietnam.
Pascal SAMSON
hay qua viet nam toi oi….