Solid foundation for Portfolio Trader?

Questions about MultiCharts and user contributed studies.
User avatar
ZaphodB
Posts: 64
Joined: 12 Feb 2019
Has thanked: 20 times
Been thanked: 2 times

Solid foundation for Portfolio Trader?

Postby ZaphodB » 07 Apr 2022

I have a decent amount of experience with MC now but have never used Portfolio Trader. I really should have used it earlier because it looks like the best way to test strategies that don't need IBOG or bar magnifier. It is also really cool to think about trading hundreds of symbols and having that level of diversification (going to be using daily bars). That being said, I've read what I could find so far about Portfolio Trader but still am uncertain about a few things and I was hoping some of you more experienced users could help point me down the right path.

My strategy will probably exit most positions with a market order on open. I'm undecided if entering positions will be done at market on open or with a greedier limit price that may or may not get filled during the day.

One of my main questions is if a PMM signal closes a position during a round of calculations, will that freed up equity be available for entries during the same round of calculations? I was unable to find a PMM keyword that speaks to this

My second main question is if there is a way to divide up equity evenly between the number of symbols that happen to have a trade signal. It will of course be unknown in advance X number of symbols that have a trade signal. I'd like it to trade "Equity/X" for the symbols that have a signal. (Obviously, it will have to round down the number of shares based on the share price.)

In the past, I have placed my entry and exit signals all in one strategy. It seems like the best approach with PT is to put the exits in a separate strategy to be used as a Money Management signal. However, is it advisable to leave the long and short code in the same entry strategy?

Lastly, is there a quick way to add all the symbols in an index like the SP500 or NQ100?

Any other words of wisdom are appreciated as I make the switch and try out a new idea.

Axel
Posts: 7
Joined: 26 Jan 2022
Has thanked: 3 times

Re: Solid foundation for Portfolio Trader?

Postby Axel » 11 Apr 2022

I think the Portfolio Trader is a great piece of software. I don't really know the answer to your 2 first questions but if I had to guess... Syncing between symbols is probably easier in MC.NET or, if you perhaps could do something with a global variable. Honestly don't know if that is possible - I've thought about capital allocation in Portfolio Trader too but haven't solved it yet.

When I want to look at all the stocks on NASDAQ for example, I scan for them (and perhaps use criterias such as Market Cap) using the TS scanner. I then save them to a .csv file which I then import. Perhaps there is an easier way, but this one is pretty quick. You can always save this portfolio as a blank "NASDAQ" one, which saves you from having to add them again in the future.

User avatar
ZaphodB
Posts: 64
Joined: 12 Feb 2019
Has thanked: 20 times
Been thanked: 2 times

Re: Solid foundation for Portfolio Trader?

Postby ZaphodB » 13 Apr 2022

Thanks for the info! I wonder if there's some way to have the MM signal have the entry logic for each symbol and if the entry logic is true, "print" a log/count. Then this could be referenced by the actual entry strategy so it can divide capital by the number of symbols entry logic was true for. I haven't worked with much outside standard indicators and signals. Maybe this would require the use of vectors or dll's but this is where it starts sounding Greek to me. I'm willing to learn how to use .dll's etc but I could use some help in setting me off in the right direction

User avatar
c0ntango
Posts: 70
Joined: 13 Sep 2018
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Solid foundation for Portfolio Trader?

Postby c0ntango » 14 Apr 2022

-> One of my main questions is if a PMM signal closes a position during a round of calculations, will that freed up equity be available for entries during the same round of calculations? I was unable to find a PMM keyword that speaks to this

You could write a test to figure this out if absolutely necessary, but to me it shows that you are probably focusing on something not so productive in your strategy development, if you're stuck with this. Of course I might be wrong.

-> My second main question is if there is a way to divide up equity evenly between the number of symbols that happen to have a trade signal. It will of course be unknown in advance X number of symbols that have a trade signal. I'd like it to trade "Equity/X" for the symbols that have a signal. (Obviously, it will have to round down the number of shares based on the share price.)

The processing of data, instruments and signals in PMM is sequential, so if several things happen on different signals on the same exact bar, that can only be processed one by one in a sequence. For what you are asking, you need to have the results of all of those calculations on the very last "run". You can access that data by sharing it with global variables or with PM's version of them, but you then have to make a decision to do your position sizing after, which is not going to be possible to do with MC itself, unless you're deploying some solution to enter on a different bar, where you have access to that calculation that's in the past. In short, to achieve this you will need an external execution system for this that manages your capital and calculates your position sizes.

User avatar
ZaphodB
Posts: 64
Joined: 12 Feb 2019
Has thanked: 20 times
Been thanked: 2 times

Re: Solid foundation for Portfolio Trader?

Postby ZaphodB » 15 Apr 2022

-> One of my main questions is if a PMM signal closes a position during a round of calculations, will that freed up equity be available for entries during the same round of calculations? I was unable to find a PMM keyword that speaks to this

You could write a test to figure this out if absolutely necessary, but to me it shows that you are probably focusing on something not so productive in your strategy development, if you're stuck with this. Of course I might be wrong.
Thanks for the info. I could write a test, it's not a bad idea, I was just hoping to get some info from others that may have tried the same thing. It seems like activity on this forum has died off over the past couple years. Have people moved to a different forum?

I was wondering about exiting one symbol and entering another with the same equity on the same daily bar more from a live trading standpoint. I wouldn't want equity going unused if there's an entry signal on another symbol. Not a problem if, instead of using PT, I just used separate charts and used IBOG. However, it'd be nice to be able to use Portfolio Trader and the features it has, I think. I really don't know much about PT and I'm all ears for any general advice too.

User avatar
c0ntango
Posts: 70
Joined: 13 Sep 2018
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Solid foundation for Portfolio Trader?

Postby c0ntango » 16 Apr 2022

My general advice: use PT for backtesting, and avoid, at all costs, using it for live execution. Go for your separate charts with IBOG, your execution stack will be more stable.

Hope that helps.

User avatar
ZaphodB
Posts: 64
Joined: 12 Feb 2019
Has thanked: 20 times
Been thanked: 2 times

Re: Solid foundation for Portfolio Trader?

Postby ZaphodB » 19 Apr 2022

My general advice: use PT for backtesting, and avoid, at all costs, using it for live execution. Go for your separate charts with IBOG, your execution stack will be more stable.

Hope that helps.
Appreciate it!

amw_775
Posts: 23
Joined: 19 Apr 2020
Has thanked: 1 time
Been thanked: 11 times

Re: Solid foundation for Portfolio Trader?

Postby amw_775 » 11 Mar 2023

Hi I just wanted to add my opinion

I had initally started using MC autotrading using 1 symbol per chart. - it was the biggest headache and full of bugs especially when intra bar generation was turned ON. ( If there were more than 10 charts MC woul hang / crash or autotrading would automatically turn of)

I switched to Portfolio trader. It has been the best trading decision of my life. Im able to trader over 50 symbols with multiple strategies.
Im using Portfolio trader in a Master Slave setup and also for Pair Trading. Basically I run a Primary Strategy in a Master account with 50 symbols and I have 10 Slave client accounts where positions from the Master Account are copied to the Slave accounts. Not just that, often there are position mismatches between multicharts strategy engine and the broker and my portfolio trader strategy automatically syncronizes the position between MC strategy engine and Broker.


You can also mimic the behavior of Intra bar persist and intrabar order generation by using the commands " recalculate last bar after X seconds").
To get the the real time equity after the position is closed you have 2 options - either use "recalc last bar after" ( This option is more CPU intensive) or alternatively Right Click on the Strategy in Portfolio Trader goto Show Properties> Auto Trading > Recalculate On Broker Events > Select all three options - Market Position Change, Order Rejected, Order Filled. This recalculates the strategy on either of these events which should sever your purpose


Return to “MultiCharts”