Beispiel #1
0
    def handle_noargs(self, **options):
        jpy = ZTrade()
        jpy.currency = "EUR/JPY"
        jpy.take_profit = 135.92
        jpy.stop_loss = 137.12
        jpy.buy = False
        jpy.start_pending()

        cad = ZTrade()
        cad.currency = "USD/CAD"
        cad.take_profit = 1.32001
        cad.stop_loss = 1.2918
        cad.buy = True
        cad.start_market()
Beispiel #2
0
    def handle_noargs(self, **options):
        jpy = ZTrade()
        jpy.currency = "EUR/JPY"
        jpy.take_profit = 135.92
        jpy.stop_loss = 137.12
        jpy.buy = False
        jpy.start_pending()

        cad = ZTrade()
        cad.currency = "USD/CAD"
        cad.take_profit = 1.32001
        cad.stop_loss = 1.2918
        cad.buy = True
        cad.start_market()
Beispiel #3
0
 def start_market(self):
     trade = ZTrade()
     trade.currency = self.currency
     trade.take_profit = self.take_profit
     trade.stop_loss = self.stop_loss
     trade.trailing_stop = self.trailing_stop
     trade.conditional_stop = self.conditional_stop
     if self.lots:
         trade.lots = self.lots
     else:
         trade.lots = settings.TRADE_LOTS
     trade.buy = self.is_buy
     trade.start_market()
     self.status = "trading"
     self.trade_id = trade.trade_id
     self.save()
Beispiel #4
0
 def start_market(self):
     trade = ZTrade()
     trade.currency = self.currency
     trade.take_profit = self.take_profit
     trade.stop_loss = self.stop_loss
     trade.trailing_stop = self.trailing_stop
     trade.conditional_stop = self.conditional_stop
     if self.lots:
         trade.lots = self.lots
     else:
         trade.lots = settings.TRADE_LOTS
     trade.buy = self.is_buy
     trade.start_market()
     self.status = "trading"
     self.trade_id = trade.trade_id
     self.save()
Beispiel #5
0
 def stop_pending(self):
     trade = ZTrade()
     trade.trade_id = self.trade_id
     trade.currency = self.currency
     if self.lots:
         trade.lots = self.lots
     else:
         trade.lots = settings.TRADE_LOTS
     trade.take_profit = self.take_profit
     trade.stop_loss = self.stop_loss
     trade.trailing_stop = self.trailing_stop
     trade.conditional_stop = self.conditional_stop
     trade.buy = self.is_buy
     self.status = "filled"
     trade.stop_pending()
     self.trade_id = None
     self.save()
Beispiel #6
0
 def stop_pending(self):
     trade = ZTrade()
     trade.trade_id = self.trade_id
     trade.currency = self.currency
     if self.lots:
         trade.lots = self.lots
     else:
         trade.lots = settings.TRADE_LOTS
     trade.take_profit = self.take_profit
     trade.stop_loss = self.stop_loss
     trade.trailing_stop = self.trailing_stop
     trade.conditional_stop = self.conditional_stop
     trade.buy = self.is_buy
     self.status = "filled"
     trade.stop_pending()
     self.trade_id = None
     self.save()