PureBytes Links
Trading Reference Links
|
--- In amibroker@xxxxxxxxxxxxxxx, "acmetelka" <jstepan@xxxx> wrote:
> Hi,
>
> I'm new in AFL and Amibroker, so I'm just trying to get into the
> scripts and bac testing...
>
> Can anyone help me, how to write formula for trailing buy-stop,
> described on
> http://www.incrediblecharts.com/technical/trailing_stops.htm ?
>
> First condition can be for example MA crossing and after that I
need
> to activate script for this trailing buy-stop, but I don't know,
how
> many days it will be before activation of buy order.
>
The quick and easy way to use a trailing stop is to go into AA
(Automated analysis - where you do your optimizations) and under the
settings button click on the stops tab and set your trailing stop to
what you want it to be.
The more sophisticated way to do it is using the Applystop
function. Here is a simple long only system moving average
optimizer using the applystop set for a trailing stop based upon a %
retracement:
Count=Optimize("Days",4,4,100,1);
stop=Optimize("stop",8,1,10,1);
Buy = Cross(Close,MA(Close,Count));
Sell = Cross(MA(Close,Count),Close);
ApplyStop(stopTypeTrailing,stopModePercent,stop,True);
There you go. Hope it helps. Check out the applystop function in
the AFL user's manual and also read a bit in the archive- it can be
a bit tricky at first.
Regards, -S
> Thanx a lot,
>
> AC.Metelka.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|