futures io



Keep IB's TWS Running 24x5


Discussion in Trading Reviews and Vendors

Updated
    1. trending_up 4,752 views
    2. thumb_up 5 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Keep IB's TWS Running 24x5

(login for full post details)
  #1 (permalink)
 TraderSU 
New York
 
Experience: Intermediate
Platform: NinjaTrader, Custom Platform
Broker: IB
Trading: ES, YM, Currency Futures
 
Posts: 79 since May 2010
Thanks: 46 given, 75 received

This is AutoIt (google for AutoIt 3) script that I use to keep my TWS (demo or real account) alive for ever (manual shutdown).

 
Code
Opt("TrayAutoPause", 0)
Opt("MouseCoordMode", 0) 
Opt("WinTitleMatchMode", 2)
TraySetIcon("Shell32.dll", 180)

; Demo mode
Do

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

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

    MouseClick("left", 120, 188, 1)
    Sleep(4000)

    WinClose("Exit Session Setting")

Until 1 = 2

; Never exit

 
Code
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, 170)

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

    MouseClick("left", 120, 148, 1)
    Sleep(500)

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

; Never exit

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote
The following 5 users say Thank You to TraderSU for this post:

 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
71 thanks
NinjaTrader Brokerage Services (www.ninjatraderbrokerage …
61 thanks
Where and How Do You Trade (via which device)?
39 thanks
New NinjaTrader
34 thanks
I need help with ... (ask any question)
16 thanks
 
(login for full post details)
  #3 (permalink)
 TraderSU 
New York
 
Experience: Intermediate
Platform: NinjaTrader, Custom Platform
Broker: IB
Trading: ES, YM, Currency Futures
 
Posts: 79 since May 2010
Thanks: 46 given, 75 received


This AutoIt script will allow you to automate the TWS login for demo account.

It should also work for real account if security token is disabled (but real account's keeping username/password in a script is a bad idea). But feel free to use keep alive script after manual login.

 
Code
Opt("MouseCoordMode", 0) 

If NOT WinExists("Login") Then
    
    ; Run TWS
    ShellExecute("C:\WINDOWS\system32\javaw.exe", "-cp jts.jar;hsqldb.jar;jcommon-1.0.12.jar;jfreechart-1.0.9.jar;jhall.jar;other.jar;rss.jar -Dsun.java2d.noddraw=true -Xmx512M jclient/LoginFrame D:\Jts", "D:\Jts")

    ; Wait 
    WinWait("Login")
    
EndIf

WinActivate("Login")
Sleep(200)

MouseClick("left", 130, 55, 2)
Send("username")
Sleep(200)

MouseClick("left", 130, 80, 2)
Send("password")
Sleep(200)

; Press Login
MouseClick("left", 170, 210)

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote


futures io Trading Community Trading Reviews and Vendors > Keep IB's TWS Running 24x5


Last Updated on July 22, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts