TS MATLAB Link Dll for TradeStation

TS MATLAB Link Dll spreads standard of trading industry - trading platform TradeStation to standard of engineering and scientific calculations of MATLAB.
As a result of combining these two powerful programs we get unbeatable advantage in complex mathematical calculations, simplicity, speed and accuracy of analysis, visualization on a level of scientific graphics and programming on scientific language that needs only to mathematical statement of a problem.
|How to Buy|
Ask here|
F.A.Q.|
Online Help|
Forum discuss|
It is easy to use TS MATLAB Link Dll. A user can use commands and functions of MATLAB in a EasyLanguage code directly.
TradeStation together with MATLAB now can effectively solve problems in the following fields:
-mathematics and calculations;
-algorithm development;
-modeling;
-scientific and engineering graphics;
-development of any complex trading systems based on brand new scientific methods.
Used with MATLAB, TradeStation becomes an interactive system, which general object array doesn’t require size setting. This helps to perform calculations of vector based tasks, cutting time that would be necessary to spend for programming in C or FORTRAN.
TS MATLAB Link Dll provides operating environment, programming language and trading platform in the same time. One of the biggest advantages of this system is that you can use specialized functions and programs of MATLAB or write it by yourself. These functions are formed as specialized files (M-files). It's possible to create a set of programs to solve certain tasks or problem in trading.
As a matter of fact TS MATLAB Link Dll is more than just a set of functions that are built into MATLAB. Using MATLAB in TradeStation you can exploit any science discoveries and results from all around the world that can be practically used in trading: control theory, digital signal processing, system identification etc.
List of functions executed by TS MATLAB Link Dll
|
|
TS MATLAB Link Dll
|
|
Initialize and open MATLAB Command Window from TradeStation
|
Yes
|
|
Send commands from TradeStation to MATLAB
|
Yes
|
|
Send data from TradeStation to MATLAB
|
Yes
|
|
Receive and process data in TradeStation from MATLAB
|
Yes
|
|
Simultaneous data sending to MATLAB and reading data from MATLAB
|
Yes
|
|
Number of available MATLAB commands for transferring
|
Not Limited
|
|
Number of received data from MATLAB
|
Not Limited
|
|
Type of receiving data |
Float (Numeric) |
|
Works on Line
|
Yes
|
Description of function calling in TS MATLAB Link Dll
It's necessary to have a specialized library tsmatlablink.dll to work with the TS MATLAB Link Dll program. tsmatlablink.dll should be placed in the Windows (System32) system directory. For example, if you have system drive «Ñ:\» and operating system Windows XP, then the path should be: «C:\WINDOWS\system32».
To work with TS MATLAB Link Dll in TradeStation environment the EasyLanguage function TS.MATLAB.LINK. should be used. This function uses tsmatlablink.dll to send commands from TradeStation to MATLAB and receive data back as Float (numeric) values. Set the code of EasyLanguage function:
if currentbar = 1 then begin
Value1 = TS.MATLAB.LINK("A = ["+ NumToStr(C,4)+"
]");
{create array A to
MATLAB and add value}
This function sends a text line that should contain data and any MATLAB command or a command only. The function returns the data that MATLAB has calculated in numeric format Float (numeric).
Example of usage.
First of all, you should call TS.MATLAB.LINK on the first bar and send any command to MATLAB. This may be, for example, the command which creates an «empty» array. It opens MATLAB Command Window. Here is an example of calling TS.MATLAB.LINK at the first bar in the EasyLanguage code:
if currentbar = 1 then begin
Value1 = TS.MATLAB.LINK("A = ["+ NumToStr(C,4)+"
]");
{create array A to
MATLAB and add value}
The function «TS.MATLAB.LINK» opens the MATLAB Command Window at the first bar and creates «A» array. In other words, calling this function will pass the string "A = ["+ NumToStr(C,4)+" ]" directly into the MATLAB Command Window. It is identical to the following command (let 28.66 is the Close price on the first bar): A=[28.66]
Let we want to calculate a moving average of fixed length in TradeStation using the MATLAB built-in formula. For calculation it in MATLAB it's necessary to:
1. create a MATLAB array ;
2. send a Close value on every bar to this array, in a way that the values are stored until the length holds;
3. displace the array to the right for new incoming data;
4. apply a MATLAB function mean to the array;
5. send obtained values back from MATLAB to TradStation.
Example in EasyLanguage
Input: Length(21);
Vars: MA(0);
{create array A and add value}
if currentbar = 1 then begin
Value1 = TS.MATLAB.LINK("A = ["+
NumToStr(C,4)+" ]");
end else begin
{add next value to array}
Value1=TS.MATLAB.LINK("A=[A "+
NumToStr(C,4) +" ]");
if currentbar > Length then
{if array > our periods (length) then delete first element from array}
Value1=TS.MATLAB.LINK("A(1)=[]");
{calculating mean}
MA=TS.MATLAB.LINK("mean(A)");
end;
Plot1(MA, "Mean");
Important notice!
Values of TradeStation need to be converted to string, for example using EasyLanguage function «NumToStr»», right before exporting to MATLAB.
Other commands of MATLAB are executed in the same way.
|How to Buy|
Ask here|
F.A.Q.|
Online Help|
Forum discuss|
Copyright © TS Research Group 2002, e-mail: info@tsresearchgroup.com. Developed by webdesign.tria.lv |