I am trying to automate Amibroker strategy with Interactive brokers. I have gone through the whole literature and user groups regarding the same. So i am testing right now in a paper trading account with IB.
Whenever i try to get GetPositionSize, it always returns 0 , irrespective whether there is a position or not. I am trying with the following code:
ibc = GetTradingInterface("IB");
PopupWindow( NumToStr(ibc.GetPositionSize(Name1),1),"Alert for Size",120);
But when it comes to executing order etc, it works fine. Would appreciate if someone can give guidance on this.