Пример #1
0
 def loss_happend(self, t_dir, loss_p):
     StrategyBase.loss_happend(self, t_dir, loss_p)
     self.debug("loss hanpend t_dir=%d loss_money=%d" % (t_dir, loss_p))
     if (abs(loss_p) > 19 and t_dir > 0):
         self.LL1 = self.LL2 - 10
         self.LL2 = self.LL1 - 25
         self.trade_dir = TradeDirection.SELLONLY
     elif (abs(loss_p) > 19 and t_dir < 0):
         self.HH1 = self.HH2 + 10
         self.HH2 = self.HH1 + 25
         self.trade_dir = TradeDirection.BUYONLY
Пример #2
0
 def loss_happend(self, t_dir, loss_p):
     StrategyBase.loss_happend(self, t_dir, loss_p)
     if (t_dir < 0):
         self.adjust_hh = 39
     else:
         self.adjust_ll = 39