Page 1 of 1

TWS + Portfolio Trader: auto-launch & email notifications

Posted: 09 Mar 2015
by fbertram
Dear MultiCharts fans,

I'd like to share some code with you in the hopes that you might find this useful. The attached Perl scripts implement the following functionality:
* wait until 9am EST
* launch TWS and Portfolio Trader
* start auto-trading
* send email notifications for orders placed, orders filled, and orders expired
* shut-down trading system at 5pm EST

You will need to set up you user information in HKEY_CURRENT_USER/PerlStock. See PerlStock.pl for further information on the required keys.

Some more system information:
* Windows 8.1 on a Lenovo ThinkCentre M73 Tiny
* TWS 9395
* MultiCharts 9.0.10759
* Strawberry Perl
* gmail account for SMTP
* iCloud account to receive emails

My computer is set up to automatically power up at 8am EST. It will then automatically log into my user account and launch PerlStock.bat.

Any comments welcome.

Cheers, Felix

Re: TWS + Portfolio Trader: auto-launch & email notification

Posted: 25 May 2015
by Bundscalper1
Dear Felix,

many thanks for your input. Sounds interesting, will take a look at your perl scripts.

Thanks again.

Re: TWS + Portfolio Trader: auto-launch & email notification

Posted: 25 Nov 2015
by arjfca
Dear MultiCharts fans,

I'd like to share some code with you in the hopes that you might find this useful. The attached Perl scripts implement the following functionality:
* wait until 9am EST
* launch TWS and Portfolio Trader
* start auto-trading
* send email notifications for orders placed, orders filled, and orders expired
* shut-down trading system at 5pm EST

You will need to set up you user information in HKEY_CURRENT_USER/PerlStock. See PerlStock.pl for further information on the required keys.

Some more system information:
* Windows 8.1 on a Lenovo ThinkCentre M73 Tiny
* TWS 9395
* MultiCharts 9.0.10759
* Strawberry Perl
* gmail account for SMTP
* iCloud account to receive emails

My computer is set up to automatically power up at 8am EST. It will then automatically log into my user account and launch PerlStock.bat.

Any comments welcome.

Cheers, Felix
Hello

Could it be use to keep TWS running? Meaning restart automatically after th faily IB server reset

Martin

Re: TWS + Portfolio Trader: auto-launch & email notification

Posted: 26 Nov 2015
by fbertram
Hi arjfca,

the current version of the scripts does not detect TWS restarts. However, as the time is well known, you could easily set it up to shutdown before TWS restart, wait for an hour or two and then restart everything. Does this answer your question?

Now that Portfolio Trader also supports email alerts, I have redone the scripts using AutoIT. That might make it a little easier to understand and maintain. I will post these here asap.


Thank you,
best regards, Felix

Re: TWS + Portfolio Trader: auto-launch & email notification

Posted: 26 Nov 2015
by arjfca
Hi arjfca,

the current version of the scripts does not detect TWS restarts. However, as the time is well known, you could easily set it up to shutdown before TWS restart, wait for an hour or two and then restart everything. Does this answer your question?

Now that Portfolio Trader also supports email alerts, I have redone the scripts using AutoIT. That might make it a little easier to understand and maintain. I will post these here asap.


Thank you,
best regards, Felix
OK Felix
I use to work with TWSSTart to maintain IB opened 24/24. Now I got some some problem with TWS and had to use the TWS_Latest version. With this version I need to close MC then restart TWS everyday.

Trying to reinstall the standalone version at the moment

Have a nice day
Martin

N.B. I had done small work with AutoHotKey. I did publish on the forum a little application that allow to modify the scales using keyboard hot key.

viewtopic.php?f=5&t=47253&hilit=hotkey+scale