Marketposition is different in MultiCharts and IB

Questions about MultiCharts and user contributed studies.
ctu1121
Posts: 128
Joined: 05 Jul 2012
Has thanked: 9 times
Been thanked: 4 times

Marketposition is different in MultiCharts and IB

Postby ctu1121 » 27 Aug 2012

Hi,
I use the following code to check marketposition in MultiCharts:

value1=marketposition;
print("marketposition=",value1);

the result is "marketposition=1"

I have confirmed that there is no position in my InteractiveBrokers paper account.
My Strategy Properties/Auto trading setting is as attached file. Please advise which setting I should change in order to make marketposition the same in MultiCharts and InteractiveBrokers paper account.

Thanks!

Charles
Attachments
照片 (7).JPG
照片 (7).JPG (689.23 KiB) Viewed 172 times

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

Re: Marketposition is different in MultiCharts and IB

Postby Andrew MultiCharts » 27 Aug 2012

"MarketPosition" keyword checks the market position on chart.
"MarketPosition_at_broker" keyword checks the market position at broker.
The chart and broker positions may mismatch if AA mode of auto trading is used, or there was an issue during auto trading in SA mode (an order did not receive final status from broker), or there were manual orders, or there was another chart autotrading on the same symbol.

As i can see on your screenshot, AA mode of auto trading is used. One should not expect that in this mode chart and broker positions will be the same.


Return to “MultiCharts”