<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Reading Metastock files</title>
	<atom:link href="http://themech.net/2008/08/reading-metastock-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://themech.net/2008/08/reading-metastock-files/</link>
	<description>Python, software development, stock exchange, C#</description>
	<lastBuildDate>Mon, 23 Aug 2010 18:21:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jacek Marchwicki</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-9667</link>
		<dc:creator>Jacek Marchwicki</dc:creator>
		<pubDate>Tue, 27 Jul 2010 16:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-9667</guid>
		<description>I had to do following changes because python reads one more line from some files:
--- a/metastock/files.py
+++ b/metastock/files.py
@@ -43,9 +43,10 @@ class DataFileInfo(object):
         file_handle = open(filename, &#039;r&#039;)
         lines = file_handle.read().split()
         file_handle.close()
-        assert(len(lines) == self.num_fields)
+        assert(len(lines) &gt; self.num_fields)^M
         self.columns = []
-        for line in lines:
+        for position in range(self.num_fields):^M
+            line = lines[position]^M
             match = self.reg.search(line)
             colname = match.groups()[0]
             self.columns.append(colname)</description>
		<content:encoded><![CDATA[<p>I had to do following changes because python reads one more line from some files:<br />
&#8212; a/metastock/files.py<br />
+++ b/metastock/files.py<br />
@@ -43,9 +43,10 @@ class DataFileInfo(object):<br />
         file_handle = open(filename, &#8216;r&#8217;)<br />
         lines = file_handle.read().split()<br />
         file_handle.close()<br />
-        assert(len(lines) == self.num_fields)<br />
+        assert(len(lines) &gt; self.num_fields)^M<br />
         self.columns = []<br />
-        for line in lines:<br />
+        for position in range(self.num_fields):^M<br />
+            line = lines[position]^M<br />
             match = self.reg.search(line)<br />
             colname = match.groups()[0]<br />
             self.columns.append(colname)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samri</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-9069</link>
		<dc:creator>Samri</dc:creator>
		<pubDate>Thu, 24 Jun 2010 19:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-9069</guid>
		<description>Hello, mech.
I&#039;ve just downloaded your source code from github. It&#039;s producing an error but no sweat, I&#039;ll go through the python code and see what&#039;s going wrong.
Meanwhile, I do want to thank you, and ask Narendra if he would be kind enough to post his source code for writing operations. I got the .exe off the kakup website but can&#039;t find an address for him there (didn&#039;t want to use the contact-at address in case it goes to the wrong person).</description>
		<content:encoded><![CDATA[<p>Hello, mech.<br />
I&#8217;ve just downloaded your source code from github. It&#8217;s producing an error but no sweat, I&#8217;ll go through the python code and see what&#8217;s going wrong.<br />
Meanwhile, I do want to thank you, and ask Narendra if he would be kind enough to post his source code for writing operations. I got the .exe off the kakup website but can&#8217;t find an address for him there (didn&#8217;t want to use the contact-at address in case it goes to the wrong person).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mech</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-8905</link>
		<dc:creator>mech</dc:creator>
		<pubDate>Mon, 14 Jun 2010 17:22:39 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-8905</guid>
		<description>Gabriel,
narendra (you can read his comment above) created a tool that reads XMASTER files and does many other things. I suggest contacting him or checking his website (http://www.kakup.com/)</description>
		<content:encoded><![CDATA[<p>Gabriel,<br />
narendra (you can read his comment above) created a tool that reads XMASTER files and does many other things. I suggest contacting him or checking his website (<a href="http://www.kakup.com/" rel="nofollow">http://www.kakup.com/</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-8810</link>
		<dc:creator>Gabriel</dc:creator>
		<pubDate>Mon, 07 Jun 2010 19:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-8810</guid>
		<description>Hi, I used it but only could read the sysmbols that are in master data. there are many on XMASTER. how can I extract the ohter symbols ? is it possible ? tks regards</description>
		<content:encoded><![CDATA[<p>Hi, I used it but only could read the sysmbols that are in master data. there are many on XMASTER. how can I extract the ohter symbols ? is it possible ? tks regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mech</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-7535</link>
		<dc:creator>mech</dc:creator>
		<pubDate>Mon, 01 Mar 2010 20:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-7535</guid>
		<description>narendra,
This blog entry is quite old. I just needed to read the Metastock quotations and convert it to other format. As there was very little information on the web about Metastock file format and MBF, I thought I would share this knowledge. 
As you&#039;ve noticed, it&#039;s just a starting point for reading metastock files, there are a lot of topics not covered here.

I&#039;m impressed with the functionality you&#039;ve added and I&#039;m interested to see the details :) I&#039;m also glad you want to share this with others. The best way I think is to put your source code on some public source code hosting server (like github). If you would simply like to update my project on github, I can grant to you the necessary privileges.</description>
		<content:encoded><![CDATA[<p>narendra,<br />
This blog entry is quite old. I just needed to read the Metastock quotations and convert it to other format. As there was very little information on the web about Metastock file format and MBF, I thought I would share this knowledge.<br />
As you&#8217;ve noticed, it&#8217;s just a starting point for reading metastock files, there are a lot of topics not covered here.</p>
<p>I&#8217;m impressed with the functionality you&#8217;ve added and I&#8217;m interested to see the details :) I&#8217;m also glad you want to share this with others. The best way I think is to put your source code on some public source code hosting server (like github). If you would simply like to update my project on github, I can grant to you the necessary privileges.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: narendra</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-7345</link>
		<dc:creator>narendra</dc:creator>
		<pubDate>Fri, 19 Feb 2010 11:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-7345</guid>
		<description>Not sure whether this is still active or not.

Just wanted to update on same topic that recently, I used some of your code to perform read and write operations on latest metastock format files.

developed in python, I used mbs2Ieee, float2date function of yours and developed reverse functions. Implemented writing and merging functionality as well. Its working fine.

I looked at your repository, not sure why the activity stopped. if anybody interested in extending it, i&#039;m ready to give my code.

My code performs read, write, merge oprations on Master, EMaster, XMaster and data files (DAT, MWD).

If anybody interested, mail to narendra.kamma at gmail dot com</description>
		<content:encoded><![CDATA[<p>Not sure whether this is still active or not.</p>
<p>Just wanted to update on same topic that recently, I used some of your code to perform read and write operations on latest metastock format files.</p>
<p>developed in python, I used mbs2Ieee, float2date function of yours and developed reverse functions. Implemented writing and merging functionality as well. Its working fine.</p>
<p>I looked at your repository, not sure why the activity stopped. if anybody interested in extending it, i&#8217;m ready to give my code.</p>
<p>My code performs read, write, merge oprations on Master, EMaster, XMaster and data files (DAT, MWD).</p>
<p>If anybody interested, mail to narendra.kamma at gmail dot com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lawrence</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-5572</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Tue, 01 Sep 2009 16:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-5572</guid>
		<description>Many thanks!  Great piece of work!</description>
		<content:encoded><![CDATA[<p>Many thanks!  Great piece of work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Fox</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-4205</link>
		<dc:creator>Christopher Fox</dc:creator>
		<pubDate>Tue, 30 Jun 2009 21:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-4205</guid>
		<description>This is a stunning piece of work. It doesn&#039;t just work for Metastock files, it works for CSIM files too. And he supplies the Python code too. Thank you. You saved me many, many hours.</description>
		<content:encoded><![CDATA[<p>This is a stunning piece of work. It doesn&#8217;t just work for Metastock files, it works for CSIM files too. And he supplies the Python code too. Thank you. You saved me many, many hours.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mech</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-40</link>
		<dc:creator>mech</dc:creator>
		<pubDate>Fri, 08 Aug 2008 19:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-40</guid>
		<description>sfx,

Doing the same thing in C# shouldn&#039;t be difficult. While writing my tool I was using the following Metastock datafile format description: http://www.purebytes.com/archives/metastock/2001/msg04890.html. I belive you can find the XMASTER file format description easily. The tricky part is to convert MBF bytes to float numbers. I found an article about it with ready-to-use C# code: http://www.boyet.com/Articles/MBFSinglePrecision.html. The rest of my code is very simple and I think you can rewrite it in C# with just minor modifications.</description>
		<content:encoded><![CDATA[<p>sfx,</p>
<p>Doing the same thing in C# shouldn&#8217;t be difficult. While writing my tool I was using the following Metastock datafile format description: <a href="http://www.purebytes.com/archives/metastock/2001/msg04890.html" rel="nofollow">http://www.purebytes.com/archives/metastock/2001/msg04890.html</a>. I belive you can find the XMASTER file format description easily. The tricky part is to convert MBF bytes to float numbers. I found an article about it with ready-to-use C# code: <a href="http://www.boyet.com/Articles/MBFSinglePrecision.html" rel="nofollow">http://www.boyet.com/Articles/MBFSinglePrecision.html</a>. The rest of my code is very simple and I think you can rewrite it in C# with just minor modifications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sfx</title>
		<link>http://themech.net/2008/08/reading-metastock-files/comment-page-1/#comment-38</link>
		<dc:creator>sfx</dc:creator>
		<pubDate>Thu, 07 Aug 2008 04:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://themech.net/?p=10#comment-38</guid>
		<description>Hello,

Great post!

I am wanting to do something similar in C#. Do you know how to convert your python methods to C# so that MASTER/XMASTER and .DAT/.MWD files can be read?</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Great post!</p>
<p>I am wanting to do something similar in C#. Do you know how to convert your python methods to C# so that MASTER/XMASTER and .DAT/.MWD files can be read?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
