okomarov / metastockread Goto Github PK
View Code? Open in Web Editor NEWMATLAB function to read in metastock dataset
License: BSD 3-Clause "New" or "Revised" License
MATLAB function to read in metastock dataset
License: BSD 3-Clause "New" or "Revised" License
Hi,
I found an issue with the output. The Stock Name is not been matched to it's corressponding data.
See the attached. I run the metastockread code on Metastock Data Master File containing 10 securities. See "10 Stocks - Master File.JPG". If I open the data for the stock 'AINC.K' - 'ASHFORD ORD' (Field Number 10) you get "AINC.K - ASHFORD ORD - METASTOCK M FILE CONVERSION.JPG."
You'll see the Open is 1.220, the High is 1.2390, the Low is 1.1800 and the Close is 1.1800.
If you check the NASDAQ Listing, see "NASDAQ - AINK.K.JPG" that the Close was 46.60, the High was 47.59 and the Low was 46.60.
Now if I open Field Number Two's Data - ABE - ABERDEEN EMERGIN.JPG" you'll see the Open is 46.93, the High is 47.59, the Low is 46.60 and the Close is 46.60. (The correct data for AINC.K ASHFORD ORD).
Also I have another converter and ran it on the same data, See "AINC.K - Premium Converter.JPG." This gives the same data as reported by NASDAQ and also is the same as the metastockread data for ABE - ABERDEEN EMERGIN.
So Stock Names are been mixed up somehow.
I would attach the raw data but I can't attach the file types through this interface.
Regards,
Hi Oleg,
Thank you for creating and posting this function, it's very appreciated. I'm using your utility to read the Norgate Premium Database, which uses the Metastock file format. I noticed that your read*Master functions are often returning truncated values for the 'name' field. It appears that those functions are hard-coded to look for a 16-character wide field.
I touched base with Norgate tech. support on this. The rep suggested that you may have coded metastockread to an older version of the Metastock format, which only provides for a 16-character name field. There is apparently a newer version of the standard, which also includes a 45-character name field. Please see attached screen snip and emaster file below.
The snip shows the provided emaster file, opened in a programming editor. As you can see, there are 2 names stored internally per symbol. For example:
S&P 1500 Aerospa
S&P 1500 Aerospace & Defense SubInd
May I ask for your assistance please, to read the longer name? I understand that you may not wish to modify your release code to handle the additional complexity. In this case, do you have a suggestion please, how to modify the relevant line to read the longer name? For example, in readXmaster on line 11:
names = cellfun(@(x) char(x(1:find(x == 0,1,'first'))), num2cell(tmp(17:39,:).',2),'un',0) ;
I have to admit, I don't understand the math here. (How are 16 characters being read? 17 + 16 - 1 = 33)
Please let me know your thoughts?
Thanks,
Brad
HI,
When I run the code on the sample code provided it does not process all the stocks. It processes up to number 255. In the metastock file structure the first 255 stocks have an extension of .DAT and the remainder an extension of .MWD, so I think something is happening here. I have run the code on my own data, which contains 497 stocks and same issue (Files Should Be Attached).
Can this please be looked at or am I missing something in implementing the code
Thank you,
Joe
Hi,
When I run the code on the EMASTER and MASTER files I get an error and no data output.
In metastockread (line 124)
Warning: The following error was caught while executing 'onCleanup' class destructor:
Invalid file identifier. Use fopen to generate a valid file identifier.
I do get a data output when I run on the XMASTER file.
I've attached the raw data to the following download link:
http://expirebox.com/download/a0d58ac48a5b16af739e099a3a2f70df.html
See the three images below, for the output from Matlab for the EMASTER, MASTER and XMASTER files.
Regards,
Joe
Hi Oleg,
Apologies for the confusion here. The readMaster and readXmaster functions also need to be modified as well, please. Would you mind please making changes in those two functions, so that the 'fullname' field also appears in master and xmaster? (Just like it appears now in emaster)
The goal is to be able to see 'fullname' in all 3 file types, please : master, emaster, xmaster. I have attached a zip with all three, from the same data folder.
Thanks,
Brad
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.