IB TWS connection

Questions about MultiCharts and user contributed studies.
meo
Posts: 26
Joined: 23 Apr 2012
Has thanked: 3 times
Been thanked: 1 time

IB TWS connection

Postby meo » 15 May 2014

Hi,

I am currently using Multicharts Powerlanguage to connect to TWS for testing. The orders lagged pretty badly. Orders are submitted by Multicharts (from logs in output screen) but they did not appear in the TWS panel until sometimes later. (2-30+ sec lag). I tried to execute the orders manually in TWS and it did not lag.

Is there anything I did wrongly? e.g. configuration at TWS? or orders type in Multicharts?
Below is my code snippet for order entry
buy(symbolName&"_BUY") tradeSize contract this bar at close;
sellshort(symbolName&"_SELLSHORT") tradeSize contract this bar at close;

There will be hundreds of orders sent before eventually getting filled....

Please advice!


Btw, Is the Multicharts.NET provided for IB customers the full version?
http://ibkb.interactivebrokers.com/article/2143

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: IB TWS connection

Postby TJ » 15 May 2014

Hi,

I am currently using Multicharts Powerlanguage to connect to TWS for testing. The orders lagged pretty badly. Orders are submitted by Multicharts (from logs in output screen) but they did not appear in the TWS panel until sometimes later. (2-30+ sec lag). I tried to execute the orders manually in TWS and it did not lag.

Is there anything I did wrongly? e.g. configuration at TWS? or orders type in Multicharts?
Below is my code snippet for order entry
buy(symbolName&"_BUY") tradeSize contract this bar at close;
sellshort(symbolName&"_SELLSHORT") tradeSize contract this bar at close;

There will be hundreds of orders sent before eventually getting filled....

Please advice!


Btw, Is the Multicharts.NET provided for IB customers the full version?
http://ibkb.interactivebrokers.com/article/2143
see post #7
[FAQ] This Bar on Close
viewtopic.php?f=16&t=10811

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: IB TWS connection

Postby JoshM » 18 May 2014

Btw, Is the Multicharts.NET provided for IB customers the full version?
http://ibkb.interactivebrokers.com/article/2143
See the comparison table for the differences between both MC .NET for TWS versions.

meo
Posts: 26
Joined: 23 Apr 2012
Has thanked: 3 times
Been thanked: 1 time

Re: IB TWS connection

Postby meo » 22 May 2014

Hi,

I have tried changing my orders to next bar on market/open but to no avail.. The order still does not reach TWS in a timely fashion. Sometimes it doesn't even reach it at all.

Question on the submitting of orders:
If a condition is TRUE and an order is submitted (but not yet executed), and the code runs again and the condition is still TRUE. Is the "same" order submitted? How does MultiCharts or (is it at the broker end) that handles this?
I am seeing many resubmitting of the orders through my print log.


Could the problem be I am using a demo IB account for testing?
I can paste my code here to see if I did anything wrong.


Thanks and regards,
Meo

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: IB TWS connection

Postby Andrew MultiCharts » 22 May 2014

Hi,
Question on the submitting of orders:
If a condition is TRUE and an order is submitted (but not yet executed), and the code runs again and the condition is still TRUE. Is the "same" order submitted? How does MultiCharts or (is it at the broker end) that handles this?
I am seeing many resubmitting of the orders through my print log.
Hello meo,

If there is a line in your code that generates an order at current script calculation, this order will be sent on next bar open. If on next bar close the same line of code generates absolutely the same order, the order is maintained. If it generates the same order, but with a different number of contracts (for example), the submitted order is cancelled and replaced with a new one (only IB supports modification, for all other brokers it is cancelled and replaced). If it doesn't generate the order, the submitted order is simply cancelled.

meo
Posts: 26
Joined: 23 Apr 2012
Has thanked: 3 times
Been thanked: 1 time

Re: IB TWS connection

Postby meo » 22 May 2014

Hi Andrew,

I am using Intrabarordergeneration. Could it be the case where a tick comes in and the price has moved causing my market order not to be filled? I will do some more testing. Could using limit or stop order help?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: IB TWS connection

Postby Andrew MultiCharts » 22 May 2014

MultiCharts cannot fill orders, if we are talking about trading using a broker account. If you place market orders with your broker and they are not filled for a reason, please contact your broker to find out why.


Return to “MultiCharts”