PortfolioEntriesPriority  [SOLVED]

Questions about MultiCharts and user contributed studies.
rgranero
Posts: 56
Joined: 26 Jul 2010
Has thanked: 4 times
Been thanked: 1 time

PortfolioEntriesPriority

Postby rgranero » 18 Jun 2019

Hi,

I wrote a signal to buy at the start of each year the only one stock with the highest momentum:

value1=(c-c[250])/c*100;
PortfolioEntriesPriority=value1;
if marketposition=0 then buy next bar at open;
if year(date)>year(date)[1] then sell this bar at close;

I don't know why the backtester buy also the other stocks (few shares). Where is the mistake?

In attachment the result and the setting.

Thanks for the help
Riccardo
Attachments
Setting.gif
(184.51 KiB) Downloaded 167 times
Result.gif
(111.27 KiB) Downloaded 167 times

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: PortfolioEntriesPriority  [SOLVED]

Postby ABC » 18 Jun 2019

Riccardo,

your setup doesn't utilize a Portfolio Money Management Signal (PMMS) that would be required to effectively control the number of entries.
In your setup all symbols are allowed to enter (according to your code) and while the one with the highest priority might receive the largest amounts of shares, there might be money left for additional symbols that are not restricted from an entry.

The reserved word PortfolioEntriesPriority dates back to a time when the PMMS functionality was not available and to gain the required control within a Portfolio it's best to use the combination of entry signals and a complementing PMMS. You can take a look at the built-in portfolio strategies and their explanation within the Wiki for examples of how they can work together.
https://www.multicharts.com/trading-sof ... y_Examples

Regards,

ABC

rgranero
Posts: 56
Joined: 26 Jul 2010
Has thanked: 4 times
Been thanked: 1 time

Re: PortfolioEntriesPriority

Postby rgranero » 18 Jun 2019

Ok, thanks a lot.


Return to “MultiCharts”