update documents

This commit is contained in:
fasiondog 2024-04-02 17:00:46 +08:00
parent c7d5c105cc
commit 5064e7e3b1
9 changed files with 744 additions and 313 deletions

View File

@ -228,7 +228,15 @@
:param Datetime datetime: 指定时刻
:param Query.KType ktype: K线类型
:rtype: FundsRecord
.. py:method:: get_funds_list(self, datetime, [ktype = Query.DAY])
获取指定日期列表每日资产记录
:param Datetime datetime: 指定时刻
:param Query.KType ktype: K线类型
:rtype: FundsList
.. py:method:: get_funds_curve(self, dates[, ktype = Query.DAY])
获取资产净值曲线

View File

@ -129,4 +129,13 @@
.. py:attribute:: base_cash 当前投入本金float
.. py:attribute:: base_asset 当前投入的资产价值float
.. py:attribute:: borrow_cash 当前借入的资金float即负债
.. py:attribute:: borrow_asset 当前借入证券资产价值float
.. py:attribute:: borrow_asset 当前借入证券资产价值float
只读属性,自动根据上面的属性计算得到的结果:
.. py:attribute:: total_assets 总资产
.. py:attribute:: net_assets 净资产
.. py:attribute:: total_borrow 总负债
.. py:attribute:: total_base 投入本值资产(本钱)
.. py:attribute:: profit 收益

View File

@ -235,7 +235,7 @@
克隆操作
.. py:method:: _calculate(self)
.. py:method:: _calculate(self, kdata)
【重载接口】子类计算接口

View File

@ -752,14 +752,12 @@ def sys_performance(sys, ref_stk=None):
ref_dates = ref_k.get_datetime_list()
profit = sys.tm.get_profit_curve(ref_dates)
profit = VALUE(profit)
funds = sys.tm.get_funds_curve(ref_dates)
funds_list = sys.tm.get_funds_list(ref_dates)
funds = [f.total_assets for f in funds_list]
funds = VALUE(funds)
funds_return = profit / REF(funds, 1) + 1
# funds_return = cum_return(funds)
funds_return = [f.total_assets / f.total_base for f in funds_list]
funds_return = VALUE(funds_return)
funds_return.name = "系统累积收益率"
# cum_return = get_part("default.ind.累积收益率")
ref_return = ROCR(ref_k.close, 0)
ref_return.name = ref_stk.name

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long