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

Re: [amibroker] Re: ApplyStop accepts new values in 3.78



PureBytes Links

Trading Reference Links

Hello,

I don't know what is your entry ( buy ) formula,
but if there are multiple buy signals ValueWhen() will
return the last one so your stops are moving.

Using ApplyStop() you always setup the stop levels
at the first signal that really opens the trade.

Therefore ApplyStop() is more reliable.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message ----- 
From: <cliffelion@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, October 25, 2001 4:35 PM
Subject: [amibroker] Re: ApplyStop accepts new values in 3.78


> Hi Tomasz, 
> 
> I am trying new ApplyStop feature, but seems to provide slightly 
> different results from my previous AFL implementation.
> 
> /**old code to exit trade**/
> Lentryprice = ValueWhen ( Buy, BuyPrice ); 
> Lprofitprice = Lentryprice * ( 1+ptarget/100 );
> Lstopprice = Lentryprice * ( 1-stopl/100 );
> 
> sell1 = BarsSince ( Buy ) > ldays;
> sell2 = High > Lprofitprice;
> sell3 = Low < Lstopprice;
> Sell = sell1 or sell2 or sell3;
> 
> SellPrice = IIf ( sell2, Max ( Open, Lprofitprice ), IIf ( sell3, 
> Min ( Open, Lstopprice ), Close ) );
> 
> /**NEW code to exit trade**/
> ApplyStop ( 1, 1, ptarget, 1 );
> ApplyStop ( 0, 1, stopl, 1 );
> 
> sell = BarsSince ( Buy ) > ldays;
> sellprice = close;
> 
> ?????
> As far as I can tell, the target stop behaves the same, but the 
> stoploss seems to be different, can you provide some insight???
> 
> Thanks,
> 
> Cliff Elion
> 
> 
> 
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>