Programs to interact w/ IB TWS API & place trades

Hi,

I am not familiar with APIs, but wanted to know if there is a possibility to a place bracket orders automatically with only entering a price. The orders then will appear in TWS.

For example:

I want to generate a bracket order for the emini SPX future (ESH7) with predifined parameters (+-6) from an entered price. For ESH7
will be + - 6pts from the entered price (1400).

1) The API will ask me a price for the ESH7
2) I type in 1400
3) the Api generates the follwoing orders:

Buy ESH7 @ 1394.00
Sell ESH7 @ 1396.00 (bracket order)

Sell ESH7 @ 1406.00
Buy ESH7 @ 1404.00 (bracket order)

I do not want the stop loss of the bracket order.Is this possible?
How should I do it with VBA, java? Could someone show me the correct path...

Regards

JB
 
Hi All,

I'm looking into getting TradeStation to interface with IB (i.e. send orders to an IB account) and TWSlink seems to be able to do this. Before I go further and start trying to code something, can someone explain what is required to do this correctly? The TWSlink website has the following code example for TS:

If MarketPosition = 0 Then begin
If Sig < 0 Then begin { section 1.1 }
Sell ("MR_SE") This Bar on Close;
if Timeout = 0 then begin
Print("pos before short: "+NumToStr(GET_POSITIONS(UidContract,""),0));
CUSTOMCOMMENT("Enter Short",0);
{ place sell order, dont transmit to IB}
Oid1=PLACE_ORDER(UidContract,0,"SELL","MKT",OrderSize,0.0,0.0,"GTC",0,-1,"","",-1);

The above would be something I'd write into my strategy, no? I'd want to replace my orders with PLACE_ORDER calls along with the associated position check?

Thanks in advance for any help.

Regards,

Mike
 
Quote from jtnet:

i need to do this for a contest, i dont know how to make an auto system or use IB, never have. I know how to scalp intraday minute charts pretty well though. if i can manual trade and it looks automatic that would be great, lol.

i have to make a minimum of 25 trades in 8 weeks. winner = most money at the end of 8 weeks.

i thought all the contestants did their own code, I never thought they could use commercial applications to

"The Olympiad is open to any undergraduate or graduate student* with programming experience. Trades must be generated by computer algorithms. Students will compete using the same Interactive Brokers' Trader Workstation Application Program Interface (API) that professional traders use to create automated trading solutions. A multitude of programming languages including Java, C++, C, and Visual Basic may be utilized with our API. Student-created algorithms may trade US stocks, options, futures, Forex, or bonds as often as their programs require over the contest period and must make at least 25 trades."

http://www.interactivebrokers.com/en/general/education/IBTradingOlympiad.php
 
Back
Top