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
IB TWS connection
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: IB TWS connection
see post #7Hi,
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
[FAQ] This Bar on Close
viewtopic.php?f=16&t=10811
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: IB TWS connection
See the comparison table for the differences between both MC .NET for TWS versions.Btw, Is the Multicharts.NET provided for IB customers the full version?
http://ibkb.interactivebrokers.com/article/2143
Re: IB TWS connection
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
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
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: IB TWS connection
Hello meo,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.
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.
Re: IB TWS connection
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?
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?
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: IB TWS connection
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.