{*******************************************************************
Description : Trade Smart Research Link DLL for TradeStation (Omega Research)
Used: tslink.dll
Provided By : Trade Smart Research Group (c) Copyright 2001 - 2002
www.tsresearchgroup.com
********************************************************************}
Inputs: Price(close),SetSheet(1),SetRow(3),SetColum(2),GetSheet(1),GetRow(4),GetColum(2);
Var: StartValue(0),SetValue(0), GetValue(0), StrName(""),Str1("");
{Declaration functions}
defineDLLFunc: "tslink.dll", int, "TS_StartExcel",LPSTR,LPSTR; {initalisation excel file 1 - Short BookName, 2 - full path bookname}
defineDLLFunc: "tslink.dll", int, "TS_SetValue",float,int,int,int,int; {value,sheet number, row, column, spleep milisekonds}
defineDLLFunc: "tslink.dll", float, "TS_GetValue",int,int,int,int; {sheet number,row, column, spleep milisekonds}
defineDLLFunc: "tslink.dll", int, "TS_SetString",lpstr,int,int,int,int; {text,sheet number, row, column, spleep milisekonds}
defineDLLFunc: "tslink.dll", lpstr, "TS_GetString",int,int,int,int; {sheet number, row, column, spleep milisekonds}
if currentbar = 1 then begin
If DataCompression = 1 then Str1 = NumToStr(barinterval,0) + "Min";
if DataCompression = 2 then Str1 = "Daily";
if DataCompression = 3 then Str1 = "Weekly";
if DataCompression = 4 then Str1 = "Monthly";
if DataCompression = 5 then Str1 = "P&F";
if DataCompression = 0 then Str1 = NumToStr(barinterval,0) + " " + "Tick";
StrName =GetSymbolName + " " + GetStrategyName + " " + Str1+" ";
StartValue = TS_StartExcel("TSLinkDemo.xls","C:\Program Files\TS Link\TSLinkDemo.xls");
TS_SetString(StrName,SetSheet,1,2,0);
end;
{Call Dll and send and receive to it of the value}
SetValue = TS_SetValue(Price,SetSheet,SetRow,SetColum,0);
GetValue = TS_GetValue(GetSheet,GetRow,GetColum,0);
Plot1(GetValue, "Value");