Home All Groups Group Topic Archive Search About

FMLabs FMTKit functions

Author
15 May 2009 11:26 PM
Webbiz
Greetings!

Anyone here familiar with FMLabs and their FMTKit functions?

Just in case, here is the question:

The kit has some functions that lets you work with Metastock data. The
only function I can find that will let me look at what 'stocks' data
files are available in a directory is fmFILElist.

My problem is that it sends the info to a TEXT FILE, complete with
formatting (spaces, tabs, etc.).

In order to simply display a list of the available stock files in a
list box or grid or whatever, I would have to open this TEXT FILE and
parse through it to get the information into the application.

Am I missing something? I would think that a set of functions designed
for creating Stock Charting applications would have the means to load
this type of information directly into an array or something other
than writing to a text file.

TIA

Webbiz

Author
16 May 2009 12:58 AM
Larry Serflaten
"Webbiz" <nospam@forme.thanks.com> wrote

> My problem is that it sends the info to a TEXT FILE, complete with
> formatting (spaces, tabs, etc.).
>
> In order to simply display a list of the available stock files in a
> list box or grid or whatever, I would have to open this TEXT FILE and
> parse through it to get the information into the application.


If it was handed to you in an array, you'd have to parse the array to
fill a list, would you not?

Reading a disk file is not a bottleneck if done efficiently.  Remember that
Windows itself swaps pages of memory to and from the disk, on the fly.

Look at what you get in the file, and figure out what format you need it
in for best use by your application.  Then devise an efficient means to
transition between the two.

That does not necessarily mean you need to parse the file.  You may
be able to read the file directly to an array (depending on the format of
the file, etc...) if an array is what you need.

Once you decide what format would be best suited for your app, you
can tweak and optimize the transition code to increase performance there
IF IT NEEDS IT.  You may find, once you get things up and running,
it really isn't a cause for concern....

LFS
Author
16 May 2009 2:17 PM
Webbiz
On Fri, 15 May 2009 19:58:13 -0500, "Larry Serflaten"
<serfla***@usinternet.com> wrote:

Show quoteHide quote
>
>"Webbiz" <nospam@forme.thanks.com> wrote
>
>> My problem is that it sends the info to a TEXT FILE, complete with
>> formatting (spaces, tabs, etc.).
>>
>> In order to simply display a list of the available stock files in a
>> list box or grid or whatever, I would have to open this TEXT FILE and
>> parse through it to get the information into the application.
>
>
>If it was handed to you in an array, you'd have to parse the array to
>fill a list, would you not?
>
>Reading a disk file is not a bottleneck if done efficiently.  Remember that
>Windows itself swaps pages of memory to and from the disk, on the fly.
>
>Look at what you get in the file, and figure out what format you need it
>in for best use by your application.  Then devise an efficient means to
>transition between the two.
>
>That does not necessarily mean you need to parse the file.  You may
>be able to read the file directly to an array (depending on the format of
>the file, etc...) if an array is what you need.
>
>Once you decide what format would be best suited for your app, you
>can tweak and optimize the transition code to increase performance there
>IF IT NEEDS IT.  You may find, once you get things up and running,
>it really isn't a cause for concern....
>
>LFS
>


Hello Larry-

I have already created a function that 'parses' out the information
from the text file. The function returns an array with each item
(word) from the file.

While this will certainly work, it just seems to be an inefficient way
to deal with this. It becomes the task of identifying each array
element and deciding whether or not it is the information needed.

A more efficient way would be to pass an array of type struc and let
the function fill in the appropriate struc elements. This way, one
need only loop through the array for specific elements needed.

The code that OLAF wrote up in his Metastock demo does something like
this. (the only issue is the date conversion routine and dates going
back before 1950). I may have to use it, but since I was thinking
about using the FMTKit routines for all the other functions of
creating charts, indicators, etc., that I might as well use the
dataload functions as well. Thing is, I just think this 'text file'
approach is a bit rickity and was hoping that perhaps this kit also
provided a way to just fill in an array struc. That's the reason for
the original post.

Thanks for your feedback!

Cheers!

Webbiz
Author
16 May 2009 3:21 PM
Schmidt
"Webbiz" <nospam@forme.thanks.com> schrieb im Newsbeitrag
news:08it05l85bhd264ln87trrdskrdo9t9sr4@4ax.com...

> The code that OLAF wrote up in his Metastock demo does
> something like this.
Ah, so you mean you need only a way, to parse out the
data from the Master-File in such a metastock-folder?

Then yes - this routine is already there in my Demo (though
not creating an Array, but instead filling the "masterfile-parsed-
data" into a small "master-table" in that InMemory-DB.
Should be easy to adjust to your (array-)needs IMO.

> (the only issue is the date conversion routine and dates
> going back before 1950).
Thought I had fixed that already - did you try the latest
version (from the same download-link)?
This version (according to my last post in the database-group)
should not only import ca. factor 4.5 faster - it also contains
another fix for the date-conversion-routine, which does not do
a switch anymore at something like a "shift-year 50".
The new routine now is doing pure math now - and should be
able to convert the years correctly into the range 1910- 2099,
directly from the vb6Single-Type which is passed as a
parameter (since in case of years located in the 2000-range,
this Single-Parameter is always larger than 1000000).
Let me know, if this routine is not doing the right thing now
(I don't have your larger MetaStock-Testset here).

> I may have to use it, but since I was thinking about using
> the FMTKit routines for all the other functions of
> creating charts, indicators, etc., that I might as well use the
> dataload functions as well. Thing is, I just think this 'text file'
> approach is a bit rickity and was hoping that perhaps this kit also
> provided a way to just fill in an array struc. That's the reason for
> the original post.
Then simply ripp-off my MasterFile-parsing routine - if that is
the only functionality you want to use or replace with regards to
the FMTKit (in case FMTKit offers only the TextFile-workaround
for masterfile-parsing there).

Olaf
Author
16 May 2009 3:25 PM
Schmidt
"Schmidt" <s**@online.de> schrieb im Newsbeitrag
news:uXRCNuj1JHA.1716@TK2MSFTNGP03.phx.gbl...

> Thought I had fixed that already - did you try the latest
> version (from the same download-link)?
Oops, just saw your reply in the database-group - apparently
you already noticed that.

Olaf
Author
16 May 2009 11:44 PM
Webbiz
Show quote Hide quote
On Sat, 16 May 2009 17:21:35 +0200, "Schmidt" <s**@online.de> wrote:

>
>"Webbiz" <nospam@forme.thanks.com> schrieb im Newsbeitrag
>news:08it05l85bhd264ln87trrdskrdo9t9sr4@4ax.com...
>
>> The code that OLAF wrote up in his Metastock demo does
>> something like this.
>Ah, so you mean you need only a way, to parse out the
>data from the Master-File in such a metastock-folder?
>
>Then yes - this routine is already there in my Demo (though
>not creating an Array, but instead filling the "masterfile-parsed-
>data" into a small "master-table" in that InMemory-DB.
>Should be easy to adjust to your (array-)needs IMO.
<snip>
>Thought I had fixed that already - did you try the latest
>version (from the same download-link)?

Yes. But I had yet to work with it since the last download. Playing
with it now though. :-)

<more snip>

Show quoteHide quote
>
>> I may have to use it, but since I was thinking about using
>> the FMTKit routines for all the other functions of
>> creating charts, indicators, etc., that I might as well use the
>> dataload functions as well. Thing is, I just think this 'text file'
>> approach is a bit rickity and was hoping that perhaps this kit also
>> provided a way to just fill in an array struc. That's the reason for
>> the original post.
>Then simply ripp-off my MasterFile-parsing routine - if that is
>the only functionality you want to use or replace with regards to
>the FMTKit (in case FMTKit offers only the TextFile-workaround
>for masterfile-parsing there).
>
>Olaf
>

Oh, it's not the only thing I need from that demo code. In fact, the
whole DB thing is what I need along with the Metastock code. However,
I want to create my own STOCK LIST where the user can select what
stock to load rather than having that info go directly to the data
grid as it does now. In other words, I want something that I can STRIP
(or ripp-off as you say) to use in other projects where Metastock is
used but no database. Therefore, I'm trying to put together the least
amount of code in a module that I can easily add to ANY future project
that just does one thing...loads in Metastock data. So you might say I
have more than one thing going on right now.

My main project already loads Metastock. You may recall that I am
working on being able to grab years x to x and compare days y to y,
etc and that it was suggested I go the database route. So that is what
led into this DB thing and my looking at your wrapper code, etc.

The Metastock code you wrote seems to have less baggage than the other
approaches with more flexibility. So my interest (ripping-off) that
part of the demo to replace what I currently use in my projects.

Not sure if I made much sense. Hope so.

Thanks!

Webbiz