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

Re: [amibroker] Re: Manual Stop



PureBytes Links

Trading Reference Links

Stephen --
First, my error, ')' in the wrong place.
I wrote:
   SellPrice = IIf(Open<Ref(EMA(C,40),-1,-Rfe),Open,
But should have been:
   SellPrice = IIf(Open<Ref(EMA(C,40),-1)-Rfe,Open,

Second, you just need to replace my stop price:
  
Ref(EMA(C,40), -1)
with yours:
   mybuyprice =
Ref(BuyPrice, -BarsSince(Buy)); // not using todays high
   gain = Ref(HHV(H, BarsSince(Buy)))- mybuyprice;
   mystopprice = mybuyprice
+ 0.9*gain;
in both Sell and SellPrice equations. 
Also, if you don't use an non-zero Rfe, you will get lots of whipsaws.
-- Keith


ezbentley wrote:
Thanks. But is there a way to manually set a trailing stop as a
percentage of the profit/loss of current trade? For example, exit if
the price drops by 10% from the peak value of the current trade.

Thanks,

Steven



--- In amibroker@xxxxxxxxxxxxxxx, Keith McCombs <kmccombs@xxxx> wrote:
>
> Steven --
> Yep.  For example to place sell stop 0.1 below yesterdays EMA(C,40):
>
> SetTradeDelays(1,0,1,0);  // in on tomorrow's open
> BuyPrice = Open;
> ShortPrice = Open;
>
> Rfe = 0.1;  // room for error, could use ATR for example
> Slippage = 0.05;  // or what ever you want
> SellPrice = IIf(Open<Ref(EMA(C,40),-1,-Rfe),Open,
>                 Ref(EMA(C,40),-1)-(Rfe+Slippage));
> Sell = IIf(L<Ref(EMA(C,40),-1)-Rfe,True,False);
> // Note: SellPrice is meaningless unless Sell is True
> Short=Cover=0;  // I don't short (usually)
> -- Keith
>
> ezbentley wrote:
>
> > Is there any way to implement stops manually without using ApplyStop?
> >
> > Steven



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS