building-winning-algo-tradi.../ii_chap7_detailed_analysis.md

59 lines
4.3 KiB
Markdown

# Chapter 7. Detailed Analysis
Use Monte Carlo Analysis at later stage.
## What is Monte Carlo Analysis/Simulation
Author's Monte Carlo Simulation Excel sheet is not appropriate for me, read
* [Monte-Carlo Simulation Engine](https://medium.com/fintechexplained/monte-carlo-simulation-engine-in-python-a1fa5043c613) for reference
Benefit of Monte Carlo Simulation, Answering following questions:
* What's my **risk of ruin (account get wiped out)** for a given account size?
* What are the chance of my system's having a maximum drawdown of X percent? (How dangerous is my strategy)
* What kind of annual return can I expect from this trading system?
* Is the risk I am taking to trade this strategy appropriate? for the return I am receiving?
## Inputs to Monte Carlo Simulation
* **Base Starting Equity**
* **Stop Trading if Equity Drops Below $**: threshold consider account "ruined"
* **# Trades, 1 Year**, (not so important for me)
* **Individual Trade Results** (should be calculated by python)
## Simulator Output
Output sheet should contain:
* **Starting Equity**
* **Risk of Ruin**: within a year's time, the percentage of account drop below threshold
* It's obvious that larger starting equity mean lower chances of ruin
* **Median Drawdown**: Median value of **maximum drawdown**. Maximum drawdown is the maximum percentage drop in account size from an equity peak (measured from the previous equity peak).
* e.g. $5,000 drawdown, after peak equity of $20,000 = $5,000 / $20,000 = 25 percent drawdown
* For every simulation iteration, there will be one maximum percentage drawdown. Then iterations form a distribution (from 0% to 100%). Median is from this distribution.
* No reason why use median, also can use mean if it makes more sense.
* **Median $ Profit, Median Return**: similar as median drawdown
* **Return/Drawdown (aka Calmar Ratio calculated over 3-year)**: Considered most important.
* This ratio shows "it takes Y risk to make X"
* Higher, the beteer
* **PROB > 0**: the percentage that the system will make money in the first year of trading.
Important Performance Parameter
| Parameter | Source | Utilized During | Threshold |
| ----------------------------------------- | ---------------------- | --------------- | ------------------------------------------------ |
| Total net profit | Performance Report | Initial Review | ~$10K per year per contract |
| Profit Factor | Performance Report | Initial Review | > 1.0 OK, > 1.5 ideal |
| Average trade net profit | Performance Report | Initial Review | >$50 per contract |
| Tharp Expectancy | Performance Report | Initial Review | >0.10 |
| Slippage and commission | Performance Report | Initial Review | Discard if $0, otherwise $5 commission 1-2 ticks |
| Maximum Drawdown | Performance Report | Initial Review | Should be much smaller than total net profit |
| Equity curve Slope | Equity Curve | Initial Review | Ideally rises at 45-degree angle |
| Equity curve flat periods | Equity Curve | Initial Review | Short in duration |
| Equity curve drawdown, depth and duration | Equity curve | Initial Review | Proportional to overall curve |
| Equity curve fuzziness | Equity curve | Initial review | Small is ideal |
| Risk of ruin | Monte Carlo simulation | Detail review | < 10% |
| Median maximum drawdown | Monte Carlo simulation | Detail review | < 40% |
| Median % return | Monte Carlo simulation | Detail review | > 40% |
| Return/drawdown ratio | Monte Carlo simulation | Detail review | >2.0 |