Re: twsapi: Re: Java API, ordering question


Christian Czirnich
 

Hi,

<When I submit an order of type MKT, it will sell stocks at whatever
<the market bid price happens to be when I submit the order ? and it
<will buy stocks at whatever the market ask price happens to be ?
<Also, I am still curious about what happens if it is not able to find
<all the stocks I am requesting at one price. I assume it will do
<partial fills with different prices. I can tell this because there is
<the average price coming in to orderStatus() event. Is it possible to
<tell how many of the stocks were purchased at what price without
<doing any guessing ?

That's what the market order is expected to do. It will get you in or out of the market on the next available price/prices, regardless of the sharesize. On July 2nd, IDPH gave a great example what happens, if you sell 1 million shares at the market (8 $ down in 2 minutes, back near normal during the next 30 minutes) So with a market order you can be sure, you'r in or out. A market order will also get you in on any short, but it will wait for the next uptick, so you can't know the level you will be filled in advance, if the order is entered on a downtick.
Unless a stock is halted during the execution of your order, there is no partial fill. In comparison a limit order might or might not fill or you might get a partial fill, depending on the shares available at your level.

I'm not sure if the API provides all the details of the executions, but you can get all the details concerning the different fills from the Executions Window on IB's Trader Workstation. IMHO, for P/L calculation it should be sufficient to work with the average price, as this is the price you paid plus one times commission.

Have a nice weekend,

croc




Thanks.

--- In twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote:
Market Order Price Values are ignored or not required...

A proper MKT order call looks like this in a literal sense:

Call PlaceNewOrder("BUY", 1, "ES", "FUT", "200209",
0, "", "GLOBEX", "", "MKT", 0, 0)

This is a MKT order call for one contract of September ES on the
Globex Exchange. Of course one can use variables of proper type in
lieu of literals...

In order to asses the results of your Market Order you will need to
use: Call reqExecutions

The data will then be fed back through the openOrder1(), openOrder2
(), and orderStatus() Events where they can be captured, analyzed
and
diseminated...

Begin by reading the TWS API help files. Though brief in nature,
they
are concise and indespensible in understanding how all of the
events
and methods tie together...

Events Syntax:


X_Other/activexevents.htm

Methods Syntax:


X_Other/activexmethods.htm

Properties Syntax:


X_Other/activexproperties.htm


Scott


--- In twsapi@y..., usernew <no_reply@y...> wrote:
When I say qty=500, and market order type, price = 20.00,
how does IB fulfill the order if it is not able to find all 500
shares at 20.00 ? How will I know the prices at which different
portions were bought ? What else should I be careful of while
using
MKT order type.

Thanks.


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



Your use of Yahoo! Groups is subject to

r
------------------------------------------------------------------------------------
CZIRNICH , WOLF und Kollegen
Rechtsanwaelte

Rechtsanwalt Christian Czirnich
Taetigkeitsbereich EDV- und Onlinerecht
Fachjournalist fr Rechtsthemen

Noerdliche Auffahrtsallee 65
80638 Mnchen
Tel.: +49-89-17862-112
Tel.: 0700-CZIRNICH
Fax: 49-89-17862-120

E-Mail: christian.czirnich@...
URL: www.onlinekanzlei.de

Join [email protected] to automatically receive all group messages.