Sharing a piece of code for calculating geometric returns. The relevant basic knowledge has already been discussed in the article. Those who need it can take it for themselves. It requires VS software and a Python environment. Those who need it can search for tutorials to install. If you need the code, please leave a message in the comments; directly copying and pasting format will be swallowed.#交易理论

1. Part of the code

2. Part of the code and results

  • After long-term trading, an average win rate and profit-loss ratio for a person can be obtained. However, it should be noted that some people close positions after making a little profit but hold onto losing trades, which can lead to a 100% win rate and exaggerated profit-loss ratio. Therefore, the calculations in the code cannot be the sole evaluation of a person's trading level; it should also be combined with the previously mentioned drawdown rate and the Sharpe ratio that I will discuss later.

  • From the parameters I provided in the figure, it can also be seen that under the condition of a profit-loss ratio of 1:1, performing 1000 market price trades with a 5% position each time (with high fees) requires a win rate of 63.15% to only achieve 4.84%. Therefore, in high-frequency trading, transaction fees are a critical aspect that traders need to consider and cannot ignore.

Just returned to the article format, still a bit rough~~$BTC

$ETH