[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PORTING TRADESTATION TO MATLAB



PureBytes Links

Trading Reference Links

there's going to be constraints:
first it a research combination platfrom and not
a real time trading platfrom.
this alone means that most of the work
between matlab is done based on historical data
and not on real time data.
you should be able to open a chart, load an
indicator that will open matlab, dump whatever data
you want to work with ( series or el vars ) into
matlab array and then you can work with it.
you make one call for data, you get it and then you
work with it in matlab and do whatever you want with
it. or you can send data from the TS part if you wanted
too. so the dll calls done once in you m function or
data dump done once in TS. the data part coded as
dll is basically the same as replacing reading csv file
but doing it faster... without doing write read...
the rest of the dll calles might be done dynamically
from TS on every bar if you want it, just like calling
any dll from TS. same thing.
sometimes you need to take ts series data, call
m function like fft for instance or some filter,
pass output back to TS and display it on TS chart
for visualization... i mean you can do that bar by bar
but it's slow if you do m functions.
i know that TS running in NT and win2000 releases
dll instance as soon as you disable the study that
you are calling the dll from. one dll instance is assigned
per study in the chart so you don't have to worry about it
on the TS side. it's handled for you.
on ML side you the only calls that you will be making there
are "get me some data" calls ( ML is client TS is data server ).

here is  the set of functions TS function calls:
- TSMLOpen  - opens matlab from TS
- TSMLClose
- TSMLPutArray
- TSMLGetArray
- TSMLGetVar
- TSMLPutVar
- TSMLEvalString - executes m function
- TSWriteMatFile
- TSReadMatFile

and the set of ML to TS calles
- MLTSGetData ( you gotta have the chart open to get the ticker you are
asking )

that's about all you need there.
i bet you half of it could be done with hashnumbs
already.
bilo.
ps. trying to use matlab in real time trading is no use because first off
it's slow, second you are asking for trouble using two platforms there,
third you don't need to. do you historical research in TS/ML then
compile your ML code in C++ and call it as a dll for real time trading.
the key in porting ML to TS is that it become fast complex prototyping /
reseach
INTERACTIVE platform.
by the way it has symbolic math toolbox ( so mathematica users don't have to
scream here).
also there is someone on the list or couple of people that
i heard coded the whole trading platfrom in matlab which is by the way
should be awesome.











----- Original Message -----
From: "Mark Jurik" <mark@xxxxxxxxxxxx>
To: "'Bilo Selhi'" <biloselhi@xxxxxxxxxxx>
Cc: <omega-list@xxxxxxxxxx>
Sent: Wednesday, April 11, 2001 3:13 PM
Subject: RE: PORTING TRADESTATION TO MATLAB


> This is an interesting concept.
>
> However, with DLLs, some one application
> has to "own" it, that is, the parent application
> is the one responsible for creating all the
> necessary DLL instantiations.  Our years
> or designing experience with making bulletproof
> DLLs for TradeStation/Supercharts, the issue
> of instantiation is a BIG one.
>
> Any commercial grade product must allow for
> ALL the following activites SIMULTANEOUSLY:
>
> ** real-time access to the DLL by numerous charts
> ** non-real-time access to the DLL for a hundred
>      charts
> ** access to the DLL for an optimization task
>
> With those constraints, how does one get MATLAB
> to perform "on demand" as each of a few hundred
> instantiated DLLs clamor for Matlab's attention?
>
> Regards,
> Mark Jurik
>
>
>
>
> ----------
> From: Bilo Selhi
> Sent: Wednesday, April 11, 2001 11:09 AM
> To: Bilo Selhi
> Cc: omega-list@xxxxxxxxxx
> Subject: Re: PORTING TRADESTATION TO MATLAB
>
> ok. porting matlab to ts is not too complicated.
> i reiterate that matlab or mathcad (s-plus ) are
> the best math/engineering platforms available.
> nothing can beat those now just as nothing can
> beat TS as far as system development.
> those who are concerned with high price of matlab...
> the student version ( same functionality ) is available
> for about 100 bucks. all toolboxes are mostly 50 bucks.
> in most cases it's all you need.
>
> now the porting part:
> it is basically a set of C++ dll functions that
> allow you to:
> - pass data from TS to Matlab or back
> - pass var from TS to Matlab and back
> - pass array ( matrix ) from Ts to Matlab and back
> - execute an m or mex function from TS on ML engine.
> that's all!!!
>
> you can dynamically pass data to ML and work with it
> interactively... in this case TS is simply a server and
> ML is a client.
> or
> you can execute an m function from TS by passing
> the function name and other agreements to ML engine.
>
> so it's just a series of dll calls that's all. there is no dde
> no com or no other complicated techniques required.
>
> if that's accomplished than there are virtually no
> limitations as far as the research you can do in TS/ML combination!!!
>
> to be able to accomplish that you need:
> - Matlab with API
> - Tradestation 2000i and it's SDK
> - C++ design tool such as visual studio or delphi
> - knowledge of C++ and DLL coding
> - knowledge of Tradestion ELtoolkit and SDK
> - about two weeks of casual coding, nothing too
> complicated.
>
> now, i've had this project on a backburner for a while
> but i would be willing to provide all of the above tools
> namely: Prosuite 2000i with permanent password, TS SDK,
> Matlab API, VC++ and interface specifications to the right individual
> who would be willing to work on that with me.
>
> on top of that you can then market the product to high end traders,
> market researchers
> and institutions if you want to and you have a chance of
> learning Matlab language which is very neat...
>
> if someone is interested, let me know.
> bilo.
> some of the toolboxes that matlab has are:
> - signal processing,
> - symbolic math,
> - financial ( time series, derivatives, datafeed )
> - excel link in real time.
> - control
> - neural nets.
> - GA
> - optimization
> - wavelets
> - garch/arch/ arima
> - a whole bunch of free toolboxes from users.
> - thousands of free functions and routines
> - filter design
> - fuzzy logic
> - spectral analysis
> - statistics
> - etc, etc...
>
>
>
>
>
>