{******************************************************************* Name: TS.Link.Example Analysis Type: Indicator Description : Example Indicator for TS Link DLL Used: tslink.dll Provided By : Trade Smart Research (c) Copyright 2001 - 2005 www.tsresearchgroup.com ********************************************************************} Inputs: Price(close), SetSheet(1), SetRow(3), SetColum(2), GetSheet(1), GetRow(4), GetColum(2), MyIndicatorName("MyIndicator1"), ExcelFileName("TSLinkExample.xls"), ExcelFilePath("C:\Program Files\TradeSmart\TS Link\TSLinkExample.xls"); 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 + " " + MyIndicatorName + " " + Str1+" "; StartValue = TS_StartExcel(ExcelFileName,ExcelFilePath); 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"); {***** Copyright (c) 2001-2005 Trade Smart Research, Ltd. All rights reserved. www.tsresearchgroup.com ***** ***** Trade Smart Research reserves the right to modify or overwrite this analysis technique with each release. *****}
|