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

Re: [amibroker] weekly prices look into the future?



PureBytes Links

Trading Reference Links




Dave,
 
You should RE-READ the 
docs. Especially the following bits:
 
 

TimeFrameGetPrice( pricefield, interval, shift = 
0, mode = expandFirst );- references OHLCV fields from other time 
frames. This works immediatelly without need to call TimeFrameSet at 
all.Price field is one of the following: "O", "H", "L", "C", "V", "I" (open 
interest). Interval is bar interval in seconds. shift allows to reference past 
(negative values) and future (positive values) data in higher time frame. For 
example -1 gives previous bar's data (like in Ref function but this works in 
higher time frame).
Examples:
TimeFrameGetPrice( "O", inWeekly, -1 ) - gives you previous 
week OPEN priceTimeFrameGetPrice( "C", inWeekly, -3 ) - gives 
you weekly Close price 3 weeks agoTimeFrameGetPrice( "H", inWeekly, -2 
) - gives you weekly High price 2 weeks agoTimeFrameGetPrice( 
"O", inWeekly, 0 ) - gives you this week open price.
TimeFrameGetPrice( "H", inDaily, -1 ) - gives previous day 
high when working on intraday data

Shift works as in Ref() function but it is applied to compressed time 
frame.

Note these functions work like these 3 nested 
functionsTimeFrameExpand( Ref( 
TimeFrameCompress( array, interval, compress(depending on field used) ), shift 
), interval, expandFirst )therefore 
if shift = 0 compressed data may look into the future ( weekly high can be known 
on monday ). If you want to write a trading system using this 
function please make sure to reference PAST data by using negative shift 
value.
 
Best regards,Tomasz Janeczkoamibroker.com
----- Original Message ----- 
From: "Dave Merrill" <<A 
href="">dmerrill@xxxxxxx<FONT 
size=2>>
To: "AmiBroker" <<A 
href=""><FONT 
size=2>amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, September 25, 2003 4:12 PM
Subject: [amibroker] weekly prices look into the 
future?
> I'm using the following to 
get a weekly price:>   c_w = TimeFrameGetPrice("C", 
inWeekly);> > if I raise a friday's price by a factor of 10, not 
only does the weekly> price on that day go up, but so do the weekly 
prices for every day EARLIER> that week. monday's weekly price depends on 
the close THE FOLLOWING FRIDAY.> > if weekly price figures depend 
on data for the rest of the days *afterwards*> in that week, they're 
effectively looking into the future.> > this is a huge no-no for 
backtesting, and, unfortunately, may be the reason> some daily/weekly 
divergences I've been looking at backtest so well.> > 
comments?> > Dave Merrill> > > 
------------------------ 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.> <A 
href=""><FONT 
size=2>http://www.c1tracking.com/l.asp?cid=5511> 
<FONT 
size=2>http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM<FONT 
size=2>> 
---------------------------------------------------------------------~->> 
> Send BUG REPORTS to <FONT 
size=2>bugs@xxxxxxxxxxxxx> Send SUGGESTIONS to 
<FONT 
size=2>suggest@xxxxxxxxxxxxx> 
-----------------------------------------> Post AmiQuote-related messages 
ONLY to: <FONT 
size=2>amiquote@xxxxxxxxxxxxxxx > (Web page: 
<FONT 
size=2>http://groups.yahoo.com/group/amiquote/messages/<FONT 
size=2>)> --------------------------------------------> Check 
group FAQ at: <A 
href=""><FONT 
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT 
size=2> > > Your use of Yahoo! Groups is subject to <A 
href=""><FONT 
size=2>http://docs.yahoo.com/info/terms/ > 
> > 






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.