Message from IB of open position

Posted By: OptimusPrime

Message from IB of open position - 06/24/19 15:22

>> Is there a message or field from IB that I can check in my Zorro script to determine if IB has open positions in the currency pair I am trading? I am currently demo-ing my script.

I sometimes have positions that are open in IB while Zorro has closed out all positions.

I will retrace my steps to debug my script but in the meantime, I want an automated way to detect when this has happened without manually checking the IB Gateway position window.
Posted By: jcl

Re: Message from IB of open position - 06/24/19 15:41

Not for currency pairs. IB supports positions only for stocks, futures, or options.
Posted By: Zheka

Re: Message from IB of open position - 06/25/19 13:58

There is a setting in TWS/IBG->Config->API -> Include Virtual FX positions when sending a portfolio".

https://www.interactivebrokers.com/...g/fx_portfolio_-_virtual_fx_position.htm

When checked, positions returned by reqPositions and similar requests will include Virtual FX positions, i.e. "positions opened in currency pairs" rather than just net cash currency balances.
So, this info is available via API.
Posted By: jcl

Re: Message from IB of open position - 06/26/19 12:59

Thanks for the info!
© 2024 lite-C Forums