¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Newbie Help on Code !!


marinindextrader
 

You are correct.

I am sorry for the confusion.

The variable in the TWS1 call was "price" not "lmtPrice", and was
sending a null value to TWS.

I changed the file and uploaded it correctley. I left it as a MKT
order.

Your code should look like this.


Call PlaceNewOrder("BUY", 1, "ES", "FUT", "200209",
0, "", "GLOBEX", "", "LMT", 850#, 0#)


Call Tws1.placeOrder(newID, action, quantity, symbol, secType,
expiry, strike, right, exchange, _
curency, orderType, lmtPrice, auxPrice)

Thanks for pointing out the flaw.


Scott

--- In twsapi@y..., "larrysy.geo" <larrysy@m...> wrote:
Hi Scott,

Thanks for the quick reply, but it didnt work. I was tinkering
with
the 1_Project_PlaceOrder.zip in the files section. The
PlaceNewOrder is a subroutine in that program. The demo program
sends out MKT orders - if somebody can modify the code to send out
LMT orders, then I'll be on my way to finish my project.

Thanks,

Larry








--- In twsapi@y..., "marinindextrader" <marinindextrader@y...>
wrote:
When using literal declaration [not advised] you must use 888.00
and
0.0

As your type in these literal values...your IDE will then default
the
literal to a Double type and should display 888# and 0#.

Further their is no PlaceNewOrder method...

But there is a placeOrder method...check that too

Let me know if this works

Scott

--- In twsapi@y..., "larrysy.geo" <larrysy@m...> wrote:
Hi,

I'm a newbie tinkering with the VB codes on the file section.
I
want to place a limit order instead of a market order and
modified
the original code to the following line but it wont work - TWS
reports the limit price as 0. What's wrong?

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

Thanks,

Larry

BTW, I'll post my finished program if it works.

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