Custom Fitness Function over a Specific Optimization Period  [SOLVED]

Questions about MultiCharts and user contributed studies.
Adrian Uncle
Posts: 66
Joined: 26 Nov 2015
Has thanked: 7 times
Been thanked: 3 times

Custom Fitness Function over a Specific Optimization Period

Postby Adrian Uncle » 20 Mar 2016

Hi there,

How do I modify the code below so that I can specify the custom fitness function from June 1, 2008 to April 23, 2009? Let's say that I want minimum profit of $1,000 from June 1, 2008 to April 23, 2009 during my optimization from 2000 to 2016.

Code: Select all

if (StrategyPerformance.MaxStrategyDrawDown != 0)
{ return StrategyPerformance.NetProfit ;}


User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Custom Fitness Function over a Specific Optimization Per  [SOLVED]

Postby JoshM » 21 Mar 2016

How do I modify the code below so that I can specify the custom fitness function from June 1, 2008 to April 23, 2009? Let's say that I want minimum profit of $1,000 from June 1, 2008 to April 23, 2009 during my optimization from 2000 to 2016.
That Javascript-like code that you're trying to use here cannot access date and other information from the strategy and the chart. Luckily, there's also another approach to code a custom criteria.

When you use the SetCustomFitnessValue() keyword in your strategy, then you can use the PowerLanguage date format to code June 1, 2008 till April 23, 2009.


Return to “MultiCharts”