Build custom fitness for Portfolio Trader

Questions about MultiCharts and user contributed studies.
Barbo
Posts: 7
Joined: 03 Nov 2021
Has thanked: 4 times
Been thanked: 1 time

Build custom fitness for Portfolio Trader

Postby Barbo » 05 Feb 2022

Hi everyone, i'd like to know if there is a way to build custom fitness in portfolio trader that considers the set of strategies as a single strategy.
I'll explain: i would like to access past positions and those positions would need the date, the time of entry and exit, after i need to process them to build a specific custom fitness.
For a single strategy i have already done it but when i insert it in the trader portfolio and launch the optimizations i think it takes the average of the custom fitness calculated on each strategy and does not calculate it on the set of trades as if they were a single strategy .. does anyone know if there is another way to perform what i need or if i am missing something?
Thank you very much.
Have a nice day.
Barbo

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: Build custom fitness for Portfolio Trader

Postby Svetlana MultiCharts » 25 Feb 2022

i think it takes the average of the custom fitness calculated on each strategy and does not calculate it on the set of trades as if they were a single strategy
Hi Barbo,

Could you reproduce this behaviour in a simplified environment and send us the following files for analysis?
1. The workspace where the behaviour is reproduced.
2. Export of used symbols (with data) from QuoteManager in .qmd archive.
3. The exported scripts with all dependent functions that are used on the workspace.
4. Screenshots and step-by-step instruction how to reproduce the issue, or a short video.

Barbo
Posts: 7
Joined: 03 Nov 2021
Has thanked: 4 times
Been thanked: 1 time

Re: Build custom fitness for Portfolio Trader

Postby Barbo » 25 Feb 2022

Thank you Svetlana, of course i will if necessary, but i think we can solve here: becuase what i'm trying to do is to refer to historical portfolio values to compare them and calculate my own custom fitness. For example.. is it possible to calculate the standard deviation of the portfolio equity curve? To perform that we need to make a calculation for each position, so we need to go back and get the values for each one.
I don't know exactly how customfitness signals works when applied to portfoliotrader.. but my understanding is that for portfolio custom fitness we can use only the portfolio reserved keywords. ( such as portfoliomaxitdrawdown, portfolionetprofit etc.) So if what i'm saying is correct, i'm trying to perform something that can't be calculated, if not i I kindly ask you to explain me..
Thank you.

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: Build custom fitness for Portfolio Trader

Postby Svetlana MultiCharts » 01 Mar 2022

Please refer to this thread.

Pre-built function Portfolio_Equity() can be used to calculate Portfolio Equity Curve:

Code: Select all

var : PE(0); PE = Portfolio_Equity();
Please refer to this thread for more info about the standard deviation of the portfolio equity curve calculation.


Return to “MultiCharts”