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

Re: [amibroker] Multiple Stops



PureBytes Links

Trading Reference Links

Hello,

Currently ApplyStop supports only 3 simultaneous stops:
one max loss top, one profit target and one trailing stop.

To workaround this limitation I would suggest using the following:

ApplyStop( 0, 1, 6, 1 ); // 6% max loss + exit at stop
ApplyStop( 2, 1, 8, 0 );

Buy = your rule here;

Sell = your rule here;

Buy = ExRem( buy, sell );

sell = ExRem( sell, buy );

Stop2 = BarsSince( Buy ) > 1 AND Ref( Low, -1 ) < 0.96 * ValueWhen( Buy, BuyPrice ); // 4% max loss next day

SellPrice = IIf ( Stop2, Open, SellPrice );

Sell = Sell OR Stop2;

Best regards,
Tomasz Janeczko
amibroker.com

----- Original Message ----- 
From: <njpowell@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, November 29, 2001 9:36 PM
Subject: [amibroker] Multiple Stops


> To anyone who can help,
> 
> Currently my maximum stop loss is 4% and trailing stop is 8% in 
> Settings. What I would like to do is this, if the price drops from 
> 4% to 6% below my buy price, give a signal to exit at the open the 
> next trading day, but if the price drops more than 6%, I want to exit 
> it immediately. 
> 
> I tried using: ApplyStop(0,1,6,1); -- maximum stop loss, percent 
> mode, 6%, exit at stop YES; -- but by useing it, it made everything 
> a 6% max stop, exit @ stop and ignored the 4%. 
> I'm looking for: 
> max stop at 4%(exit at stop=NO)
> max stop at 6%(exit at stop=YES)
> trailing stop at 8%(exit at stop=NO)
> How can I do this in afl code?
> Nathan
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>