+1 888 340 6572

Performing Optimization: Difference between revisions

From MultiCharts
Line 76: Line 76:
<br>
<br>
== Custom Criteria ==
== Custom Criteria ==
'''Custom Criteria''' lets the user create his own criteria.  Instead of choosing from a pre-defined list like in '''Standard Criteria''', the user can script his own criteria.
For example, suppose the user wants to find the parameters that maximize the Net Profit / Max Drawdown ratio.
This ratio isn't pre-defined under '''Standard Criteria''', so it won't be in the drop-down list. However, this ratio can be created using '''Custom Criteria'''.
It is also possible to add additional criteria such as number of trades and winning percentage.
E.g., it is possible to specify:
the result have more than 300 trades and a winning percentage that's greater than 50%.
<span style="background-color: #E3FBE5;">The scripting language is '''JavaScript'''.</span>
<br>'''Code Example'''
The code below creates the net profit / max drawdown ratio.
&nbsp; &nbsp; &nbsp;&nbsp;<br>if (StrategyPerformance.MaxStrategyDrawDown != 0)
&nbsp; &nbsp; &nbsp;&nbsp;<br>{
&nbsp; &nbsp; &nbsp;&nbsp;<br>return StrategyPerformance.NetProfit / (-&nbsp; &nbsp; &nbsp;&nbsp;<br>StrategyPerformance.MaxStrategyDrawDown);
&nbsp; &nbsp; &nbsp;&nbsp;<br>}
<br>
Besides NetProfit and MaxStrategyDrawdown, there are many other properties that can be referenced.  The table below shows the available properties. 
<br>For example, to reference the number of trades, simply use StrategyPerformance.TotalTrades. 
To reference winning percentage, simply use StrategyPerformance.PercentProfitable.


{| class="wikitable" width="65%"
{| class="wikitable" width="65%"