Implement updating protection
This commit is contained in:
@@ -145,13 +145,14 @@ class OANDAExchange(BaseExchange):
|
||||
r = trades.TradeDetails(accountID=self.account_id, tradeID=trade_id)
|
||||
return self.call(r)
|
||||
|
||||
def update_trade(self, trade):
|
||||
raise NotImplementedError
|
||||
# r = orders.OrderReplace(
|
||||
# accountID=self.account_id, orderID=trade.order_id, data=data
|
||||
# )
|
||||
# self.client.request(r)
|
||||
# return r.response
|
||||
def update_trade(self, trade_id, take_profit_price, stop_loss_price):
|
||||
data = {}
|
||||
if take_profit_price:
|
||||
data["takeProfit"] = {"price": str(take_profit_price)}
|
||||
if stop_loss_price:
|
||||
data["stopLoss"] = {"price": str(stop_loss_price)}
|
||||
r = trades.TradeCRCDO(accountID=self.account_id, tradeID=trade_id, data=data)
|
||||
return self.call(r)
|
||||
|
||||
def cancel_trade(self, trade_id):
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user