automatic trading with interactive brokers

Questions about MultiCharts and user contributed studies.
turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

automatic trading with interactive brokers

Postby turbofib » 01 Jul 2013

i set up as the below pic. settings on interactive brokers are correct, but it can't connect to the automatic trading gateway, thus the trading system is not executed.
2.PNG
(56.85 KiB) Downloaded 828 times
Attachments
4.PNG
(52.83 KiB) Downloaded 820 times

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: automatic trading with interactive brokers

Postby evdl » 01 Jul 2013

You must fill in the master api client id in TWS. And also use the same in MC. You can use 1 for example.

In the brokerprofile setup in MC, you use the same settings.

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: automatic trading with interactive brokers

Postby turbofib » 02 Jul 2013

I did it but does not work
Attachments
simon17.png
(25.86 KiB) Downloaded 829 times
simon16.png
(35.29 KiB) Downloaded 824 times

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: automatic trading with interactive brokers

Postby turbofib » 02 Jul 2013

also when I enable Automate Order Execution me disappears from the graph historical trading system
Attachments
simon18.png
(28.96 KiB) Downloaded 796 times

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

Re: automatic trading with interactive brokers

Postby TJ » 02 Jul 2013

I did it but does not work
do you also have a TWS opened?

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: automatic trading with interactive brokers

Postby turbofib » 02 Jul 2013

yes..i have tws open

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

Re: automatic trading with interactive brokers

Postby Andrew MultiCharts » 02 Jul 2013

i set up as the below pic. settings on interactive brokers are correct, but it can't connect to the automatic trading gateway, thus the trading system is not executed.
If the [SA] or [AA] button is green, it means you are connected to the broker account and automated trading is enabled. If you don't see orders on your chart, most likely the conditions for order generation are not met or the generated orders are rejected.
I did it but does not work
We recommend to use 0 for Client ID in order to let MultiCharts "see" all orders and positions and not only the ones, which were opened from our software.
also when I enable Automate Order Execution me disappears from the graph historical trading system
This is expected behavior. Please read about modes of auto trading.

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: automatic trading with interactive brokers

Postby turbofib » 02 Jul 2013

Now I read Submitted but orders are not executed ..

my program:

inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;

var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;

condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
Attachments
simon21.png
(12.13 KiB) Downloaded 803 times
simon20.png
POSITION TRACKER
(23.36 KiB) Downloaded 806 times

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: automatic trading with interactive brokers

Postby turbofib » 02 Jul 2013

i wonder if the different symbol format could be a problem. For istance: i have esignal as datafeed, while my broker is interactivebroker. Obviously they have different symbol for the same istrument. Is this an issue? Or the API does the translation automatically?


In symbol mapping i can't find the way to bind the 2 symbols
Attachments
5.PNG
(21.68 KiB) Downloaded 818 times

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

Re: automatic trading with interactive brokers

Postby Andrew MultiCharts » 02 Jul 2013

Now I read Submitted but orders are not executed ..
MultiCharts is not a broker, it is a trading platform only, what means that our software is not responsible for order execution when you trade with your broker. The software places/modifies/cancels orders according to your strategy. The broker executed the orders.
i wonder if the different symbol format could be a problem. For istance: i have esignal as datafeed, while my broker is interactivebroker. Obviously they have different symbol for the same instrument. Is this an issue? Or the API does the translation automatically?
In symbol mapping i can't find the way to bind the 2 symbols
If the symbols names are different, symbol mapping should be set up manually. However, if an order is submitted in Order and Position Tracker window, mapping should be ok.


Return to “MultiCharts”