NexusFi: Find Your Edge


Home Menu

 





Keep alive TWS 24x6


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one TraderSU with 8 posts (20 thanks)
    2. looks_two arjfca with 4 posts (0 thanks)
    3. looks_3 djkiwi with 2 posts (1 thanks)
    4. looks_4 medias with 2 posts (1 thanks)
      Best Posters
    1. looks_one cusp with 7 thanks per post
    2. looks_two TraderSU with 2.5 thanks per post
    3. looks_3 dennho with 1 thanks per post
    4. looks_4 medias with 0.5 thanks per post
    1. trending_up 20,673 views
    2. thumb_up 30 thanks given
    3. group 19 followers
    1. forum 29 posts
    2. attach_file 4 attachments




 
Search this Thread

Keep alive TWS 24x6

  #11 (permalink)
 
djkiwi's Avatar
 djkiwi 
Mercer Island WA
 
Experience: Advanced
Platform: Ninjatrader/Strategy Desk
Broker: Various
Trading: TF/NQ/ES/Stocks
Posts: 561 since May 2010
Thanks Given: 981
Thanks Received: 1,558


medias View Post
Are you sure about this automatic restart? As far as I know, auto login/restart is not possible anymore, since IB TWS uses a "Security Code Card" verification (which IMHO is a fantastic security layer).

I prefer using the solution provided by TraderSU.

Hi. I couldn't get TWSstart to work even after emailing the developer who was very helpful by the way. I am not sure why. I have no problems with IB Gateway and works like a charm. It never logs me off. How it gets around the security card issue is it edits the TWS API and sets the auto logoff 5 minutes back. So you never get the 5 minute warning because it has automatically changed it for you via code.

Cheers
DJ

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
Futures True Range Report
The Elite Circle
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Build trailing stop for micro index(s)
Psychology and Money Management
Exit Strategy
NinjaTrader
 
  #12 (permalink)
 arjfca 
Montreal, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
Posts: 263 since Sep 2010
Thanks Given: 440
Thanks Received: 91


djkiwi View Post
Hi. I couldn't get TWSstart to work even after emailing the developer who was very helpful by the way. I am not sure why. I have no problems with IB Gateway and works like a charm. It never logs me off. How it gets around the security card issue is it edits the TWS API and sets the auto logoff 5 minutes back. So you never get the 5 minute warning because it has automatically changed it for you via code.

Cheers
DJ

Hello DgKiwi

As far as I know, TWSSTART does not work with TWS that use the security card. I did not read about any new version, but mine 2.5.0.972 does not allow it.

I don't use the security card so TWSSTART work like a charm for me

Did you check the port: TWS and IBGAteway does not use the same. Look i=n your TWS api configuration and match the same value on TWSSTART. Also, make sure the the Java is in the appropriate subdirectory

Good luck

Martin
Look, Investigate, Verify, Execute

Reply With Quote
  #13 (permalink)
 TraderSU 
New York
 
Experience: Intermediate
Platform: NinjaTrader, Custom Platform
Broker: IB
Trading: ES, YM, Currency Futures
Posts: 79 since May 2010
Thanks Given: 46
Thanks Received: 75



dennho View Post
I've used TWS Start with the exception of minor problems, the developer answers any support questions you may have in a timely manner.

It is also good to see other people address the stupid auto-logoff feature of TWS. Thanks for the heads up, TraderSU!

TWSStart has many great features but I've strict reservation against feeding my login id & password into any third party app. I may consider it if author makes the source-code public. But that's just me and my little schizophrenia.

Good luck.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #14 (permalink)
 
djkiwi's Avatar
 djkiwi 
Mercer Island WA
 
Experience: Advanced
Platform: Ninjatrader/Strategy Desk
Broker: Various
Trading: TF/NQ/ES/Stocks
Posts: 561 since May 2010
Thanks Given: 981
Thanks Received: 1,558

Thanks Martin, I thought that was the case with TWSStart. Therefore I did get it to work but it was not suitable for my needs. I much prefer the simple IB gateway solution whereby it just resets the autologoff time 5 minutes back. This way we don't have to mess with the security card numbers. Logging Ninja off each night and then logging back on was a real PITA.

Also TraderSUs reservations are quite valid. In fact that is one reason I like IB. I'm quite risk averse and much prefer the security code system of IB over the other brokers I use. Imagine if a malicious hacker got your user name and password and logged into your futures account and wrecked havoc placing trades and drained your account. You would have no recourse whatsoever.

Also if you use ninjatrader IB keeps orders live on their system whereas the others don't so if your PC goes down you could be in serious problems as you will have unfilled orders even if you have been stopped out during the outage. IB is the only broker that has adequate risk controls in my view although I'm now off topic again.

Cheers
DJ

Reply With Quote
Thanked by:
  #15 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371


TraderSU View Post
Here is small script which will help you in keeping tws alive throughout the week. Simply copy it in "start-up folder" and stop bitching about TWS's reboot.

Trick is very simple, it will flip the AM / PM portion of your time when popup appears.

PS: You'll need AutoIt ( AutoItScript - AutoItScript Website) to run this.

 
Code
#cs ----------------------------------------------------------------------------
Author: TraderSU
URL:    http://tradersu.wordpress.com/
#ce ----------------------------------------------------------------------------


Opt("TrayAutoPause", 0)
Opt("MouseCoordMode", 0) 
Opt("WinTitleMatchMode", 2)

TraySetIcon("Shell32.dll", 180)

; Live mode
Do

	WinWaitActive("Exit Session Setting")
	WinMove("Exit Session Setting", "", Default, Default, 320, 150)

    ; Switch from AM to PM & PM to AM
	If @HOUR > 12 Then
		MouseClick("left", 156, 50 , 1)
	Else
		MouseClick("left", 208, 50, 1)
	EndIf

	MouseClick("left", 135, 128, 1)
    Sleep(500)

    WinClose("Exit Session Setting")
    Sleep(2000)
    
Until 1 = 2 ; Never exit


Very cool. Should be able to convert this script to AutoHotKey and get the same functionality for those who already use that tool. Most of the commands look pretty much the same.

Reply With Quote
  #16 (permalink)
 TraderSU 
New York
 
Experience: Intermediate
Platform: NinjaTrader, Custom Platform
Broker: IB
Trading: ES, YM, Currency Futures
Posts: 79 since May 2010
Thanks Given: 46
Thanks Received: 75


monpere View Post
Very cool. Should be able to convert this script to AutoHotKey and get the same functionality for those who already use that tool. Most of the commands look pretty much the same.

AHK is great if you only need UI automation. Reason why I started to use AutoIt is its networking functionalities which was required for my other goodies.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #17 (permalink)
cusp
Bundeburg
 
Posts: 48 since Mar 2012
Thanks Given: 27
Thanks Received: 49

You can do the same thing with Autohotkey which has a very similar syntax. I originally got this code from someone on the Sierra Chart support board; it's not original.

The script is:

 
Code
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetBatchLines,1ms 
#SingleInstance force

SetTitleMatchMode, 2
Menu, tray, Icon, C:\Windows\system32\SHELL32.dll, 180  ;138 

SetTimer,Test4windows,10000  ; test every 10 seconds

#!^1::GoSub, ShowScriptRunning

return


Test4windows:
IfWinExist, Exit Session Setting
{
    WinActivate, Exit Session Setting
    ; Make AM to PM & PM to AM
    If A_Hour > 12 Then
        MouseClick, left, 173, 73, 1

    Else
        MouseClick, left, 223, 73, 1
        
    MouseClick, left, 149, 188, 1
    ; MsgBox, 0,, Reversed AM/PM at %A_Hour%:%A_Min%, 4
    WinClose, Exit Session Setting
    sleep,900
    WinClose, Exit Session Setting
}
return


ShowScriptRunning:
    MsgBox, 0,, Script is Running, 4
return
I have attached a compiled version for anyone who doesn't want to install authotkey itself. Its in a zip because I don't think you can add exe's to the board. If you want to check its running press Ctrl WindowsKey Alt and 1 to get a message box.



Attached Files
Elite Membership required to download: KeepTWSAlive.zip
Reply With Quote
  #18 (permalink)
Stuart1414
London- England
 
Posts: 1 since May 2012
Thanks Given: 1
Thanks Received: 0

Hi guys

New here. Also trying to get Workstation open 24/6.

Is it possible to actually have Workstation running 24/6 on a virtual server?

If so, can someone (maybe offline) talk me through how I actually get this working, I am 100% untechnical!!

Thanks a lot.

Reply With Quote
  #19 (permalink)
 
l1onel's Avatar
 l1onel 
The Valley ANGUILLA Caribbean
 
Experience: Advanced
Platform: TWS,Ninjatrader
Broker: IB, Ninjatrader
Trading: ES, NQ
Posts: 81 since Apr 2010
Thanks Given: 25
Thanks Received: 33

Hi Cusp
Did not work for me with Autohotkey, but works with AutoIt3.
Here the compiled version.
Thanks a lot.

I believe only in profits, not in prophets.
Attached Files
Elite Membership required to download: keepTWSalive_autiIt3.zip
Follow me on Twitter Reply With Quote
  #20 (permalink)
 TraderSU 
New York
 
Experience: Intermediate
Platform: NinjaTrader, Custom Platform
Broker: IB
Trading: ES, YM, Currency Futures
Posts: 79 since May 2010
Thanks Given: 46
Thanks Received: 75


This tweak fixes the extra ghosty click on TWS ; I call it ghosty because I could never re-produce it but very often I was finding a pending trade on my TWS (caused by an extra left click on bid/ask). Adding an extra messagebox with 10s timeout seems to resolve this issue.

I've included the source code & 32-bit compiled EXE inside the zip for those who don't want to install AutoIt.

Enjoy!

Attached Files
Elite Membership required to download: TWS_KeepAlive.zip
Elite Membership required to download: TWS_KeepAlive.au3.txt
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on October 30, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts