这种源码能实行吗? while 1: try: self.get_position() self.deal_data() print('........当前中点价格:',self.df['midpoint'].iloc[-1], '.........当前下轨价格:',self.lowerband.iloc[-1]) if self.df['midpoint'].iloc[-1] < self.lowerband.iloc[-1] and int(self.long_holding) == 0: print('符合开仓条件') price = self.df['close'].iloc[-1] * 1.01 self.okex_api.take_order(instrument_id='ru2105', type=?', size=?', order_type=?', price=price) if self.df['midpoint'].iloc[-1] > self.upperband.iloc[-1] and int(self.long_holding) != 0: print('平仓') price = self.df['close'].iloc[-1] * 0.99 self.okex_api.take_order(instrument_id='ru2105', type=?', size=?', order_type=?', price=price) except: |