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

Re: [amibroker] Intraday Data - SetForeign and data alignment



PureBytes Links

Trading Reference Links

Thanks Graham
 
That might be the clue but I think now that there might be more to it.
 
If I am displaying the chart as a daily then one would expect that if each ticker shows a daily bar for that day (in fact they show a daily bar for all bars as every ticker in my sample has been trading each day), then the code would have bar values for each foreign ticker. The same applies when viewing 15 minute, 30 minute and hourly bars. Each ticker has non zero data for every bar when viewed separately and there are no periods missing.
 
However, a daily/15 minute/30 minute/hourly bar etc is generated from the underlying 1 minute quotations.
This is where the problem might be: EVERY ticker has missing 1 minute bars, but has at least ONE 1 minute bar inside the Timeframe being displayed (e.g. daily). As per the other post on pitch forks Aussie shares are not liquid enough to ensure trade activity every minute of every day. Even BHP takes a breather.
 
So I guess that if the underlying ticker and foreign tickers do not line up sufficiently at the 1 minute bar level then the "emptiness" is propogated up to the daily/hourly chart. Hope this makes sense, if not I can give an example.
 
How can I work around this or is this where one needs to call on Thomaz for help?
 
Maybe if I could EXPAND the underlying ticker to have a bar for EVERY time period then the problem might go away. I might try testing this on the weekend with a temporary local database where I can add/delete quotations.
 
regards
Chris
 
-------Original Message-------
 
From: Graham
Date: 04/01/05 11:26:45
Subject: Re: [amibroker] Intraday Data - SetForeign and data alignment
 
Padding allows indicators to fill across data gaps, but if the
underlying ticker does not have a bar at that particular day/time bar
then the foreign ticker will not show data there.
 
On Mar 31, 2005 10:21 PM, Terry <MagicTH@xxxxxxxxxxx> wrote:
> Chris,
>
> I don't know the answer to your question. I just observe that yesterday
> someone was asking for data hole filling on intraday data. AB does (if you
> tell it) fill data holes on daily data. Sounds like more than one user sees
> that it does not fill holes intraday.
>
> Terry
>
> Chris Shawcross wrote:
>
> I'm not sure where the problem is and I think there is more than one problem
> to solve. My assumption at present is that I have done something really
> silly. I hope someone can help me out.
>
> I have constructed a volume calculation for Aussie sector indexes using the
> SetForeign function. The code works great on EOD local data (even where some
> of the constituent stocks have missing bars) BUT it performs totally
> differently for intraday data.
>
> Data sources tested:
> A. EOD Data only
> B. Marketcast RT plugin (1 minute data local storage in AB)
> C. Local data store of 1 minute data
>
> Cut down version of the code is provided at the base of this post.
>
> On EOD data, whilst displaying XIJ, the volume indicator provides a
> summation of each days volume as a histogram and details the individual
> volumes in the interpretation section. I consciously delete a couple of
> daily bars for CPU and the code correctly replaced the gaps with zero volume
> for that period.
>
> However, when switching to the intraday databases, holes suddenly appear in
> the data when each constituent ticker has valid data for that period. i.e.
> if I display the daily price/volume chart for each ticker, the code below
> shows the correct volume for today for the same ticker (and every period as
> there are no missing days in the data for any ticker). However there are
> zero volume values for some of the other tickers 9depending on which bar is
> selected) even though individually each has volume for that day.
>
> It is very hard to describe, so I hope someone understands what I am getting
> at. It appears to me that when the intraday data is compressed to provide
> daily bars, some empty bar characteristics may be propogating to a daily
> bar, but only when accessed via GetForeign. Or rather, I have made an
> obvious and silly coding error. I truly hope it is the later. What concerns
> me is that I cannot replicate the problem on the EOD data whilst viewing
> daily/weekly/monthly charts. But it is easily reproduced using daily/30
> minute/weekly etc charts with a 1 minute database. Note that the tickers DO
> have gaps between 1 minute bars as the stocks are not continuously traded.
> This is the norm for Aus as mentioned in a recent query on pitch forks.
>
> The code below allows for fill to be enabled, this produces some more
> interesting (but undesirable) effects which deserve their own post. Once
> again, I hope it is my code that has stuffed up (and easily rectified). But
> one problem at a time.
>
> regards
> Chris (Shawky)
>
> P.S. I really like the new formula environment, include files, parameter
> options etc, drag and drop, especially the insert linked facility. Looking
> forward to an Overlay Linked option in the future ;)
> The code:
>
> PadEmptyBars=ParamToggle("Pad Empty Bars","No|Yes",0);
> tickers="CPU,BCA,IRE,VSL";
> MyVol = 0;
> for ( num = 0; ( sym = StrExtract(tickers,num) ) != "" ; num++)
> {
>  if ( SetForeign(sym,PadEmptyBars) )
>  {
>   VarSet("Vol"+num, IIf(IsNull(V),0,V) );
>   RestorePriceArrays();
>  }
>  else
>  {
>   printf("Ticker "+sym+" not found\n");
>   VarSet("Vol"+num, 0);
>  }
> }
>
> for ( i = 0; i < num; i++ )
> {
>  MyVol = MyVol + VarGet("Vol"+i);
> }
>
> Plot( MyVol, _DEFAULT_NAME(),
>  IIf( C > O, ParamColor("Price Up Color", colorLightGrey ),
> ParamColor("Price Down Color", colorGrey50 ) ),
>  ParamStyle( "Price Style", styleHistogram | styleThick | styleOwnScale,
> maskHistogram  )
>  );
>
> for ( i = 0; i < num; i++ )
>  printf(  " " + StrExtract(tickers,i) + " " + WriteVal(VarGet("Vol"+i),10.0)
>  + "\n");
>
>
>
>
>
>
>
> 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:
>
>
>
>
>
>
> 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:
>
>
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
> ________________________________
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>
> To unsubscribe from this group, send an email to:
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
 
 
--
Cheers
Graham
 
 
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
--------------------------------------------------------------------~->
 
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:
 
 
Yahoo! Groups Links
 
<*> To visit your group on the web, go to:
 
<*> To unsubscribe from this group, send an email to:
 
<*> Your use of Yahoo! Groups is subject to:
 
 
 
 
 


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





Yahoo! Groups Links