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

Re: [amibroker] Re: Why stops are not working sometimes?


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: Why stops are not working sometimes?
  • From: "Mike Lucero" <m.lucero@xxxx>
  • Date: 28 Oct 2002 08:00:52 -0000
  • In-reply-to: <a844le+mjf4@xxxx>

PureBytes Links

Trading Reference Links

Does this still work for selling the same day? It doesn't seem to work for
me. I wanted to sell if C<OpenPrice;

SellSameDay = (Buy AND C<BuyPrice);


Thanks,

Mike
----- Original Message -----
From: "Tomasz Janeczko" <amibroker@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, March 30, 2002 8:32 AM
Subject: Re: [amibroker] Re: Why stops are not working sometimes?


> Hello,
>
> Yes this is by design (mainly because of the fact that using EOD
> data you can't be sure WHEN entry was made - when you entered
> a trade on close (the default setting) exiting exiting by stop the same
day
> makes no sense - it can make any sense only if you entered on open
> - but this is the only realistic case).
>
> If you are entering on open and want to exit the same day if price
> drops too much use this:
>
> buy = your formula here
> buyprice = open;
>
> /* exit the same day if low drops 5% below buyprice (open) */
> samedaystop = buy AND low < 0.95 * buyprice;
> sell = your-original-formula OR samedaystop;
> sellprice = IIF( samedaystop, 0.95 * buyprice, sellprice );
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "tc4848" <tc4848@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Saturday, March 30, 2002 11:39 AM
> Subject: [amibroker] Re: Why stops are not working sometimes?
>
>
> > Hi,
> >
> > It seems stops get applied the day after the trade is entered at the
> > earliest. So if entry is on the open, but the close is lower than
> > the stop price, the stop still will not be triggered until the open
> > of the next day.
> >
> > I have a simple piece of code which I cooked up to arrive at the
> > above conclusion.
> >
> > Upday=Close>Open;
> > BuyPrice=Open;
> > SellPrice=Close;
> > ShortPrice=Open;
> > CoverPrice=Close;
> > Buy=NOT Ref(Upday,-1) AND NOT Ref(Upday,-2) AND NOT Ref(Upday,-3);
> > Short=Ref(Upday,-1) AND Ref(Upday,-2) AND Ref(Upday,-3);
> > TradeLength=1;
> > Sell=BarsSince(Buy)==TradeLength;
> > Cover=BarsSince(Short)==TradeLength;
> > ApplyStop(0,2,5,1);
> > ApplyStop(1,2,3,1);
> >
> > If TradeLength=0, stops don't show up in the results. If
> > TradeLength=1, stops are triggered on the following day's open.
> > Using IBM's prices from 1998 will show you what I mean. This occurs
> > even when setting all delays in the setting dialogue box to 0.
> >
> > Is that the way it's supposed to work? If so, the trade results get
> > skewed improperly for very wide range days (which happens
> > sometimes). I'll rather get stopped out at my target, rather than
> > have profits bigger than my target prices in my backtest results.
> >
> >
> >
> > TC
> >
> >
> >
> > --- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> > > vzhig,
> > >
> > > You forgot about such case:
> > > Let's say you buy on close.
> > > Then the day after the prices GAP DOWN at open -10%
> > > 3% stop gets activated BUT.... you sell at open -10%
> > > because there is no way to sell it at a higher price.
> > >
> > > That's the reason.
> > >
> > > Best regards,
> > > Tomasz Janeczko
> > > amibroker.com
> > > ----- Original Message -----
> > > From: "vzhig" <zhigulin@xxxx>
> > > To: <amibroker@xxxx>
> > > Sent: Saturday, March 30, 2002 2:54 AM
> > > Subject: [amibroker] Why stops are not working sometimes?
> > >
> > >
> > > > Hi all,
> > > >
> > > > at the end of my system I have the following:
> > > >
> > > > ...
> > > > Buy = <some filter>;
> > > > BuyPrice = BuyLevel;
> > > >
> > > > ApplyStop( 0, 1, 3, 1 ); //Stop-Loss 3%
> > > > ApplyStop( 2, 1, 3, 1 ); //Trailing Stop 3%
> > > > ApplyStop( 1, 1, 20, 1 ); //Profit target 20%
> > > >
> > > > Sell = Buy AND C < BuyLevel; //sell if price closes below buy
> > level
> > > > SellPrice = C;
> > > >
> > > > Interestingly, sometimes I see trades like these:
> > > >
> > > > AATK Long 8/24/99 8/24/99 -1059.60 -10.6%
> > > > ABGX Long 5/25/00 5/25/00 -979.13 -9.8%
> > > > ABIZ Long 7/11/00 7/11/00 -479.52 -5.6%
> > > > ABIZ Long 5/25/00 5/25/00 -472.81 -5.2%
> > > >
> > > > Apparently, stop-loss and trailing stop are not working. Why is
> > it
> > > > so?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
> >
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>