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

RE: [amibroker] DATA GAPS gaps are NOT SHOWN in chart ??!!



PureBytes Links

Trading Reference Links

Paolo:

Because you've told it to. Take a look at your price arrays. You are
assigning the buyprice, for example, as the max of either YESTERDAY's high
or TODAY's low. So, depending on which is higher, that's what you'll get. If
the price gaps up on entry day such that the low is higher than yesterday's
high, then you'll enter on today's low. That may be OK for backtesting, but
of course, in real trading, you won't know that until the end of the day
after you download your data. You might consider BuyPrice =
Max(ref(H,-1),O); to better simulate real trading.

Ciao!

Al Venosa

----- Original Message ----- 
From: "Paolo" <pmonnetti@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, April 30, 2004 6:03 AM
Subject: [amibroker] BuyPrice/ShortPrice Problem


> The following code is designed to trade on DI+/DI- crossovers,
> entering on a stop set at the previous day's high or low. As far as
> the buy/short signals are concerned it seems to perform perfectly,
> but can anyone tell me why about 50% of the time, and apparently
> randomly, it enters at the CURRENT day's high or low, instead of on a
> stop at the previous day's?
>
> Paolo
>
>
> BuyStop=Ref(H,-1); SellStop=Ref(L,-1);
> BuyPrice=Max(BuyStop,L);
> CoverPrice=Max(BuyStop,L);
> ShortPrice=Min(SellStop,H);
> SellPrice=Min(SellStop,H);
> PositionSize=4000;
>
> Buy=Cross(Ref(PDI(14),-1),Ref(MDI(14),-1));
> Short=Cross(Ref(MDI(14),-1),Ref(PDI(14),-1));
> Sell=Short;
> Cover=Buy;
>
>
>
>
> 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
> Yahoo! Groups Links
>
>
>
>
>



------------------------ 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/mOAaAA/3exGAA/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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

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