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

Re: Multiple Stops



PureBytes Links

Trading Reference Links

Thanks for the reply. It helped me in that it showed that my idea 
wasn't going to work like I wanted it to, AND gave me an example of 
the Exrem() function. :o)

Will the Exrem() work on short and cover also?
Buy = ExRem( buy, sell );
sell = ExRem( sell, buy );
Cover= ExRem( Cover, short );?
short = ExRem( short, cover);?

TIA
Nathan


--- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> 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
>