support.tsresearchgroup.com Forum Index

TSResearch | Software Products | Online Help | Free Download | Publications | Research

Username:   Password:   
Log me on automatically each visit
 

FAQ |  Search |  Memberlist |  Usergroups |  Profile |  Log in to check your private messages  Register |  Log in 

TS Excel Link's using example

 
Post new topic   Reply to topic    support.tsresearchgroup.com Forum Index -> TS Link
View previous topic :: View next topic  
Author Message
VladGor
Support Team


Joined: 26 Jan 2004
Posts: 528

PostPosted: Sat May 28, 2005 3:24 pm    Post subject: TS Excel Link's using example Reply with quote

http://download.tsresearchgroup.com/all/tslink/TSEXCELLINK.ELA


EasyLanguage:
 
{******************************************************************* 
Name: TS.Link.LOGTRADE 
Analysis Type: System 
Description : Example System for TS Link DLL 
Used: tslink.dll 
Provided By : Trade Smart Research (c) Copyright 2001 - 2005  
              www.tsresearchgroup.com 
********************************************************************}
 
 
Inputs
    SetSheet(1), 
    SetBeginRow(2), 
    SetColum(2), 
    ExcelFileName("TSLinkExample.xls"), 
    ExcelFilePath("C:\Program Files\TradeSmart\TS Link\TSLinkExample.xls"); 
 
Var: StartValue(0), BeginRow(0), SetValue(0),StrName(""),Num(100), Flag1(0), Flag2(0); 
 
{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"int"TS_SetString",lpstr,int,int,int,int{text,sheet number, row, column, spleep milisekonds} 
 
if currentbar = 1 then begin 
    StartValue = TS_StartExcel(ExcelFileName,ExcelFilePath); 
    BeginRow = SetBeginRow; 
end
 
{Call Dll and send to it of the value } 
 
If MarketPosition =1 And Flag1 = 1 Then Begin 
    StrName = "Buy"
    TS_SetString(StrName,SetSheet,BeginRow,SetColum+1,10); 
    SetValue = TS_SetValue(EntryDate(0),SetSheet,BeginRow,SetColum+2,10);  
    SetValue = TS_SetValue(EntryTime(0),SetSheet,BeginRow,SetColum+3,10); 
    StrName = "Long Entry"
    TS_SetString(StrName,SetSheet,BeginRow,SetColum+4,10); 
    SetValue = TS_SetValue(EntryPrice(0),SetSheet,BeginRow,SetColum+5,10); 
    SetValue = TS_SetValue(CurrentShares,SetSheet,BeginRow,SetColum+6,10); 
    SetValue = TS_SetValue(NetProfit,SetSheet,BeginRow,SetColum+7,10); 
    BeginRow = BeginRow +1; 
    Flag1 = 0; 
End
 
If MarketPosition = 0 and Close > Open Then Begin 
    Buy Num Shares This Bar on Close
    Flag1 = 1; 
End
 
 
If MarketPosition =0 And Flag2 = 1 Then Begin 
    SetValue = TS_SetValue(TotalTrades,SetSheet,BeginRow,SetColum,10); 
    StrName = "Sell"
    TS_SetString(StrName,SetSheet,BeginRow,SetColum+1,10); 
    SetValue = TS_SetValue(ExitDate(1),SetSheet,BeginRow,SetColum+2,10);  
    SetValue = TS_SetValue(ExitTime(1),SetSheet,BeginRow,SetColum+3,10); 
    StrName = "Exit Long"
    TS_SetString(StrName,SetSheet,BeginRow,SetColum+4,10); 
    SetValue = TS_SetValue(ExitPrice(1),SetSheet,BeginRow,SetColum+5,10); 
    SetValue = TS_SetValue(PositionProfit(1),SetSheet,BeginRow,SetColum+6,10); 
    SetValue = TS_SetValue(NetProfit,SetSheet,BeginRow,SetColum+7,10); 
    BeginRow = BeginRow +1; 
    Flag2 = 0; 
End
 
If MarketPosition = 1 and Close < Open Then Begin 
    Sell Num Shares This Bar on Close
    Flag2 = 1; 
End
 
{***** 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. *****}
 



EasyLanguage:
 
{******************************************************************* 
Name: TS.Link.OHLCV 
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
    SetSheet(1), 
    SetBeginRow(1), 
    SetColum(2), 
    ExcelFileName("TSLinkExample.xls"), 
    ExcelFilePath("C:\Program Files\TradeSmart\TS Link\TSLinkExample.xls"); 
 
Var: StartValue(0), SetValue(0), SetOpen(0), SetHigh(0), SetLow(0), SetClose(0), SetVolume(0); 
 
SetOpen = Open
SetHigh = High
SetLow = Low;  
SetClose = Close
SetVolume = Volume
 
 
{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} 
 
if currentbar = 1 then begin 
    StartValue = TS_StartExcel(ExcelFileName,ExcelFilePath); 
end
 
{Call Dll and send to it of the value OHLCV} 
If LastBarOnchart Then begin 
 
SetValue = TS_SetValue(SetOpen,SetSheet,SetBeginRow,SetColum,10); {10 miliseconds sleep} 
SetValue = TS_SetValue(SetHigh,SetSheet,SetBeginRow+1,SetColum,10); 
SetValue = TS_SetValue(SetLow,SetSheet,SetBeginRow+2,SetColum,10); 
SetValue = TS_SetValue(SetClose,SetSheet,SetBeginRow+3,SetColum,10); 
SetValue = TS_SetValue(SetVolume,SetSheet,SetBeginRow+4,SetColum,10); 
 
End
 
Plot1(SetClose, "Close");  
 
 
{***** 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. *****}
 



EasyLanguage:
 
{******************************************************************* 
Name: TS.Link.QuoteFields 
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
    SetSheet(1), 
    SetBeginRow(1), 
    SetColum(2), 
    ExcelFileName("TSLinkExample.xls"), 
    ExcelFilePath("C:\Program Files\TradeSmart\TS Link\TSLinkExample.xls"); 
 
Var: StartValue(0), SetValue(0), SetSymbolName(""), SetAsk(0), SetAskSize(0),  
     SetBid(0), SetBidSize(0), SetLast(0), SetTradeVolume(0), SetTimeLastTrade(0) ; 
 
SetSymbolName = SymbolName
SetAsk = q_Ask
SetAskSize = q_AskSize
SetBid = q_Bid;  
SetBidSize = q_BidSize
SetLast = q_Last
SetTradeVolume = q_TradeVolume
SetTimeLastTrade = q_TimeLastTrade; 
 
 
{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"int"TS_SetString",lpstr,int,int,int,int{text,sheet number, row, column, spleep milisekonds} 
 
 
if currentbar = 1 then begin 
    StartValue = TS_StartExcel(ExcelFileName,ExcelFilePath); 
end
 
{Call Dll and send to it of the value OHLCV} 
If LastBarOnchart Then begin 
 
SetValue = TS_SetString(SetSymbolName,SetSheet,SetBeginRow,SetColum,10); 
SetValue = TS_SetValue(SetAsk,SetSheet,SetBeginRow+1,SetColum,10); {10 miliseconds sleep} 
SetValue = TS_SetValue(SetAskSize,SetSheet,SetBeginRow+2,SetColum,10); 
SetValue = TS_SetValue(SetBid,SetSheet,SetBeginRow+3,SetColum,10); 
SetValue = TS_SetValue(SetBidSize,SetSheet,SetBeginRow+4,SetColum,10); 
SetValue = TS_SetValue(SetLast,SetSheet,SetBeginRow+5,SetColum,10); 
SetValue = TS_SetValue(SetTradeVolume,SetSheet,SetBeginRow+6,SetColum,10); 
SetValue = TS_SetValue(SetTimeLastTrade,SetSheet,SetBeginRow+7,SetColum,10); 
 
 
End
 
Plot1((SetAsk+SetBid)*0.5, "Middle");  
 
 
{***** 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. *****}
 
 



EasyLanguage:
 
{*************************************************************************************** 
Name: TS.LINK.RADAR 
Analysis Type: Indicator  
Used: TSLINK.dll 
Description: Export Data from RadarScreen to Excel 
Provided By: Trade Smart Research (c) Copyright 2001 - 2005 www.tsresearch.com 
Inputs
    Row - The row number in RadarScreen. 
***********************************************************************}
 
 
Input:    Row(2); 
Vars:    TFrame(""); 
 
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 miliseconds} 
defineDLLFunc"tslink.dll"float"TS_GetValue",  int,int,int,int{sheet number,row, column, spleep miliseconds} 
defineDLLFunc"tslink.dll"int,   "TS_SetString"lpstr,int,int,int,int{text,sheet number, row, column, spleep miliseconds} 
defineDLLFunc"tslink.dll"lpstr"TS_GetString"int,int,int,int{sheet number, row, column, spleep miliseconds} 
 
TS_StartExcel("Radar.xls","C:\Omega\Radar.xls"); 
 
if CurrentBar = 1 then  
Begin 
    If DataCompression = 1 then TFrame = NumToStr(BarInterval,0) + " Min"
    if DataCompression = 2 then TFrame = "Daily";  
    if DataCompression = 3 then TFrame = "Weekly"
    if DataCompression = 4 then TFrame = "Monthly"
    if DataCompression = 5 then TFrame = "P&F"
    if DataCompression = 0 then TFrame = NumToStr(BarInterval,0) + " Tick"
    TS_SetString(GetSymbolName,1,Row,1,0); 
    TS_SetString(TFrame,       1,Row,2,0); 
end
 
TS_SetValue(H,1,Row,3,0); 
TS_SetValue(L,1,Row,4,0); 
TS_SetValue(O,1,Row,5,0); 
TS_SetValue(C,1,Row,6,0); 
 
Plot1(C,"Excel"); 
 
{***** 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. *****}
 



EasyLanguage:
 
{******************************************************************* 
Name: TS.Link.SETDATA 
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
    SetData1(GetSymbolName), {String value} 
    SetData2(Date), 
    SetData3(Time), 
    SetData4(High-Low), 
    SetData5(Volume), 
    SetSheet(1), 
    SetBeginRow(1), 
    SetColum(2), 
    ExcelFileName("TSLinkExample.xls"), 
    ExcelFilePath("C:\Program Files\TradeSmart\TS Link\TSLinkExample.xls"); 
 
Var: StartValue(0), SetRow(0); 
 
{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"int"TS_SetString",lpstr,int,int,int,int{text,sheet number, row, column, spleep milisekonds} 
 
{Start Excel} 
if currentbar = 1 then begin 
    StartValue = TS_StartExcel(ExcelFileName,ExcelFilePath); 
end
 
{Call Dll and send to it of the value, 10 miliseconds sleep} 
SetRow = SetBeginRow; 
SetRow = SetRow[1] + 1; 
TS_SetString(SetData1,SetSheet,SetRow,SetColum,0); {Set String value} 
TS_SetValue(SetData2,SetSheet,SetRow,SetColum+1,10); 
TS_SetValue(SetData3,SetSheet,SetRow,SetColum+2,10); 
TS_SetValue(SetData4,SetSheet,SetRow,SetColum+3,10); 
TS_SetValue(SetData5,SetSheet,SetRow,SetColum+4,10); 
 
 
Plot1(SetData4, "SetData4");  
 
 
{***** 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. *****}
 



EasyLanguage:
 
{******************************************************************* 
Name: TS.Link.ReadData 
Analysis Type: Indicator 
Description : Example Indicator of geting data from Excel from different cells for TS Link DLL 
Used: tslink.dll 
Provided By : Trade Smart Research (c) Copyright 2001 - 2005  
              www.tsresearchgroup.com 
********************************************************************}
 
 
Inputs
    GetSheet(1), 
    GetColum(2), 
    ExcelFileName("TSLinkExampleReadData.xls"), 
    ExcelFilePath("C:\Program Files\TradeSmart\TS Link\TSLinkExampleReadData.xls"); 
Var: StartValue(0),GetValue(0), GetRow(0); 
 
{Declaration functions} 
defineDLLFunc"tslink.dll"int"TS_StartExcel",LPSTR,LPSTR{initalisation excel file 1 - Short BookName, 2 - full path bookname} 
defineDLLFunc"tslink.dll"float"TS_GetValue",int,int,int,int{sheet number,row, column, spleep milisekonds} 
 
if currentbar = 1 then begin 
    StartValue = TS_StartExcel(ExcelFileName,ExcelFilePath); 
end
 
GetRow = GetRow[1] +1; 
 
{Call Dll and receive to it of the value} 
 
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. *****}
 



EasyLanguage:
 
{******************************************************************* 
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. *****}
 
 


http://www.tsresearch.com/software/ts_solutions/excel_link/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    support.tsresearchgroup.com Forum Index -> TS Link All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright © TS Research Group

Powered by phpBB © 2001, 2002 phpBB Group

Developed by: webdesign.tria.lv