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

[amibroker] Re: Big time problem with trade exit.



PureBytes Links

Trading Reference Links

That didn't solve the problem Dingo.
For example:
Open long position 8/15/02 at 24.24 and stopped out at the open on 
8/29/03 at 23.03 for a loss of 5%. However, the open on that day was 
23.2 and 23.03 wasn't hit until later the same day. The system then 
went short at the open on 8/29, so again it looked some hours into 
the future.

Puzzling?

Keith

--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> Uncheck the 2 options you describe at the end and see what happens.
>  
> d
> 
> -----Original Message-----
> From: Keith Bennett [mailto:kbennett@x...] 
> Sent: Monday, September 15, 2003 3:14 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Big time problem with trade exit.
> 
> 
> Thanks Dave, and it's probably me doing the misunderstanding.
> 
> A long position may span many days. If, at any time, the LOW is 
below 
> MyLongStop then exit the trade at the next day open - otherwise 
> remain in the trade until the next Sell signal.
> 
> Similarly, a short position may also span many days. If,at any 
time, 
> the HIGH is above MyShortStop etc. etc.
> 
> The stops are intended to limit losses to 5% although the actual 
loss 
> may be more or less because the Low/High isn't known until eod.
> 
> As you can see below, I have been trying to achieve this using 
> ApplyStop but I seem to be looking into the future.
> 
> Hope it's clear and if you, or anyone, have any suggestions they 
> would be appreciated.
> 
> Keith
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
> wrote:
> > uh, that was supposed to be "sorry if *I* missed the point...
> > 
> > dave
> >   I'm probably misunderstanding something basic here, but why not 
> skip the
> > buy
> >   in that case, instead of entering it and exiting later the same 
> day? in
> >   other words, add the condition Ref(Low, -1) > MyStop to the buy 
> condition.
> > 
> >   or are you trying to make a profit on that partial day when 
this 
> sequence
> >   happens?
> > 
> >   sorry if you missed the point...
> > 
> >   dave
> > 
> >   > It would be nice to exit longs at the open if you knew your 
> stops
> >   > would be hit later in the day. That seems to be what I'm 
doing 
> with
> >   > the following illustrative code.
> >   >
> >   > Cl = Foreign("QQQ","Close");
> >   > BuyPrice=SellPrice=ShortPrice=CoverPrice=Open;
> >   > SetTradeDelays(1,1,1,1);
> >   > ApplyStop(stopTypeLoss,stopModePercent,5,True);
> >   > Buy = Cross(EMA(Cl,5),MA(Cl,15));
> >   > Sell = Cross(MA(Cl,15),EMA(Cl,5));
> >   > Equity(1);
> >   > Short = Sell; Cover = Buy;
> >   > Equity(1);
> >   >
> >   > What I'm trying to do is to trade QQQ at the open as called 
by 
> my Buy
> >   > & Sell conditions, but to exit the trade at the open if the 
> previous
> >   > day's low was below my stop, and then wait for the next trade 
> signal.
> >   >
> >   > The 1/7/03 long position (with a 5% StopLoss) was closed at 
the 
> open
> >   > on 1/21/03 but the stop wasn't hit until later that same 
day :-(
> >   >
> >   > Does anyone know how I should change the code so that it 
> activates
> >   > the stop based on the prior day's bar?
> >   >
> >   > I have the range set for 01/01/02 to 09/12/03. In Settings I
> >   > have "Activate stops immediately" and "Allow same day exit" 
> checked.
> >   > I'm using eod data.
> >   >
> >   > Keith
> 
> 
> 
> Yahoo! Groups Sponsor	
> 
> ADVERTISEMENT
>  
> 
<http://rd.yahoo.com/M=251812.3856299.5103760.1261774/D=egroupweb/S=17
05
> 
632198:HM/A=1754451/R=0/SIG=11tkldm5d/*http://www.netflix.com/Default?
mq
> so=60178323&partid=3856299> click here	
>  
> <http://us.adserver.yahoo.com/l?
M=251812.3856299.5103760.1261774/D=egrou
> pmail/S=:HM/A=1754451/rand=765891284> 	
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/