Page 1 of 1

Portfolio Trader Rank/Priorization

Posted: Aug 21 2021
by Jonny473
https://drive.google.com/file/d/1dUGV-f ... sp=sharing

Lets say I have number of X instruments in my Portfolio Trader Strategy.
I have one strategy applied. This strategy contains, besides calculations only based on the instrument itself, also a rank/ PortfolioEntriesPriority function.
What do I want to do here: I want the strategy to rank instruments based on an indicator (like relative Strength, RSI, etc.) and only want to continue with the best X% ones.
I tried different approaches but not working so far.
https://www.multicharts.com/trading-sof ... esPriority
This example is given: The higher price, the higher the priority. Ok, but how to continue here and how to implement into a strategy. See below that this is not working correctly.
PortfolioEntriesPriority = (-Close);

Approach 1:

Code: Select all

variables: MyR( 0 ) ; MyR = ((Close of Data1 / Close[100] of Data1) - (Close of Data2 / Close[100] of Data2) / (Close of Data2 / Close[100] of Data2)); PortfolioEntriesPriority= MyR; Buy ("MyR") next bar open; setexitonclose;
Here is a rank strategy officially mentioned here:
https://www.multicharts.com/trading-sof ... y_Examples

Code: Select all

Vars= BarNo2(0),MyIndicator(0),R(0); BarNo2= BarNumber of data2; If BarNo2>BarNo2[1] then Begin R = (C of data2 - C[1] of data2) / C[1] of data2; MyIndicator= (R - AvgReturn ) / Sdev end; {Retrieve MyIndicator Rank. Rank is from 1 to 500 since our universe is 500 Stocks} If Rank<=10 then Buy 200 contracts next bar at O; {Go Long the best 10 stocks} Else If Rank>=490 then SellShort 200 contracts next bar at O; {Go Short the worse 10 stocks}
Dont know how to interpret this example? It has a lot of bugs in it:
Rank function normally needs 4 parameters, here none are mentioned.

Here is the official rank strategy:

Code: Select all

inputs: Basedondata(1), TraceOutput(false); var:BarN(0),R(0); // *** restrictions once if barstatus(BasedOnData) < 0 then raiseruntimeerror("Portfolio Rank Signal Base needs datastream " + numtostr(BasedOnData, 0)); once if 1 <> getappinfo(aiisportfoliomode) then raiseruntimeerror("Portfolio Rank Signal Base can be applied for MCPortfolio application only."); // **************** value1=RelStaerke_0_100(Close,200); BarN = BarNumber; if BarN > BarN[1] then begin R = value1; pmm_set_my_named_num("value1", R); end; begin var: MoneyCostForInvestPerCtrct(0), potential_entry_price(close); MoneyCostForInvestPerCtrct = pmms_calc_money_cost_for_entry_per_cntrct(potential_entry_price, Portfolio_GetMarginPerContract) + pmms_calc_money_cost_for_entry_per_cntrct(potential_entry_price, Portfolio_GetMaxPotentialLossPerContract); if 0 > MoneyCostForInvestPerCtrct then raiseruntimeerror( text("Error! Price = ", potential_entry_price:0:6, "PMargin = ", Portfolio_GetMarginPerContract, "PMaxPLoss = ", Portfolio_GetMarginPerContract) ); // MoneyCostForInvestPerCtrct in currency of the symbol. Convert it to portfolio currency ... pmm_set_my_named_num("MoneyCostForInvestPerCtrct", pmms_to_portfolio_currency(MoneyCostForInvestPerCtrct)); end; buy 1 share next bar open; if barssinceentry>100 then sell all shares this bar close;


At the same time I am applying the Portfolio_Rank_MM_Signal as MM Signal here.


This does also not work.
What am I doing wrong? Can you please support here by sending me an example code. I should not be the first person asking this question and I saw couple of people raising this question in the forum. Unfortunately there was no clear example given, at least none worked for me.

„I have one strategy applied. This strategy contains, besides calculations only based on the instrument itself, also a rank/ PortfolioEntriesPriority function.
What do I want to do here: I want the strategy to rank instruments based on an indicator (like relative Strength, RSI, etc.) and only want to continue with the best X% ones.“

Re: Portfolio Trader Rank/Priorization

Posted: Mar 12 2024
by ATCOTrader
Hi,

Have you found a solution to this? I have the same problem and have been trying to figure it out for some time now but nothing is working...

Regards

Re: Portfolio Trader Rank/Priorization

Posted: Apr 11 2024
by Zordan3274
Agree, all the examples provided below don't work. None of the below suggested rotation/ ranking code works,

https://www.multicharts.com/trading-sof ... amples.pdf
https://www.multicharts.com/trading-sof ... k_Strategy

Has anyone managed to find a working ranking code based on a defined indicator. eg ROC or RSI?

Re: Portfolio Trader Rank/Priorization

Posted: Jun 13 2024
by ATCOTrader
Sorry to hear that, it would be very useful if it worked!

Re: Portfolio Trader Rank/Priorization

Posted: Jun 21 2024
by tc12345
Multicharts is this working?

Re: Portfolio Trader Rank/Priorization

Posted: Jun 26 2024
by Polly MultiCharts
Dear Users,

These pre-built signals are working on our end.
Please apply a specific pair of strategies to the portfolio in the Signals and Portfolio MoneyManagement Signal sections

Let’s take the Portfolio Rank signal as an example.
  • Portfolio Rank Signal Base should be used in the signals section on the Portfolio tree on the left.
  • Portfolio Rank MM Signal should be applied to the Money Management signal section.
Then please add the number of instruments specified in the inputs to the signal:

Code: Select all

BuyBestN(5), SellWorseN(5),
We have checked this setup on our end and it works.

Let’s take another example:
  • Portfolio_SpreadTradingSystem.Master
  • Portfolio_SpreadTradingSystem.Slave
You need to arrange the symbol in a cross order: you need to have identical list of symbols in the first and the second data series column but you need to have it crossed like
1 2
2 1
You can also refer to this forum thread for additional info.

If you have some specific issues with the strategies, please forward your requests to our support email for detailed investigation.