Portfolio Trader and Market Position  [SOLVED]

Questions about MultiCharts and user contributed studies.
TraderWalrus
Posts: 63
Joined: 13 Sep 2016
Has thanked: 30 times
Been thanked: 7 times

Portfolio Trader and Market Position

Postby TraderWalrus » 12 Nov 2017

I am using Portfolio Trader to automated a strategy on daily bars. Naturally I cannot keep it running continuously throughout the time a position is open.

Entries are done with a market order and exits using a stop and limit orders submitted at the time of entry and do not change later on - so there is no order management after entry and I don't need Portfolio Trader to handle that aspect. I can turn it off and the orders are still on the broker's (IB) server, in an OCA group.

However, I do need the script to know if there is an existing position, to prevent another one from being opened in parallel, when I reactivate Portfolio Trader.

Most documentation I saw about marketposition, marketposition_at_broker, and the synchronizer script !From Broker To Strategy MP Synchronizer! seem to refer to charts.

What should I use to detect an existing position with scripts running on Portfolio Trader?

User avatar
Svetlana MultiCharts
Posts: 71
Joined: 19 Oct 2017
Been thanked: 21 times

Re: Portfolio Trader and Market Position

Postby Svetlana MultiCharts » 15 Nov 2017

Hello, TraderWalrus,

The commands you have listed, as well as the pre-built autotrading signal !From Broker To Strategy MP Synchronizer! will work not only on chart but in the PortfolioTrader too.
These users thanked the author Svetlana MultiCharts for the post:
TraderWalrus

TraderWalrus
Posts: 63
Joined: 13 Sep 2016
Has thanked: 30 times
Been thanked: 7 times

Re: Portfolio Trader and Market Position

Postby TraderWalrus » 15 Nov 2017

Thank you Svetlana - could you advise for the case I described - is the synchronizer script necessary or is it enough to use marketposition_at_broker ?

User avatar
Svetlana MultiCharts
Posts: 71
Joined: 19 Oct 2017
Been thanked: 21 times

Re: Portfolio Trader and Market Position  [SOLVED]

Postby Svetlana MultiCharts » 20 Nov 2017

If you want only to check the position at broker – you can use the “MarketPosition_at_Broker” command in your own code.

But if you want your strategy to also manage this position – it would be better to utilize the !From Broker To Strategy MP Synchronizer! signal, since it already has the position synchronization logic implemented with the help of the ChangeMarketPosition command.
These users thanked the author Svetlana MultiCharts for the post:
TraderWalrus


Return to “MultiCharts”