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

[amibroker] Re: (unknown)



PureBytes Links

Trading Reference Links

Anthony,

I am truly amazed how you guys wright with such an easiness  these 
codes.
I am just recently (2 wks ago) introduced to the AmiBroker and it 
seems to me anything or everything can be written in AFL. AB beats 
TS and MS together...
What I meant in my last comment was  possibility to write for an 
exploration/scan which looks for these 2 conditions (at the same 
time), first, touch/cross on the upper/lower band and second, peak 
or trough after the first condition within the bands (as Sid defined 
it much better).

Thanks again for this great exploration!

Steven  



--- In amibroker@xxxxxxxxxxxxxxx, Anthony Faragasso <ajf1111@xxxx> 
wrote:
> Steve,
> 
> Open / view.. the Alert Output window...The formula will Ding when 
one
> of the cross conditions is met with a text output describing the
> cross.....Also, you can load the formula into the AA window, and 
select
> your database , all stocks, filter etc, n last quotations and n=1, 
click
> explore...also, if you want to see some markers , remove 
the /*...*/ at
> the plotshapes()....
> 
> //Input:
> Coefdwn=Param("coefdwn",2.1,0.05,3,0.01);
> Coefup=Param("coefup",2.3,0.05,3,0.01);
> 
> //ATR custom
> 
> Per=Param("per",14,5,21,1);
> TH= IIf(Ref(RSIa(C,Per), -1) > RSIa(C,Per), Ref(RSIa(C,Per), -1),
> RSIa(C,Per));
> TL= IIf(Ref(RSIa(C,Per), -1) < RSIa(C,Per), Ref(RSIa(C,Per), -1),
> RSIa(C,Per));
> TR= TH - TL;
> Truerangecustom=MA(TR, per);
> 
> //Plot(Truerangecustom,"",colorRed,styleLine);
> movingAverage1=Param("movingAverage1",6,3,21,1);
> movingaverage2=Param("movingaverage2",15,10,21,1);
> 
> topband=MA(RSIa(Close,Per),movingAverage1)+(Coefup*MA
(TrueRangeCustom,movingaverage2));
> 
> Plot3=RSIa(Close,Per);
> 
> bottomband=MA(RSIa(Close,Per),movingAverage1)-(Coefdwn*MA
(TrueRangeCustom,movingaverage2));
> 
> 
> 
> Plot(topband,"Plot1",colorYellow,styleLine);
> Plot(Plot3,"Plot3",colorRed,styleLine);
> Plot(bottomband,"plot2",colorYellow,styleLine);
> 
> 
> //IF CheckAlert Then Begin
> Alert=IIf(Cross(topband,plot3)/*Plot1 Crosses Above Plot3*/ OR
> Cross(plot3,topband)/*Plot1 Crosses Below Plot3*/OR
> Cross(bottomband,plot3)/*Plot2 Crosses Above Plot3*/ OR
> Cross(Plot3,bottomband)/* Plot2 Crosses Below Plot3*/,1,0);/* Then
> Alert=True;*/
> 
> //Markers
> 
> /*PlotShapes(IIf(Cross
(topband,Plot3),shapeDigit2,shapeNone),colorGreen);
> 
> PlotShapes(IIf(Cross
(Plot3,topband),shapeDigit1,shapeNone),colorGreen);
> PlotShapes(IIf(Cross
(bottomband,plot3),shapeDigit3,shapeNone),colorRed);
> 
> PlotShapes(IIf(Cross
(Plot3,bottomband),shapeDigit4,shapeNone),colorRed);*/
> 
> Title=Name()+"...Alert
> ="+WriteIf(Alert==1,"True","False")+WriteIf(Cross
(topband,plot3),"...RSIA
> of Close has moved BELOW the top
> Band",WriteIf(Cross(plot3,topband),"...RSIA of Close has moved 
ABOVE the
> Top Band",WriteIf(Cross(bottomband,plot3),"...RSIA of Close has 
moved
> BELOW the Bottom Band",WriteIf(Cross(Plot3,bottomband),"...RSIA of 
Close
> has moved ABOVE the Bottom Band",""))));
> 
> //For AA window results / Explore
> //Value returned for last day of Data
> //n last quotations , n=1
> 
> Cross1=Cross(plot3,topband);
> Cross2=Cross(topband,plot3);
> Cross3=Cross(bottomband,plot3);
> Cross4=Cross(Plot3,bottomband);
> 
> Filter=Cross1 OR Cross2 OR Cross3 OR Cross4;
> 
> AddColumn(C,"Close");
> AddTextColumn(WriteIf(Cross1,"RSIA crossed above
> topBand",WriteIf(Cross2,"RSIA crossed below
> TopBand",WriteIf(Cross3,"RSIA crossed Below
> BotBand",WriteIf(Cross4,"RSIA crossed Above 
BotBand","")))),"Position of
> RSIA");
> 
> //alert output window
> AlertIf(Cross1,"SOUND C:\\Windows\\Media\\Ding.wav", "RSIA crossed 
ABOVE
> topBand",10);
> AlertIf(Cross2,"SOUND C:\\Windows\\Media\\Ding.wav", "RSIA crossed 
BELOW
> topBand",10);
> AlertIf(Cross3,"SOUND C:\\Windows\\Media\\Ding.wav", "RSIA crossed 
BELOW
> BotBand",10);
> AlertIf(Cross4,"SOUND C:\\Windows\\Media\\Ding.wav", "RSIA crossed 
ABOVE
> BotBand",10);
> 
> I do not fully understand your last comments....
> "write an alert responsive after the first touch
> when rsi fails to reach upper/lower band and turns down/up within 
3-
> periods (signal probably more significant)?"
> 
> Anthony
> 
> stevenjaksic wrote:
> 
> >  Anthony,
> >
> > TS gives me a pop alert whenever RSI touches upper or lower band.
> > Is it possible to write an alert responsive after the first touch
> > when rsi fails to reach upper/lower band and turns down/up 
within 3-
> > periods (signal probably more significant)?
> >
> > Regards,
> >
> >      Steven
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, Anthony Faragasso 
<ajf1111@xxxx>
> > wrote:
> > > steven,
> > >
> > > What kind of alert signal does tradestation give you, when 
using
> > this
> > > code....
> > >
> > > Anthony
> > >
> > > stevenjaksic wrote:
> > >
> > > >  Hi Anthony,
> > > >
> > > > Thanks a lot!  I have compared Amibroker's graph with the
> > > > Tradestation one and it perfectly matches. Yes, I would like
> > > > Alertmarker added if possible.
> > > > Again thanks for the great piece of code, this application 
RSI
> > with
> > > > Volatility Bands is used in this manner:
> > > >
> > > > When the RSI is near an extreme high or low and touches
> > volatility
> > > > band the indicator will follow the strong move and will pull 
back
> > > > from the bend. The signal comes when RSI tries to resume 
former
> > > > trend and fails to challenge outer band for the second time. 
You
> > > > don't need divergence or any other signal, only failure of 
RSI to
> > > > reach upper or lower band for the second time.
> > > >
> > > > I would like to thank other guys also for the effort (Bob and
> > Sid).
> > > >
> > > > Best Regards,
> > > >
> > > >           Steven
> > > >
> > > >
> > > >
> > > > --- In amibroker@xxxxxxxxxxxxxxx, Anthony Faragasso
> > <ajf1111@xxxx>
> > > > wrote:
> > > > > Steven,
> > > > >
> > > > > Try this, load into Indicator builder.....select Show 
dates and
> > > > Middle
> > > > > if you want to ....
> > > > >
> > > > > let me know if this is similar to Tradestation's....also, I
> > will
> > > > add the
> > > > > Alertmarker if you want.
> > > > >
> > > > > //Input:
> > > > > Coefdwn=2.1;
> > > > > Coefup=2.3;
> > > > >
> > > > > //ATR custom
> > > > >
> > > > > Per=14;
> > > > > TH= IIf(Ref(RSIa(C,Per), -1) > RSIa(C,Per), Ref(RSIa
(C,Per), -
> > 1),
> > > > > RSIa(C,Per));
> > > > > TL= IIf(Ref(RSIa(C,Per), -1) < RSIa(C,Per), Ref(RSIa
(C,Per), -
> > 1),
> > > > > RSIa(C,Per));
> > > > > TR= TH - TL;
> > > > > Truerangecustom=MA(TR, per);
> > > > >
> > > > > //Plot(Truerangecustom,"",colorRed,styleLine);
> > > > >
> > > > >
> > > > > Plot1=MA(RSIa(Close,14),6)+(Coefup*MA(TrueRangeCustom,15));
> > > > > Plot2=MA(RSIa(Close,14),6)-(Coefdwn*MA
(TrueRangeCustom,15));
> > > > > Plot3=RSIa(Close,14);
> > > > >
> > > > > Plot(Plot1,"Plot1",colorYellow,styleLine);
> > > > > Plot(Plot2,"plot2",colorYellow,styleLine);
> > > > > Plot(Plot3,"Plot3",colorRed,styleLine);
> > > > >
> > > > > /*IF CheckAlert Then Begin
> > > > >       If Plot1 Crosses Above Plot2 OR Plot1 Crosses Below 
Plot2
> > > > >       OR Plot1 Crosses Above Plot3 OR Plot1 Crosses Below 
Plot3
> > > > >       OR Plot2 Crosses Above Plot3 OR Plot2 Crosses Below 
Plot3
> > > > >       Then Alert=True;
> > > > > End;*/
> > > > >
> > > > >
> > > > > Anthony
> > > > >
> > > > > stevenjaksic wrote:
> > > > >
> > > > > >  Hi guys,
> > > > > >
> > > > > > I need a help with Tradestation formula I want to 
translate
> > to
> > > > AFL,
> > > > > > basically it's RSI with Volatility bands applied, I dont'
> > believe
> > > > > > AFL has coef and truerange function.
> > > > > >
> > > > > > Thanks in advance,
> > > > > >
> > > > > >                        Steven
> > > > > >
> > > > > > Input: Coefdwn(2.1),Coefup(2.3);
> > > > > > Plot1((Average((RSI(Close,14)),6))+(Coefup*(Average
> > > > (TrueRangeCustom
> > > > > > ((RSI(Close,14)),(RSI(Close,14)),(RSI
> > (Close,14))),15))),"Plot1");
> > > > > > Plot2((Average((RSI(Close,14)),6))-(Coefdwn*(Average
> > > > (TrueRangeCustom
> > > > > > ((RSI(Close,14)),(RSI(Close,14)),(RSI
> > (Close,14))),15))),"Plot2");
> > > > > > Plot3((RSI(Close,14)),"Plot3");
> > > > > > IF CheckAlert Then Begin
> > > > > >       If Plot1 Crosses Above Plot2 or Plot1 Crosses Below
> > Plot2
> > > > > >       or Plot1 Crosses Above Plot3 or Plot1 Crosses Below
> > Plot3
> > > > > >       or Plot2 Crosses Above Plot3 or Plot2 Crosses Below
> > Plot3
> > > > > >       Then Alert=TRUE;
> > > > > > End;
> > > > > >
> > > > > >
> > > > > >                    Yahoo! Groups Sponsor
> > > > >                         ADVERTISEMENT
> > > > >
> > > > >
> > > > > >
> > > > > > Send BUG REPORTS to bugs@xxxx
> > > > > > Send SUGGESTIONS to suggest@xxxx
> > > > > > -----------------------------------------
> > > > > > 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.
> > > >
> > > >
> > > >                    Yahoo! Groups Sponsor
> > >                         ADVERTISEMENT
> > >
> > >
> > > >
> > > > Send BUG REPORTS to bugs@xxxx
> > > > Send SUGGESTIONS to suggest@xxxx
> > > > -----------------------------------------
> > > > 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.
> >
> >
> >                    Yahoo! Groups Sponsor
>                         ADVERTISEMENT
> 
> 
> >
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/