-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstrategy_inteface.py
More file actions
32 lines (27 loc) · 1023 Bytes
/
Copy pathstrategy_inteface.py
File metadata and controls
32 lines (27 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------
# File : strategy_inteface
# Date : 2019/9/1 0001
# Author : Chen Ji
# Email : fzls.zju@gmail.com
# -------------------------------
from abc import ABCMeta, abstractmethod
class StrategyInterface(object):
__metaclass__ = ABCMeta
@abstractmethod
# 返回决策的基金份额或基金额度(正数,即买入时表示买入金额,负数,即卖出时则表示卖出份额)
def run(self, time: str, net_values: list, profits: list, decision_shares: list, current_share: float,
current_invest_money: float, sell_money: float) -> float:
"""
:param time: str
:param net_values: [FundDailyInfo]
:param profits: [{time,invest_money, profit, profit_rate}]
:param decision_shares: [float]
:param current_share: float
:param current_invest_money: float
:param sell_money: float
"""
pass
def name(self) -> str:
pass