def daily_open(self): Portfolio.daily_open(self) fn = get_dss() + 'fut/engine/follow/portfolio_follow_param.csv' if os.path.exists(fn): df = pd.read_csv(fn) if len(df) > 0: rec = df.iloc[-1, :] # 取最近日期的记录 self.symbol_c = rec.symbol_c self.symbol_p = rec.symbol_p self.strike_high = rec.strike_high self.strike_low = rec.strike_low self.profit_o = rec.profit_o self.price_o = rec.price_o self.price_o_high = 1.04 * self.price_o self.price_o_low = 0.96 * self.price_o self.price_c = rec.price_c self.price_p = rec.price_p self.hold_c = rec.hold_c self.hold_p = rec.hold_p
def daily_open(self): Portfolio.daily_open(self) fn = get_dss() + 'opt/sdiffer_d_base.csv' df = pd.read_csv(fn) date_list = sorted(list(set(df.date))) # print(date_list) date = date_list[-1] df = df[df.date == date] for i, row in df.iterrows(): self.d_base_dict[row.basic + '_' + str(row.strike)] = row.d_base
def daily_open(self): Portfolio.daily_open(self) fn = get_dss( ) + 'fut/engine/ratio/portfolio_' + self.name_second + '_save.csv' if os.path.exists(fn): df = pd.read_csv(fn) df = df[(df.symbol_c == self.symbol_c) & (df.symbol_p == self.symbol_p)] if len(df) > 0: rec = df.iloc[-1, :] # 取最近日期的记录 self.price_c = rec.price_c self.price_p = rec.price_p self.hold_c = rec.hold_c self.hold_p = rec.hold_p
def daily_open(self): Portfolio.daily_open(self) fn = get_dss() + 'fut/engine/follow/portfolio_' + self.name_second + '_save.csv' if os.path.exists(fn): df = pd.read_csv(fn) if len(df) > 0: rec = df.iloc[-1,:] # 取最近日期的记录 self.profit_o = rec.profit_o self.price_o = rec.price_o self.price_o_high = (1+self.percent) * self.price_o self.price_o_low = (1-self.percent) * self.price_o self.price_c = rec.price_c self.price_p = rec.price_p self.hold_c = rec.hold_c self.hold_p = rec.hold_p
def daily_open(self): Portfolio.daily_open(self)