TradeStation Forum - Step-by-Step Guide To Creating A TS-Compatible DLL
TradeStation Forum - Step-by-Step Guide To Creating A TS-Compatible DLL
TradeStation Community Developer Center Institutional Services Call Tradestation 800.822.0512 Client Center LogOff
TradeStation Wiki | Most Recent Forum Posts | My Forum Subscriptions | Forum Help | Quick Forum Search Go | Advanced Forum Search
Home > All Forums > TradeStation and EasyLanguage Support >
EasyLanguage > EasyLanguage-DLL > Step-by-Step Guide to Creating a TS-Compatible DLL
3 Pages 1 2 3
Next Page
Author Topic
Mathemagician
Posted - 08/18/2012 21:02:35
10090 Posts This is a step by step guide to creating a DLL that can be called from TS. It's something I would have found useful but
doesn't exist, so here goes...
If you don't have Visual C++ 2010 Express, you can get it for free from here: http://www.microsoft.com/visualstudio/en-
us/products/2010-editions/express
Next we add a C++ file to our project, which will contain our functions:
Right-click "Source Files", select Add, select New Item, select C++ File. Name the file "TestDLL.cpp" and click Add.
Now we add a simple test function that will just add 1 to whatever number you send it:
Put this in the TestDLL.cpp file you just created:
select all
Next, we add a DEF file to our project so that Visual Studio knows which files we want to make available
outside the DLL:
Right-click "Source Files", select Add, select New Item, select C++ File. Name the file "TestDLL.def" and click Add.
Put this in the TestDLL.def file you just created:
LIBRARY TestDLL
EXPORTS
TestFunction
select all
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=122154&SearchTerm=SDK&txtExactMatch= 1/4
29/10/24, 15:23 TradeStation Forum - Step-by-Step Guide to Creating a TS-Compatible DLL
Click the Project/TestDLL Properties menu item.
Select All Configurations from the dropdown list at the top left of the Properties window.
Within the project properties, go to Linker/Input. (You may need to check the Show All Settings box.)
Type TestDLL.def into the Module Definition File property.
Click OK.
For now, we should use the Release configuration so that our DLL can run on any machine:
On the Visual Studio toolbar, change the active configuration from Debug to Release.
Our DLL is ready to use! Let's put it where TS can find it:
Go to the project's Release output directory (something/Visual Studio 2010/Projects/TestProject/Release).
Copy the TestDLL.dll file to the Tradestation Program directory.
plot1(TestFunction(1));
select all
Congratulations! The DLL you just created should run on any PC, not just the one that you built it on. Hopefully,
you can take it from there!
4trading
Posted - 08/18/2012 22:03:39
QiWeed
Posted - 08/18/2012 22:58:23
Mathemagician
Posted - 08/18/2012 23:01:12
10090 Posts Here's how to create a COM wrapper using C++ that will let you access a .NET DLL written in C#:
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=122156
campysteve
Posted - 08/19/2012 13:17:42
pinetree
Posted - 08/19/2012 15:56:00
261 Posts Good job, now I have to figure out C#. I have at least 4 books on it, so time to get past the first chapters building a form!!
Thanks Math
Tom47
Posted - 08/19/2012 17:47:09
18790 Posts This is the kind of guide that non programmers or wannabe programmers like me really need. Thanks for going to the
trouble. I'd be interested in knowing how long it took you to do this.
Mathemagician
Posted - 08/19/2012 18:12:45
10090 Posts
quote:
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=122154&SearchTerm=SDK&txtExactMatch= 2/4
29/10/24, 15:23 TradeStation Forum - Step-by-Step Guide to Creating a TS-Compatible DLL
Putting both of these together took just about the whole bottle of wine.
Tom47
Posted - 08/19/2012 18:39:27
18790 Posts
quote:
quote:
Putting both of these together took just about the whole bottle of wine.
Honza K.
Posted - 08/20/2012 04:01:26
2523 Posts Great addition Math, many thanks for your effort!
drjohn
Posted - 08/21/2012 12:48:12
48 Posts If any of you could recommend an instructional book to learn the C languages for someone who knows EasyLanguage what
would it be?
Mathemagician
Posted - 08/21/2012 13:44:01
Hilotrader
Posted - 11/24/2012 07:16:58
53 Posts Hello
I did all this as described - but got :
Cannot find function TestFunction in DLL file Test.DLL.dll
Did I miss sth.?
Kind regs
Jojo
Mathemagician
Posted - 11/24/2012 09:32:11
10090 Posts That's most likely the DEF file. Make sure you've done all of those steps.
Surrey_Lad
Posted - 11/24/2012 09:53:52
60 Posts Excellent introduction to the subject - enabling others to go that one step further
Hilotrader
Posted - 11/25/2012 10:44:59
53 Posts Did everything again - deleted everything and did again - after compiling the release got error
the programm"C\.....\Release\TestDLL.dll" cannot be started .Had a look again to
TestDLL.def in the Module Definition File property and it has disappeared ????
Tried several times with click ok only other times with take over and then ok ,
but same result very strange
Mathemagician
Posted - 11/25/2012 10:48:16
10090 Posts When changing settings make sure All Configurations is selected at the top of that form. Otherwise, you might be changing
settings for only the Debug configuration.
Hilotrader
Posted - 11/25/2012 11:21:50
LongScalper
Posted - 11/25/2012 11:21:51
1454 Posts What are some practical uses for this kind of programming? Thanks...
Hilotrader
Posted - 11/25/2012 11:24:14
53 Posts
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=122154&SearchTerm=SDK&txtExactMatch= 3/4
29/10/24, 15:23 TradeStation Forum - Step-by-Step Guide to Creating a TS-Compatible DLL
1454 Posts gotcha Hilo... I understand the language capabilities exceed that of TS but maybe expand on that a bit.
Not looking for anything proprietary, guess my analytical universe needs to be widened some.
What practical results/answers do you arrive at with the more extensive calculations. Is it for
more detailed auto trading features or for trading pattern discovery or both or something else?
Hilotrader
Posted - 11/25/2012 11:51:46
53 Posts I'm sorry - just started with this Dll stuff - was always ahead of my mind - but with this genious
explanations of Mathemagician - Thank you here
Hilotrader
Posted - 12/15/2012 09:56:49
53 Posts Is it possible for what reason ever , that this stuff is not working with Win7?
I can not imagine why such a simple dll is always returning
"Cannot find function TestFunction in DLL file Test.DLL.dll "
this happened several times even when testing other dll's from the forum.
Maybe you can help me out there.
theHook
Posted - 12/15/2012 10:10:18
7019 Posts Hilotrader, Where did you store the DLL? Is your system a 64 bit or 32 bit system?
Hilotrader
Posted - 12/15/2012 10:21:58
with ""
oh whao but answering the question - 64 bit
theHook
Posted - 12/15/2012 10:45:03
7019 Posts Where did you put the DLL, SysWow64 or in the TradeStation Program subfolder? If it is working, Great!
Next Page
3 Pages 1 2 3
Quick Reply
Message:
All support, education and training services and materials on the TradeStation Securities Web site are for informational purposes and to help customers learn more about how to use the power of
TradeStation software and services. No type of trading or investment advice or strategy is being made, given or in any manner provided by TradeStation Securities or its affiliates.
TradeStation Securities, Inc. and TradeStation Technologies, Inc. are each wholly owned subsidiaries of TradeStation Group, Inc., all operating, and providing products and services, under the
TradeStation brand and trademark. When applying for, or purchasing, accounts, subscriptions, products and services, it is important that you know which company you will be dealing
with. Please click here for further important information explaining what this means.
TradeStation.com Discussion
This page was generated in 3.67 seconds.
2003-2024 TradeStation.com.
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=122154&SearchTerm=SDK&txtExactMatch= 4/4