vnpy / vnpy_ctastrategy

VeighNa框架的CTA策略模块
https://www.vnpy.com
MIT License
110 stars 116 forks source link

建议把线性年化收益计算方式 改为 复利增长的年化收益计算方式 #57

Open szshower opened 1 month ago

szshower commented 1 month ago

https://github.com/vnpy/vnpy_ctastrategy/blob/1125ae953b6721f45ecfd7c212f91abddcaaa6c6/vnpy_ctastrategy/backtesting.py#L389

import math

annual_return: float = (math.pow(end_balance / self.capital, 240 / total_days) - 1)*100