开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育
Date

twsapi: Re: automated login

bee_jay_61
 

Voila ;-)


Re: twsapi: Re: automated login

Michel
 

开云体育

Qu'est que c'est 'WINTASK'? Where can I find it?

-----Mensaje original-----
De: Espelly Vincent [mailto:espelly@...]
Enviado el: martes, 02 de julio de 2002 23:12
Para: twsapi@...
Asunto: Re: twsapi: Re: automated login



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 
are coupled into larger programs or have ActiveX components. I may
try to strip out the relevent code "sanitize it", and put it into a
project or two and write up some documentation if I find the time
during the coming weeks.

--- In twsapi@y..., "Michel" wrote:
Hi,

Does somebody know some way to run the TWS application unattended?
What I need is:
1- Avoid the login screen, passing parameters (UserName and
Password) from


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.
Pass your username as separate keystrokes.? Then send
a tab key.? Then send your password as separate
keystrokes.? Then send a return.? There is a setting
to pre-fill the username in the .ini file (sorry, no
pre-fill for the password):

[Logon]
Username=edemo

.
.
.

If you pre-filled in the username you can just send a
tab and then the password plus a return key.? I send
characters to windows with Perl, but you can do it in
almost any language (Visual Basic, C++).

I believe you can detect when the "Accept incoming
connection" window pops up.? If that is possible you
might just be able to send the enter key to it to
accept the connection.? I haven't tried this yet.

Good luck,
Carl


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

-----Ursprüngliche Nachricht-----
Von: Michel [mailto:migurull@...]
Gesendet: Wednesday, July 03, 2002 4:55 AM
An: twsapi@...
Betreff: RE: twsapi: Retrieving Market Depth from TWS

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.
-----Mensaje original-----
De: groogill [mailto:gregperks@...]
Enviado el: martes, 02 de julio de 2002 23:00
Para: twsapi@...
Asunto: twsapi: Retrieving Market Depth from TWS

Hi,
Does anyone know if it possible to retrieve the data from the TWS
market depth window into excel. For example, is it possible to get
the cumulative bid/ask quantity down to the fifth level ?
Thanks


To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .

To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


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.

-----Mensaje original-----
De: groogill [mailto:gregperks@...]
Enviado el: martes, 02 de julio de 2002 23:00
Para: twsapi@...
Asunto: twsapi: Retrieving Market Depth from TWS

Hi,
Does anyone know if it possible to retrieve the data from the TWS
market depth window into excel. For example, is it possible to get
the cumulative bid/ask quantity down to the fifth level ?
Thanks


To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


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 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
IB
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
this, me being one of them...

I don't know how...

It really is anoying they don't give us a security server to
pass
through. Seems so archaic to have to have a TWS open for each
account
we 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
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:
"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.
"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
Thank you,
AMJ


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...>
wrote:
A hack is to send keystrokes to the login window.
Pass your username as separate keystrokes. Then
send
a tab key. Then send your password as separate
keystrokes. Then send a return. There is a
setting
to pre-fill the username in the .ini file (sorry,
no
pre-fill for the password):

[Logon]
Username=edemo

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 &#92;jts directory.



__________________________________________________
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.
Pass your username as separate keystrokes. Then send
a tab key. Then send your password as separate
keystrokes. Then send a return. There is a setting
to pre-fill the username in the .ini file (sorry, no
pre-fill for the password):

[Logon]
Username=edemo

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 &#92;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 IB
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
this, me being one of them...

I don't know how...

It really is anoying they don't give us a security server to pass
through. Seems so archaic to have to have a TWS open for each
account
we log on to...


Re: twsapi: TraderGuard GE NQ ES -Quick Reference

Rich
 


the lycos site was no good...I NEED THAT PROGRAM!


Join Excite! -
The most personalized portal on the Web!


Re: automated login

 

If you could keep TWS running 24/7 and login automatically, then IB
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
this, me being one of them...

I don't know how...

It really is anoying they don't give us a security server to pass
through. Seems so archaic to have to have a TWS open for each account
we log on to...


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


Trader Guard - ES NQ - NEW URL link

traderguard
 

======== Trader Guard - ES NQ - NEW URL link ========

DOWNLOAD LINK:


=====================================================

Website at LYCOS is closed by LYCOS admin. reason:

To many downloads !
DO NOT USE:


sorry for that..please use right link now.
AMJ


Trader Guard - ES NQ - NEW URL link

traderguard
 

======== Trader Guard - ES NQ - NEW URL link ========

DOWNLOAD LINK:


=====================================================

Website at LYCOS is closed by LYCOS admin. reason:

To many downloads !
DO NOT USE:


sorry for that..please use right link now.
AMJ


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

----- Original Message -----
Sent: Monday, July 01, 2002 2:19 PM
Subject: twsapi: Trader Guard - ES NQ - 23MB program - get it from website.

Trader Guard - ES NQ - 23MB program

Is Done !!! and working really GOOD.
Ready to be send to people who asked for it.. BUT..
Is to big to be POST here.. or to be send via E-mails.
I am going to setup today some free web site with this useful
interface for TWS.
And I'll POST link HERE ..download from there, please..
Protective mode work awesome.. I tested new version of TraderGuard
today on NQ.
It is better than older version.


If you like version 1.03.01 Try ver. 2.01.04. You want regret
it.

New features
-????? risk adjustable auto sell with wrong trend
-????? no transmit needed
-????? quick reverse with 1 click
-????? cover short or long with auto cancel pending one
-????? display profit of individual trade
-????? display risk monitoring limit
enjoy

I'll POST link here TOMMOROW.

traderguard@...???




Your use of Yahoo! Groups is subject to the .


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 
are coupled into larger programs or have ActiveX components. I may
try to strip out the relevent code "sanitize it", and put it into a
project or two and write up some documentation if I find the time
during the coming weeks.

--- In twsapi@y..., "Michel" wrote:
Hi,

Does somebody know some way to run the TWS application unattended?
What I need is:
1- Avoid the login screen, passing parameters (UserName and
Password) from
my calling application.
2- Respond to the message window asking 'Accept incoming connection
attempt?' when I connect to the local server.

This is because I'm writting my own program (Visual Basic using TWS
ActiveX)
which allways runs in the background and want it to automatically 
launch TWS
few minutes before markets open and perform some automated tasks 
when I'm
not at home.

I've tried to launch TWS from my application with a call
to 'ShellExecute',
passing parameters as 'username' or 'user' without success. I 
always get the
login screen blank because I ignore if TWS accepts such parameters 
and how
they must be coded (I think this must be possible because in the 
web demo,
the login screen appears whith such fields pre-filled with 'edemo' 
and
'demouser'). Perhaps in some 'ini' file? (I've not found any 
section related
to username and password).

Thanks for any help.

Michel.


To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to





Retrieving Market Depth from TWS

groogill
 

Hi,
Does anyone know if it possible to retrieve the data from the TWS
market depth window into excel. For example, is it possible to get
the cumulative bid/ask quantity down to the fifth level ?
Thanks