[ts-gen] scripts to collect data into mysql database 2 of 2

R P Herrold herrold at owlriver.com
Fri Dec 28 16:26:20 EST 2007


And here is the second;  I am fairly confident that not more 
than a week's effort would be needed to get the shim going 
under Windows; some one may step forward, and so these 
breadcrumbs are left for them

-- Russ Herrold

---------- Forwarded message ----------
Date: Fri, 28 Dec 2007 16:20:02 -0500 (EST)
From: orcwcbe at owlriver.com
To: TWSAPI at yahoogroups.com
Subject: Re: scripts to collect data into mysql database

On Fri, 28 Dec 2007, buglefrank wrote:

>> Herrold:

>> minutes, and then used to pull second by second YM data 
>> around the last Fed meeting.  it inserted the results into 
>> the MySQL database which the shim uses.

>> Any and all IB supported timeframes are supported for the
>> 'binning'.

>> The trading shim is freely available under the GPL, v 3.

> These commnds are not in xp right. or i am really lost here?

These commands are not all native in Windows XP (some of them 
are), but _are_ freely available as an add on, just like, say, 
the Microsoft VB programming environment (actually NOT freely 
available), or the ActiveState perl and Python interpreters, 
and so forth.

> shim_071212]$ ( for i in `seq 10 16 `; do  \
> 	echo "past add 181 21 Ymd_T(20071212 $i:00:00);" ; \
>       sleep 20 ;  \
> 	echo "past add 181 21 Ymd_T(20071212 $i:30:00);" ; \
>       sleep 20 ;  \
> 	done ; \
>       echo "quit;" ) | ./shim --data logd

I spread the listing out for easier reading.  The 'backslash' 
line continuation is perhaps not needed, but harmless.  Let me 
run through the second part of a Windows port effort, to 
follow up on the first part I posted earlier today

This scriptlet would work under a Cygwin shell, assuming a 
binary shim can be compiled to run under Windows variants, as 
my longer email piece went through. The Cygwin project is a 
free (as in beer, and as in freedom) effort to bring all of 
the tools familiar to users of POSIX like operating 
environments, to the Microsoft product and aware of that 
environment:
    http://www.cygwin.com/
It is similar to Microsoft's addition of the 'WSH' windows 
shell (which is itself Korn shell derived and inspired ex. 
AT&T) a few years ago.

With the advent of the BSD and Linux Open Source operating 
system environment, many tools from the Free Software 
Foundation, and others, have been more widely available than 
back in the days of 'big iron' UNIX(tm).  One of the guiding 
principles of this effort is a recognition of a need to 
understand many operating system environments; this quote 
applies:
 	Those who do not understand Unix are condemned to
 	reinvent it, poorly. ~ Henry Spencer

As I am not interested in reinventing in solved problem 
spaces, (and particularly not doing so poorly) I choose to 
build upon and to use tools of others which are respectful of 
the capabilities of a 37 year old stable, tried, and true OS 
like the Unix line.

One of these tools is the 'bash' shell, whose current 
maintainer is at the Case Western Reserve University.  Like 
was possible in the old style DOS days the MS DOS 
'command.com' command interpreter, or another from say DR DOS, 
or IBM's PC DOS are available to provide (say in the case of 
PC DOS, addition of the REXX scripting language).  We would 
choose to set 'bash' as the Cygwin environment default command 
shell.

The 'for', 'do', 'done', and 'sleep' commands are all in the 
'bash' shell [and indeed a traditional /bin/sh shell set]; the 
'echo' command and 'pipe' ["|"] operator exist in Windows 
'cmd.exe' as well;  I don't know about the '(', ')' implicit 
sub-shell construct; only the ./shim binary is new.

The takeaway is clear -- take my earlier memo outline from 
today, invest the effort to build a 'shim' under Windows, and 
all will 'just work.' All it takes is an investment of time.

-- Russ Herrold


More information about the ts-general mailing list