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()
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()