MarketPosition_at_Broker

Questions about MultiCharts and user contributed studies.
SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

MarketPosition_at_Broker

Postby SUPER » 18 Apr 2012

I would like some clarificaiton for MarketPosition_at_Broker (for IB as broker):

1) Can it get reliable and accurate values from the Broker on every tick

2) What value will be shown when there is sudden loss of internet connection or IB(broker) has lost connection to is server farm

Regards
Super

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

Re: MarketPosition_at_Broker

Postby JoshM » 19 Apr 2012

1) Can it get reliable and accurate values from the Broker on every tick
In my experience, it's accurate, but here there is a delay of around 1-2 seconds between MultiCharts opening a position (MarketPosition(0) change) and the broker communicating the broker position change (MarketPosition_at_Broker change). (If you don't use RecalcLastBarAfter() and the market is slow, this lag is off course possibly a lot more).
2) What value will be shown when there is sudden loss of internet connection or IB(broker) has lost connection to is server farm
From the wiki page:
If Automated Trading was manually turned off by the user, the value returned by the keyword stops changing, and may remain unequal to '0'.
(i.e. if MarketPosition_at_Broker returns 2, and the internet connection gets lost, it will continue to return 2. And a loss of internet connection is, for MultiCharts, the same as a strategy that gets disabled manually).

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Re: MarketPosition_at_Broker

Postby SUPER » 19 Apr 2012

JoshM,

Many thanks for your feedback.

My idea was to compare MarketPosition_at_broker and Marketposition Chart before sending order out. Since I use IntrabarOrder, delay in getting values of MarketPosition_at_Broker could cause problems. I will try to incorporate your suggestion of RecalcLastBarAfter() in my code to see if it makes any difference.

Best regards
Super

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: MarketPosition_at_Broker

Postby Henry MultiСharts » 20 Apr 2012


1) Can it get reliable and accurate values from the Broker on every tick
It can lag behind a little on a 1 tick chart if there is more than 1 tick in a second. There should be no lag on a two second chart.


Return to “MultiCharts”