Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Twsapi
- Messages
Search
Re: twsapi: Re: automated login
Michel
开云体育Qu'est
que c'est 'WINTASK'? Where can I find it?
|
Re: twsapi: automated login
Michel
开云体育Thanks
Carl.
I've
tried it in VB but it does not work.?I've not tried it with the login
window but with the 'connection confirmation' window there are various
problems.
In my
code, first I pass the focus to TWS (AppActivate) and then I try to send it keys
(SendKey) (ENTER key in this case).
First problem is when in your code you
issue a connection command (ActiveX.connect), TWS seems to catch you in a
program loop and dont return to your calling program until you manually click
'Yes' or 'No' in this window so any code after 'connect' (AppActivate and
SendKeys), simply dont execute.
To
turn around this problem, I made a separate litle?application
(IBActivation.exe) which simply makes this:
1-
Tempo 1 second.
2-
AppActivate "Stock and options..." (this is the title of the TWS
window)
3-
Tempo 1 second.
4-
SendKeys "{ENTER}"
Then
in my main code:
ShellExecute "IBActivation.exe"
TWS.connect
...
and get a system error when IBActivation.exe tries to activate and/or send keys.
(It works if TWS is runing normally, but not when presenting the 'connection
confirmation' window)!
So I
thought this behaviour was implemented by IB for some security reason to be sure
that a connection to the program is really made by the account owner. (There is
a security problem if you automate login and connection because everybody having
your program or access to your PC can connect to your
account).
?
Here I
am...
I'll
try this for the login window and post results here.
?
Thanks
again.
Michel.
?
[Michel]??-----Mensaje original----- De: Carl Erikson [mailto:carlerikson@...] Enviado el: martes, 02 de julio de 2002 22:24 Para: twsapi@... Asunto: Re: twsapi: automated login A hack is to send keystrokes to the login window. |
AW: twsapi: Retrieving Market Depth from TWS
开云体育Again,
I think that makes sense to use a datafeed provider if you want to get market
data. eSignal and PCQuote are specialised on providing realtime datafeed and
both have an API.
?
Marcus
|
Re: twsapi: Retrieving Market Depth from TWS
Michel
开云体育I
asked IB about this, and they tell me they have no plans to incorporate Level 2
access through the API. Perhaps some solution capturing messages to this window
but more dificult and risky because this can change at any moment without
notice.
?
Michel.
|
Re: automated login
bee_jay_61
In my program I have automated the "Logon"- and "Accept incomming.."-
Dialog. For both dialogs I search the desired window. If the window isn?t found within 60 seconds the function stops. So my program will never hang if the TWS window doesn?t appear for any reason. I use the following Delphi Code to find the "Accept incomming.." Dialog: function EnumWinProc(WinHandle: HWND; lParam: LPARAM): boolean; StdCall; var szName: array[0..512] of char; begin Result := True; GetClassName(WinHandle, szName, 255); if UpperCase(szName) = 'SUNAWTDIALOG' then begin GetWindowText(WinHandle, szName, 255); if UpperCase(szName) = 'TRADER WORKSTATION' then begin if IsWindowVisible(WinHandle) then begin TwsWindow := WinHandle; Result := False; end; end; end; end; For the "Logon"_Dialog you have to search for classname "SUNAWTFRAME" and windowtext "NEW LOGIN". When the window is found then I sent a "Carriage Return" to the "Accept incomming connection attempt"-Dialog or twice a "Tab" and a "Carriage Return" to the "Logon"-Dialog. To find out if there is any easy way (of corse you can pre-fill the fields by sending the values for Username and Password in the same way like "Carriage Return" and "Tab") to pre-fill the Username and Password fields I decompiled the "Trader Workstation" (this is possible because the TWS is written in JAVA). I found the following code: public static void main(String args[]) { if(args.length < 1) { System.out.println("USAGE: java jclient.LoginFrame srcDir"); System.out.println(" --- or ---"); System.out.println(" java -jar jts.jar srcDir"); System.exit(0); } Thread.currentThread().setName("JTS-Main"); String s = args[0] + System.getProperty("file.separator"); System.setProperty("srcDir", s); String s1 = System.getProperty("srcDir") + "jts.ini"; a(s); String s2 = new String(); fl fl1 = new fl(); er er1 = new er(fl1, "Communication", "Peer", null); er er2 = new er(fl1, "Communication", "LocalPort", 0); er er3 = new er(fl1, "Communication", "ShouldClose", true); er er4 = new er(fl1, "Logon", "Username", ""); er er5 = new er(fl1, "Logon", "Password", ""); er er6 = new er(fl1, "Communication", "Debug", false); er er7 = new er(fl1, "GUI", "LookAndFeel", "Metal"); er er8 = new er(fl1, "Communication", "Compression", true); er er9 = new er(fl1, "Logon", "UseAnotherEncryption", false); if(!fl1.a(s1)) { ek.b(null, "jts.ini file could not be read"); return; } String s4 = er1.a(); if(s4 == null) { ek.b(null, "No peer entry in jts.ini file"); return; } int i = s4.indexOf(':'); if(i == -1) { ek.b(null, "Invalid peer entry in jts.ini file"); return; } else { String s3 = s4.substring(0, i); int j = Integer.parseInt(s4.substring(i + 1)); int k = er2.b(); boolean flag = er3.c(); go go1 = new go(s3, j, k, er4.a(), er5.a(), false, flag, null, er6.c(), er7.a(), er8.c(), er9.c()); go1.setLocation(400, 200); go1.setTitle("New Login"); go1.setSize(250, 174); go1.setDefaultCloseOperation(2); go1.show(); return; } So I add the following to the JTS.INI file to pre-fill UserName and Password: [Logon] Username=edemo Password=demouser I do add these lines from my program every time before I start the TWS with "ShellExecute" because I have more than one user. All this works fine for me. BeeJay --- In twsapi@y..., "kevin6502" <kevin6502@y...> wrote: There is an entry in the IB board that addresses this. The solutionup. The trick is knowing which window(dialog box) to send it to. HisIB towouldn't be able to differentiate its professional service (whichwrote: dopassthis, me being one of them... accountthrough. Seems so archaic to have to have a TWS open for eachwe log on to... |
Ways of filtering bad quotes from TWS
mbluhm2001
I have been getting a price quote of zero for some of the stock
tickers throughout the trading day. So I decided to put in a filter and wanted to see if anyone else had any better ideas. The way I'm trying it is the following: IF the current price quote is greater than or less than the previous quote by X% and the error counter is less than Y THEN throw away the quote and increment the error counter ELSE use the price quote and clear the error counter The idea is to set some min and max % (i'm starting with 5%) that the quote can be outside the previous quote. But to handle gaps, if the quote is out of range Y number of times (i'm starting with 5) then use that new quote. Also I don't allow quotes that are a value of zero either. Any thoughts would be helpful. Thanks, Mark |
Re: TraderGuard
cyberbri_2000
I like this concept, kinda what I had mentioned earlier about a
toggle quoted message
Show quoted text
program to monitor my open stock positions, then keep track of a trailing ATR stop for each position, then either alert, update an existing stop order or send a sell order when triggered. Ideally such a program would allow mutiple, user selectable stops for each position, like moving averages, relative strength, etc. I could even see having a "reserve" list of stocks, where the next one in line could be sent as a buy order as soon as the last sell goes through, or better yet go through that list and select the one to buy that has the strongest real time TraderBot short term rating... txtSymbol=F , which I can easily grab off the web. I would only have to select the strongest stock candidates and put them in that reserve list. It would work like an automatic revolving door of trades... I spend the time in the stock selection, using fundamental and/or technical criteria I already use, then release them to the reserve list for however long I want to keep them there... daily, weekly, etc. From the API docs and the samples in the Files section, I have most everything I need to get something working for stocks. Shouldn't be too long from now before I start transferring it from my brain to the keyboard :) Brian FIELDS: |
Re: twsapi: Re: automated login
Carl Erikson
Sorry, I was incorrect. The Password field works just
as you say. Thanks for the correction, Carl --- tripack44 <no_reply@...> wrote: --- In twsapi@y..., Carl Erikson <carlerikson@y...> __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free |
Re: automated login
tripack44
--- In twsapi@y..., Carl Erikson <carlerikson@y...> wrote:
A hack is to send keystrokes to the login window. Are you sure there is no pre-fill in? I just tried it with password field added such as the following example (: [Logon] Username=pfloyd5 Password=darkside and it worked. This is the jts.ini file in the \jts directory. |
Re: automated login
kevin6502
There is an entry in the IB board that addresses this. The solution
is to send a carriage return event to the dialog box when it pops up. The trick is knowing which window(dialog box) to send it to. His solution was to find a window with a certain name (TWS_whatever), meaning he would search for 60 seconds, then send a CR to that window. Check out the IB board about a week or two back. Kevin --- In twsapi@y..., "kgeis" <kgeis@y...> wrote: If you could keep TWS running 24/7 and login automatically, then IBwrote: doYou are among a large group of users who would like to be able to accountthis, me being one of them... we log on to... |
Re: automated login
If you could keep TWS running 24/7 and login automatically, then IB
toggle quoted message
Show quoted text
wouldn't be able to differentiate its professional service (which requires $2400 minimum commission per month.) An unfortunate situation for us TWS users who want to do a little bit more. --- In twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote:
You are among a large group of users who would like to be able to do |
TraderGuard GE NQ ES -Quick Reference
traderguard
This is just a quick manual how to use the program, if you haven't
figured it out on your own: Right top corner is where you enter symbol and expiry and exchange- Do that manually before clicking "Connect". You have 2 fields: LONG & SHORT: BUTTONS: "Long" button- buy at ask "Sell" button - sell at bid "Reverse" button - reverse from +1 to -1 with one click "Cancel" button - cancel last pending order FIELDS: "Acceptable risk" button - how much you are willing to risk in points. YOU CAN ADJUST THIS VALUE FREELY WHILE WATCHING THE MARKET. Guard will autoadjust itself to your new settings. "Bought" button - the price you bought the contract for "Price now" - the last price "Recent profit" - Displays approximate profit or loss "Guard Scalping Long" - Controlled by program; No user input required "Risk Monitoring" - is the sell trigger. If risk monitoring=acceptable risk, then Guard will autosell MRK to avoid loss or to collect profit. BUT ONLY IF "ENABLED PROTECTION WITH ACCEPTABLE RISK" BOX IS CHECKED That's all is. SHORT works the same way when you're going short. Sorry for the quick manual, but I don't have the time to write the help files at this point. I hope this helps. Try it on IB Commodities Demo, you will easily figure it out and get good at it. MOST CRITICAL FOR AUTOPROTECTION IS YOUR "Acceptable Risk" SETTING. I suggest to go higher before clicking "Long", and then adjust to your needs. Thank you, AMJ |
Re: twsapi: TraderGuard GE NQ ES -Quick Reference
Eduardo J Motta
Does it requires a minimum IB TWS interface ? What it optized for a
specific Build. What happens if WE upgrade the TWS interface ? ------------- Segue mensagem original ------------- De: traderguard <no_reply@...> Data: Wed, 03 Jul 2002 00:25:58 -0000 Para: twsapi@... Assunto: twsapi: TraderGuard GE NQ ES -Quick Reference This is just a quick manual how to use the program, if you haven't figured it out on your own: Right top corner is where you enter symbol and expiry and exchange- Do that manually before clicking "Connect". You have 2 fields: LONG & SHORT: BUTTONS: "Long" button- buy at ask "Sell" button - sell at bid "Reverse" button - reverse from +1 to -1 with one click "Cancel" button - cancel last pending order FIELDS: "Acceptable risk" button - how much you are willing to risk in points. YOU CAN ADJUST THIS VALUE FREELY WHILE WATCHING THE MARKET. Guard will autoadjust itself to your new settings. "Bought" button - the price you bought the contract for "Price now" - the last price "Recent profit" - Displays approximate profit or loss "Guard Scalping Long" - Controlled by program; No user input required "Risk Monitoring" - is the sell trigger. If risk monitoring=acceptable risk, then Guard will autosell MRK to avoid loss or to collect profit. BUT ONLY IF "ENABLED PROTECTION WITH ACCEPTABLE RISK" BOX IS CHECKED That's all is. SHORT works the same way when you're going short. Sorry for the quick manual, but I don't have the time to write the help files at this point. I hope this helps. Try it on IB Commodities Demo, you will easily figure it out and get good at it. MOST CRITICAL FOR AUTOPROTECTION IS YOUR "Acceptable Risk" SETTING. I suggest to go higher before clicking "Long", and then adjust to your needs. Thank you, AMJ To unsubscribe from this group, send an email to: twsapi-unsubscribe@... Your use of Yahoo! Groups is subject to |
Re: twsapi: Trader Guard - ES NQ - 23MB program - get it from website.
Quenton Nolte
开云体育Do you have any instructions.? I loaded it and
I'm not sure how to use it.? It appears to enter orders on the TWS but not
execute them.? Is it an alert system?
?
Quenton Nolte
|
Re: twsapi: Re: automated login
Espelly Vincent
You may try WINTASK, it could help you very well ?!!! tripack44 wrote: I have a couple of programs that do this in VB. Unfortunately they |
to navigate to use esc to dismiss