开云体育

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

Re: twsapi: Modifying an order & testing

marinindextrader
 

There is nothing in the files section that specifically deals with
trailing stops...though I can asure you that someday not to long from
now it will

As TonkaDad said there is a demo server

To log in:

Username for equities demo: edemo

Username for commodities demo: cdemo

And in both of the above cases the password is:

demouser


As to your trailing stop question:

It is my understanding that this can be handled in a few different
ways:

Method A:

Have no server sided order and have an order on your client side that
is ready to execute. You track the security price on your side, then
if and when certain price events occur, you do one of two things:
modify the ready order, or go ahead and send it

Method B:

Have a standing order on the server, and if and when price events
occur one of two things happens. You do nothing and the standing
order is executed on the server side (you got stopped out), Or, You
resubmit the order with modifications using the identical id # (not
positive about this one), and the server sided order is modified (an
event occured that triggered your modified order to send).

Method C:

Have a standing order on the server side, and when events occur
either one of two things happen. The order triggers (you were stopped
out), or you cancel the order and resubmit a new order with your new
parameters based on a price action event.

I havn't explored the nuts and bolts of it yet...but that is how I
believe it is played out. Which method one chooses is a matter of
prefrence and the liquidity of the market you trade.

Scott





--- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote:
I to would like to know how to place trailing stops.

If you go to on the left
about half way down
it should say "Files" there is some code there. Also Jaba put
together a simple project that you can download look at post 189.

As far as testing before you go live IB has a demo that you can
connect to.

Good luck,

Tonkadad
----- Original Message -----
From: ruffstuff123
To: twsapi@y...
Sent: Saturday, June 29, 2002 10:05 AM
Subject: twsapi: Modifying an order & testing


Hi,

First post in this forum. I hope this question han't been posted
before.......

The only thing that I'm really missing is a trailing stop.
Anyone managed to code something like that?
If so please mail me the code or point me to an example.
It would save me huge amounts of time.
Finally away from the screen for a few hours :-)

I can code a bit in VB6. Level... erm... advanced 'Hello world' ;)
But if anyone would be so kind to share a few lines of code that
modifies an order I have enough to build on.

Is their a way to test without placing real trades?
Needless to say a little bug can cost 1000's........

Looking forward to the replies.
And to the founder(s) of this group: Great initiative!

Kind regards.



Yahoo! Groups Sponsor
ADVERTISEMENT



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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.


Re: twsapi: Modifying an order & testing

 

开云体育

I to would like to know how to place trailing stops.
?
If you go to on the left about half way down
it should say "Files" there is some code there. Also Jaba put together a simple project that you can download look at post 189.
?
As far as testing before you go live IB has a demo that you can connect to.
?
Good luck,
?
Tonkadad

----- Original Message -----
Sent: Saturday, June 29, 2002 10:05 AM
Subject: twsapi: Modifying an order & testing

Hi,

First post in this forum. I hope this question han't been posted
before.......

The only thing that I'm really missing is a trailing stop.
Anyone managed to code something like that?
If so please mail me the code or point me to an example.
It would save me huge amounts of time.
Finally away from the screen for a few hours :-)

I can code a bit in VB6. Level... erm... advanced 'Hello world' ;)
But if anyone would be so kind to share a few lines of code that
modifies an order I have enough to build on.

Is their a way to test without placing real trades?
Needless to say a little bug can cost 1000's........

Looking forward to the replies.
And to the founder(s) of this group: Great initiative!

Kind regards.




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



Your use of Yahoo! Groups is subject to the .


Modifying an order & testing

ruffstuff123
 

Hi,

First post in this forum. I hope this question han't been posted
before.......

The only thing that I'm really missing is a trailing stop.
Anyone managed to code something like that?
If so please mail me the code or point me to an example.
It would save me huge amounts of time.
Finally away from the screen for a few hours :-)

I can code a bit in VB6. Level... erm... advanced 'Hello world' ;)
But if anyone would be so kind to share a few lines of code that
modifies an order I have enough to build on.

Is their a way to test without placing real trades?
Needless to say a little bug can cost 1000's........

Looking forward to the replies.
And to the founder(s) of this group: Great initiative!

Kind regards.


Autostoptrailing

 

Hi,
i tried to run autostoptrailing using dde interface and the example
from tws manuel. It didn't work properly. Any idea's ?

Thx for help


IB TWS API Thread at WL.

techguy1313
 

Hi, I'm Techguy:

I started an IB Automation thread at Wealth Lab, under the Automation
Category. Click here to read it. It may have some value to you, and
will certainly expose my limited programming ability - but there may
be some good information there for you as well.



Some of you may know me from elsewhere - other forums - same guy. If
you are in the Seattle or Portland area, we have a group of Trader
Programmers that meet regularly: Here is the contact info:

The PDX and Seatac Wealth Lab User Groups are now centralized at the
Yahoo Groups area. Members can post, view the calendar, upload files,
chat, and generally keep themselves informed of the PDX WLUG
happenings.

Membership is by moderator acceptance. Content is un-moderated.

All Backtesting / Trading suite Users / Programmers / Developers are
invited to attend (Tradestation, AMI, SmartQuant, Wealth Lab, C++
Users, etc. . . are invited to attend and participate in the
meetings - if for nothing else comradiere)

This User Group strives to meet monthly, and address topics of
interest to Trader Programmers. Emphasis is on the use of Wealth Lab
for Trading strategy testing and as use of a decision engine for
Trading automation.

For a brief synopsis of the groups and more about what we are all
about go here:



A link to Wealth Lab is located on the page above.

For the sister SeaTac group membership request go here:



For the Portland Oregon Wealth Lab User Group (PDX_WLUG) go here:


Re: twsapi: Market Making App

fanjacks
 

Odd lots do not have to be represented in the NBBO. They do have
to
trade if given the opportunity though.
So does this mean that I can put a buy and a sell order inside the
spread, and if the orders are odd lots, they are effectively
invisible, at least on the level 1? I'm thinking there must be a
huge disadvantage to this, like full lots are given execution
priority (at that level), or it would be too advantagous.

FYI, I know IB forbids you from making markets in options. I
wouldn't be surprised to see something similiar in stocks. I know
back in the old days it was not legal for complete automation, even
on a fully certed OTC dealer desk.
I tried it out on my account it indeed, it does work for stocks.
There's a specific regulation in the options market that forbids
opening two opposit positions on the same option (something to that
effect). I dont' think it exists for stocks, unless someone knows
better.

I have seen similar programs in the forex market (where the market
makers are real A**holes, more so than any equity MM can ever be).
I'm surprised that they aren't more prevasive in the equity market,
or at least, I know they exist but they are never advertised. Does
anyone know the reason?

Cheers,

JS


Re: twsapi: Market Making App

 

Odd lots do not have to be represented in the NBBO. They do have to
trade if given the opportunity though.

FYI, I know IB forbids you from making markets in options. I
wouldn't be surprised to see something similiar in stocks. I know
back in the old days it was not legal for complete automation, even
on a fully certed OTC dealer desk.

Good luck.



Aaron Schindler


----- Original Message -----
From: fanjacks
To: twsapi@y...
Sent: Thursday, June 27, 2002 9:29 AM
Subject: twsapi: Market Making App


Hello. I'm a seasoned vb programmer and I've been trading with
IB
for a long while. I'm thinking about writing a fully automated
Market Making application that posts bids/asks automatically. I
have
to admit, although I would have no problem writing the software
(which I don't mind sharing with everyone), I don't think I know
enough about market making. In general, when I try to post a
test 10-
share sell/buy on a NASDAQ stock inside the bid/ask spread, it
doesn't seem to show up on the Bid/Ask. Is this because I'm not
posting lots? or is there some other restriction. I would love
to
hear from people with similar interest, and get a move on this
project if it is feasible.

Cheers,

JS


Yahoo! Groups Sponsor
ADVERTISEMENT



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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.


Re: How to get - Account Number

marinindextrader
 

That was an excellent question

--- In twsapi@y..., bee_jay_61 <no_reply@y...> wrote:
--- In twsapi@y..., multicen2002 <no_reply@y...> wrote:
I have 2 accounts.
Anyone know how to get account number >>?
An example vb code line will do just fine.

ThanX
I am not sure, but isn?t the account number display in the window
caption of the "Account"-Window?

If so, than I would read the Window Caption.


Re: How to get - Account Number

marinindextrader
 

Anyone know how to get account number >>?

I think you need to control this yourself and keep a cross refrence
with which instance you are calling the connect from.

In this case you need to either capture the port and compare it when
you call it, or better yet keep an array that mirrors your API object
array interms of indecies

Such as a Long, 2 dimensional array that has as many lead indecie as
you have API objects and as many columns as you feel fit to
include...2 in this case...that would look something like this


Dim arrAccount()
ReDim arrAccount(UBound(TWS1), 1)

arrAccount(0,0) = 7496
arrAccount(0,1) = 'some account number
arrAccount(UBound(arrAccount),0) = 7497
arrAccount(UBound(arrAccount),1) = 'some other account number

Then when you call any TWS you can refrence the array as well and
return the account number easily based on the index API object.

You could add a third element to the array and make the array variant
and put a string value in the third slot such as "Stocks"
or "Futures" to further expand its utility.

Hope this helps as well

Scott

PS I will be exploring this subject in depth some time in the coming
couple of weeks and will be posting example code...

Unless of course you beat me to it



--- In twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote:
This is an interesting question, and one I was intending at some
point to explore.

Based on a cursory review of the methods and calls, there is no way
to retrieve an account number.

But on a little deeper look I believe I have a solution for you.

Apparentley the TWS platform remembers the socket port you called
with the account you called.

In other words you must log onto to each account from a different
socket port with seperate instance of TWS, and then from within
your
program you can call the connection from a seperate instance of the
Active X componenet for each account.

An array of controls would do the job...

TWS1(0).Connect "", 7496
TWS1(1).Connect "", 7497

or perhaps just renaming the controls

TWS1.Connect "", 7496
TWS2.Connect "", 7497

I am an array kind of guy so I would go the array route...

Lastley, perhaps you dont even need the second instance and can
call
direct..

TWS1.Connect "", 7496
TWS1.Connect "", 7497

But this looks like your asking for trouble and corupted data...IMHO

Either Way....

From there, you can then refrence your calls and segregate returns
based on the source of the call

TWS1(0).reqMktData(da dee da)
TWS1(1).reqMktData(da dee da)

Thats how I see it.

Again, I havn't explored this in detail and perhaps I am wrong.

Give that a shot and then report back here what you find so we can
all benefit from your experience.

Scott
Owner TWSAPI






--- In twsapi@y..., bee_jay_61 <no_reply@y...> wrote:
--- In twsapi@y..., multicen2002 <no_reply@y...> wrote:
I have 2 accounts.
Anyone know how to get account number >>?
An example vb code line will do just fine.

ThanX
I am not sure, but isn?t the account number display in the window
caption of the "Account"-Window?

If so, than I would read the Window Caption.


Re: How to get - Account Number

marinindextrader
 

This is an interesting question, and one I was intending at some
point to explore.

Based on a cursory review of the methods and calls, there is no way
to retrieve an account number.

But on a little deeper look I believe I have a solution for you.

Apparentley the TWS platform remembers the socket port you called
with the account you called.

In other words you must log onto to each account from a different
socket port with seperate instance of TWS, and then from within your
program you can call the connection from a seperate instance of the
Active X componenet for each account.

An array of controls would do the job...

TWS1(0).Connect "", 7496
TWS1(1).Connect "", 7497

or perhaps just renaming the controls

TWS1.Connect "", 7496
TWS2.Connect "", 7497

I am an array kind of guy so I would go the array route...

Lastley, perhaps you dont even need the second instance and can call
direct..

TWS1.Connect "", 7496
TWS1.Connect "", 7497

But this looks like your asking for trouble and corupted data...IMHO

Either Way....

From there, you can then refrence your calls and segregate returns
based on the source of the call

TWS1(0).reqMktData(da dee da)
TWS1(1).reqMktData(da dee da)

Thats how I see it.

Again, I havn't explored this in detail and perhaps I am wrong.

Give that a shot and then report back here what you find so we can
all benefit from your experience.

Scott
Owner TWSAPI

--- In twsapi@y..., bee_jay_61 <no_reply@y...> wrote:
--- In twsapi@y..., multicen2002 <no_reply@y...> wrote:
I have 2 accounts.
Anyone know how to get account number >>?
An example vb code line will do just fine.

ThanX
I am not sure, but isn?t the account number display in the window
caption of the "Account"-Window?

If so, than I would read the Window Caption.


Re: How to get - Account Number

bee_jay_61
 

--- In twsapi@y..., multicen2002 <no_reply@y...> wrote:
I have 2 accounts.
Anyone know how to get account number >>?
An example vb code line will do just fine.

ThanX
I am not sure, but isn?t the account number display in the window
caption of the "Account"-Window?

If so, than I would read the Window Caption.


Re: twsapi: Trader Guard - ES NQ futures ready app.

Shukrainternationals
 

开云体育

Can anybody tell me what is the web site address of twsapi group? (NOT the email address).
Thanks.
?

----- Original Message -----
Sent: Thursday, June 27, 2002 3:27 PM
Subject: twsapi: Trader Guard - ES NQ futures ready app.

Addition to your existing IB TWS platform. I designed it for scalpers
to profit from every single trend change with "adaptive Automation
Engine" monitoring market tick by tick and in real time.
You will love it.
It will automate your profit collection at the topmost
point and also auto-escape from bad point of entry. This is what i
like the most.
Download it from twsapi file area. I'll post it here within 3 days
(finishing GUI design only)
If you inpatient or file is not there for any reason e-mail request
to me. I'll be happy to send you a copy.


traderguard@...



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



Your use of Yahoo! Groups is subject to the .


Re: twsapi: Market Making App

Schindler Trading
 

开云体育

Hi JS,
?
I'd like to adapt your program to the futures markets I trade through Interactive Brokers.? Unfortunately, unless you write your code in C++, I won't be able to contribute much to the project.? But if you do get your code working, I'd be happy to pay you something nominal for a copy of it.
?
Regards,
Aaron Schindler
?
?

----- Original Message -----
From: fanjacks
Sent: Thursday, June 27, 2002 9:29 AM
Subject: twsapi: Market Making App

Hello.? I'm a seasoned vb programmer and I've been trading with IB
for a long while.? I'm thinking about writing a fully automated
Market Making application that posts bids/asks automatically.? I have
to admit, although I would have no problem writing the software
(which I don't mind sharing with everyone), I don't think I know
enough about market making.? In general, when I try to post a test 10-
share sell/buy on a NASDAQ stock inside the bid/ask spread, it
doesn't seem to show up on the Bid/Ask.? Is this because I'm not
posting lots? or is there some other restriction.? I would love to
hear from people with similar interest, and get a move on this
project if it is feasible.

Cheers,

JS



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



Your use of Yahoo! Groups is subject to the .


Re: COM error trying to connect.

houdinihound
 

Tried that as well (Python allows either) but no luck.

Thanks anyway.

JC

--- In twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote:
In VB this (tws.connect('', 7496)) Would be:

tws.connect "",7496 [Double Quotes not single quotes]

Other than that don't know no pYthons

Scott




--- In twsapi@y..., "houdinihound" <houdinihound@y...> wrote:
Hi,

Was trying to connect via COM but keep getting this error:
com_error: (-2147418113, 'Unexpected failure', None, None)

I checked my system and the TWS ActiveX control is registered.
Also
the app is running (build 769.1) and logged in to EDEMO account.
It
is also set to accept connections.

I'm using Python to connect, code as follows:

tws = Dispatch("TWS.TwsCtrl.1")

which works and creates the object exposing all it's methods and
properties.

However, when I try to connect:

tws.connect('', 7496)

I get the error. I've tried specifying the IP address as well,
no
difference.

Anyone done it this way or am I missing something obvious?

Thanks in advance for any advice.

JC


How to get - Account Number

multicen2002
 

I have 2 accounts.
Anyone know how to get account number >>?
An example vb code line will do just fine.

ThanX


stockwatchpro

 

Found this on silicon investor IB board. I tried stockwatchpro along
with IB today, works pretty good. I wish IB removed BEST routing
restriction on its API.

---------------------------------------------------------
Stock Watch Pro 2.3 with IB TWS integration just got released. Orders
can be initiated from Stock Watch Pro as follows:
- QuoteSheets (double-clicking on bid or ask)
- Level II or Island book (double-clicking on a market maker)
- Charts (from the right-click menu)
- From alerts when they trigger. SWP formula language allows you to
define any condition and associate an order with it.

Stock Watch Pro website:
For integration details see


Re: twsapi: Trader Guard - ES NQ futures ready app.

Shukrainternationals
 

开云体育

What is the name of your web site?
Thanks.

----- Original Message -----
Sent: Thursday, June 27, 2002 8:26 PM
Subject: Re: twsapi: Trader Guard - ES NQ futures ready app.

On the left, in a frame is a blue lined box with links like this:

Home
Messages
Post
Chat
Files
Photos
Bookmarks
-------------------
(blue star) = owner
(yellow star) = moderator
(smiley) = online


Click on the files link in this blue box.

HTH,

JC





--- In twsapi@y..., "Shukrainternationals"
<shukrainternationals@c...> wrote:
> I do not see any "Files"? link on my screen. I received your email
in the following format. How can I go to your web site from this
email to go to that 'Files" link? This? happened to me once earlier.
Can I be in your web site whenever I get an email from you like the
following one.
> Thanks.
>?? ----- Original Message -----
>?? From: marinindextrader
>?? To: twsapi@y...
>?? Sent: Thursday, June 27, 2002 6:05 PM
>?? Subject: Re: twsapi: Trader Guard - ES NQ futures ready app.
>
>
>?? "Download it from twsapi file area. I'll post it here within 3
days"
>
>?? He hasnt uploaded it yet...but when he does you can get there
from
>?? here by clicking on the Files link on the left sidebar
>
>
>?? <-----------------------------------Over There, see where it says
>?? FILES
>
>?? Or you can click this link:
>??
>
>?? Scott
>
>
>
>
>
>?? --- In twsapi@y..., "Shukrainternationals"
>?? wrote:
>?? > How to go to TWSAPI file area?
>?? >
>?? >?? ----- Original Message -----
>?? >?? From: traderguard
>?? >?? To: twsapi@y...
>?? >?? Sent: Thursday, June 27, 2002 3:27 PM
>?? >?? Subject: twsapi: Trader Guard - ES NQ futures ready app.
>?? >
>?? >
>?? >?? Addition to your existing IB TWS platform. I designed it for
>?? scalpers
>?? >?? to profit from every single trend change with "adaptive
>?? Automation
>?? >?? Engine" monitoring market tick by tick and in real time.
>?? >?? You will love it.
>?? >?? It will automate your profit collection at the topmost
>?? >?? point and also auto-escape from bad point of entry. This is
what
>?? i
>?? >?? like the most.
>?? >?? Download it from twsapi file area. I'll post it here within 3
days
>?? >?? (finishing GUI design only)
>?? >?? If you inpatient or file is not there for any reason e-mail
>?? request
>?? >?? to me. I'll be happy to send you a copy.
>?? >
>?? >
>?? >?? traderguard@y...
>?? >
>?? >
>?? >
>?? >?? To unsubscribe from this group, send an email to:
>?? >?? twsapi-unsubscribe@y...
>?? >
>?? >
>?? >
>?? >?? Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>?? Service.
>
>
>?? To unsubscribe from this group, send an email to:
>?? twsapi-unsubscribe@y...
>
>
>
>?? Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.



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



Your use of Yahoo! Groups is subject to the .


Re: Trader Guard - ES NQ futures ready app.

traderguard
 

"Download it from twsapi file area.
I'll post it here within 3 days"!!!

SUNDAY 30 2002 - please be patient.

if you inpatient e-mail request to me for OLDER version beta. I'll be
happy to send you a copy.

New version is better.. with quick reverse, quick -cancel-reorder and
more.

Just 3 more days.. It is good stuff. I promise you will get to try it

Thank You.





--- In twsapi@y..., traderguard <no_reply@y...> wrote:
Addition to your existing IB TWS platform. I designed it for
scalpers
to profit from every single trend change with "adaptive Automation
Engine" monitoring market tick by tick and in real time.
You will love it.
It will automate your profit collection at the topmost
point and also auto-escape from bad point of entry. This is what i
like the most.
Download it from twsapi file area. I'll post it here within 3 days
(finishing GUI design only)
If you inpatient or file is not there for any reason e-mail request
to me. I'll be happy to send you a copy.


traderguard@y...


Re: twsapi: Trader Guard - ES NQ futures ready app.

houdinihound
 

On the left, in a frame is a blue lined box with links like this:

Home
Messages
Post
Chat
Files
Photos
Bookmarks
-------------------
(blue star) = owner
(yellow star) = moderator
(smiley) = online


Click on the files link in this blue box.

HTH,

JC





--- In twsapi@y..., "Shukrainternationals"
<shukrainternationals@c...> wrote:
I do not see any "Files" link on my screen. I received your email
in the following format. How can I go to your web site from this
email to go to that 'Files" link? This happened to me once earlier.
Can I be in your web site whenever I get an email from you like the
following one.
Thanks.
----- Original Message -----
From: marinindextrader
To: twsapi@y...
Sent: Thursday, June 27, 2002 6:05 PM
Subject: Re: twsapi: Trader Guard - ES NQ futures ready app.


"Download it from twsapi file area. I'll post it here within 3
days"

He hasnt uploaded it yet...but when he does you can get there
from
here by clicking on the Files link on the left sidebar


<-----------------------------------Over There, see where it says
FILES

Or you can click this link:


Scott





--- In twsapi@y..., "Shukrainternationals"
<shukrainternationals@c...> wrote:
> How to go to TWSAPI file area?
>
> ----- Original Message -----
> From: traderguard
> To: twsapi@y...
> Sent: Thursday, June 27, 2002 3:27 PM
> Subject: twsapi: Trader Guard - ES NQ futures ready app.
>
>
> Addition to your existing IB TWS platform. I designed it for
scalpers
> to profit from every single trend change with "adaptive
Automation
> Engine" monitoring market tick by tick and in real time.
> You will love it.
> It will automate your profit collection at the topmost
> point and also auto-escape from bad point of entry. This is
what
i
> like the most.
> Download it from twsapi file area. I'll post it here within 3
days
> (finishing GUI design only)
> If you inpatient or file is not there for any reason e-mail
request
> to me. I'll be happy to send you a copy.
>
>
> traderguard@y...
>
>
>
> To unsubscribe from this group, send an email to:
> twsapi-unsubscribe@y...
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.


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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.


Re: COM error trying to connect.

marinindextrader
 

In VB this (tws.connect('', 7496)) Would be:

tws.connect "",7496 [Double Quotes not single quotes]

Other than that don't know no pYthons

Scott




--- In twsapi@y..., "houdinihound" <houdinihound@y...> wrote:
Hi,

Was trying to connect via COM but keep getting this error:
com_error: (-2147418113, 'Unexpected failure', None, None)

I checked my system and the TWS ActiveX control is registered.
Also
the app is running (build 769.1) and logged in to EDEMO account.
It
is also set to accept connections.

I'm using Python to connect, code as follows:

tws = Dispatch("TWS.TwsCtrl.1")

which works and creates the object exposing all it's methods and
properties.

However, when I try to connect:

tws.connect('', 7496)

I get the error. I've tried specifying the IP address as well, no
difference.

Anyone done it this way or am I missing something obvious?

Thanks in advance for any advice.

JC