TWS + Portfolio Trader: auto-launch & email notifications

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
fbertram
Posts: 128
Joined: 16 Oct 2014
Has thanked: 37 times
Been thanked: 51 times

TWS + Portfolio Trader: auto-launch & email notifications

Postby fbertram » 09 Mar 2015

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
Attachments
Perl.zip
(7.56 KiB) Downloaded 272 times

Bundscalper1
Posts: 6
Joined: 24 Mar 2015

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

Postby Bundscalper1 » 25 May 2015

Dear Felix,

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

Thanks again.

arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 times

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

Postby arjfca » 25 Nov 2015

fbertram wrote: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

fbertram
Posts: 128
Joined: 16 Oct 2014
Has thanked: 37 times
Been thanked: 51 times

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

Postby fbertram » 26 Nov 2015

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

arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 times

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

Postby arjfca » 26 Nov 2015

fbertram wrote: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


Return to “User Contributed Studies and Indicator Library”