logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ABDULLAH7044  
#1 Posted : Thursday, March 8, 2012 2:49:07 PM(UTC)
ABDULLAH7044

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/15/2011(UTC)
Posts: 10

Hi Everybody, How can I Program VBviewer Example to give me 10 minute Interval is there puilt in function in msfl91d.dll to do this or I must write my own procedure I did write my own procedure with another dll (MetaLib) but the procedure do not give accurate results I dont know why The procedure just accumolate the the ticks in variable Min untel it is equal 10 like this Min = Min + DateDiff("n", SecuritiesTime(Y), SecuritiesTime(Y + 1)) Any help please
wabbit  
#2 Posted : Thursday, March 8, 2012 4:35:50 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
The VBViewer sample code app does not have a time compression function, so it will only show you the datafile in the time period in which it is locally stored. If you want to see the data in another timeframe, then; a) download and locally save the data in the required timeframe(s), or b) write a compression algorithm (but unfortunately without the write version of the MDK, or a thirdparty library, you wont be able to save the data in its new timeframe).

I find the easiest way to compress data is to find a "bin" algorithm, e.g. to create whole minute data bins, starting from midnight you could do something like:
Code:

int whichBin(int hour=0, int minute=0, int binsize=1)
{
return (int(((hour*60.0)+minute)/binsize));
}


You can then deal with the data in each bin to sort out the OHLCVOI data as required.



wabbit [:D]

ABDULLAH7044  
#3 Posted : Thursday, March 8, 2012 5:36:06 PM(UTC)
ABDULLAH7044

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/15/2011(UTC)
Posts: 10

Thank you Wabbit for reply the last choice looks the best one but I dont understand what the bin algorithm is can you explaine more my country stockmarket start at 11 am and close at 3.5 pm
wabbit  
#4 Posted : Friday, March 9, 2012 6:51:00 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
The algorithm simply takes a timestamp and returns the identification of a "bin" into which all data with similarly grouped timestamps shall be placed e.g. data with timestamps:
00:00 - 00:09 go into one bin
00:10 - 00:19 goes into the next bin
00:20 - 00:29 next bin etc
...
...
...
23:50 - 23:59 the last bin for that day


wabbit [:D]




Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.