Performing Optimization: Difference between revisions
From MultiCharts
Line 93: | Line 93: | ||
<br>'''Code Example''' | <br>'''Code Example''' | ||
The code below creates the | The code below creates the Net Profit / Max Drawdown ratio: | ||
<br>if (StrategyPerformance.MaxStrategyDrawDown != 0) | |||
<code> <br>if (StrategyPerformance.MaxStrategyDrawDown != 0) | |||
<br>{ | <br>{ | ||
<br>return StrategyPerformance.NetProfit / (- <br>StrategyPerformance.MaxStrategyDrawDown); | <br>return StrategyPerformance.NetProfit / (- <br>StrategyPerformance.MaxStrategyDrawDown); | ||
<br>} | <br>} | ||
<br> | </code> | ||
Besides NetProfit and MaxStrategyDrawdown, there are many other properties that can be referenced. The table below shows the available properties. | |||
<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. | <br>For example, to reference the number of trades, simply use StrategyPerformance.TotalTrades. | ||
To reference winning percentage, simply use StrategyPerformance.PercentProfitable. | To reference winning percentage, simply use StrategyPerformance.PercentProfitable. | ||
{| class="wikitable" width="65%" | {| class="wikitable" width="65%" |