Global Variables

Discuss, post your questions about TWSLink here.

Users who just registered, please write an email to
forum@trade-commander.de
with your username mentioned.
So we can distinguish you from bots.
Thank you
Post Reply
ke45
Posts: 4
Joined: Wed Apr 26, 2017 9:37 pm

Global Variables

Post by ke45 »

I am new to Twslink an I am wondering if it is possible to use the global variable calls (e.g. SET_DBL_VAR and GET_DBL_VAR) to send Data from TradeStation (32 Bit) to MultiCharts (64 Bit) and back? And if possible, what are the requirements to do this? Do I need a TWS running to use the global variables?

Second question, what is the lifetime for a global Variable?

Thank you!
-Klaus

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: Global Variables

Post by board_admin »

Hello,
i am sorry, global variables don't exist across processes.
They just exist within process.

(32 bit processes run in a virtual windows (syswow64). This windows can't see its host, the 64 bit windows.)

To share variables across processes (in the same platform), you could save them to file as string. The load from file as string and convert
into your type.

You could use TWSLink functions TO_FILE,FROM_FILE for this.

ke45
Posts: 4
Joined: Wed Apr 26, 2017 9:37 pm

Re: Global Variables

Post by ke45 »

Thank you for the quick answer! Well, that's bad and without "real gloabal" variables Tswlink lacks an important feature, I think? Of course it is possible to use files to exchange some information, but this is slow and not the interface I expect.

About 10 years ago there was a product called "Dynaorder" with similar functionality than Twslink. Dynaorder is discontinued for years but it had global variables stored in windows registry. These global variables workes well until today, someone can exchange data between different charts and different applications without any restrictions, unfortunally only 32 Bit.

Maybe you think about it for a new realease?

-Klaus

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: Global Variables

Post by board_admin »

Storing in registry is like storing in database. TWSLink can access to odbc databases.
You just need to create your own database for that purpose and sql phrases to store and restore your variables.

Post Reply