MarketPosition_at_Broker

Questions about MultiCharts and user contributed studies.
SUPER
Posts: 622
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 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: 2074
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1523 times
Been thanked: 1479 times
Contact:

Re: MarketPosition_at_Broker

Postby JoshM » 19 Apr 2012

SUPER wrote: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).

SUPER wrote: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).
These users thanked the author JoshM for the post (total 2):
SUPERHenry MultiСharts

SUPER
Posts: 622
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 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: 8378
Joined: 25 Aug 2011
Has thanked: 1199 times
Been thanked: 2677 times

Re: MarketPosition_at_Broker

Postby Henry MultiСharts » 20 Apr 2012

SUPER wrote:
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.
These users thanked the author Henry MultiСharts for the post (total 2):
SUPERTJ


Return to “MultiCharts”