|
|
@ -5,6 +5,11 @@ namespace Binance.TradeRobot.Model.Dto |
|
|
|
{ |
|
|
|
public class RobotResponse |
|
|
|
{ |
|
|
|
public RobotResponse() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public long Id { get; set; } |
|
|
|
public DateTime CreateTime { get; set; } |
|
|
|
public Enums.TradePolicy TradePolicy { get; set; } |
|
|
@ -22,25 +27,6 @@ namespace Binance.TradeRobot.Model.Dto |
|
|
|
|
|
|
|
public Enums.Exchange ExchangeId { get; set; } |
|
|
|
|
|
|
|
public virtual string ExecuteKey { get { return $"Execute-{ExchangeId}-{TradePolicy}-{Symbol}"; } } |
|
|
|
|
|
|
|
public virtual string KLineKey { get { return $"KLine-{ExchangeId}-{BusinessType}-{Symbol}"; } } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 订单推送监听实例Key
|
|
|
|
/// <para>币安逐仓杠杆需要单独的运行实例</para>
|
|
|
|
/// </summary>
|
|
|
|
public virtual string OrderPublishKey |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
string key = $"{BusinessType}-{ExchangeAPIKey.AccountId}"; //币安现货,币安合约,同一个账户内不区分websocket实例
|
|
|
|
if (ExchangeId == Enums.Exchange.Binance && BusinessType == Enums.BusinessType.IsolateMargin) |
|
|
|
key = $"{BusinessType}-{ExchangeAPIKey.AccountId}-{Symbol}"; //币安逐仓杠杆,同一个账户内的每个交易对需要区分websocket实例
|
|
|
|
return $"OrderPublish-{ExchangeId}-{key}"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 订单推送日志Key
|
|
|
|
/// </summary>
|
|
|
@ -63,5 +49,28 @@ namespace Binance.TradeRobot.Model.Dto |
|
|
|
/// 机器人绑定的交易所APIKey对象
|
|
|
|
/// </summary>
|
|
|
|
public SimpleExchangeAPIKeyResponse ExchangeAPIKey { get; set; } |
|
|
|
|
|
|
|
public string ExecuteKey { get { return $"Execute-{ExchangeId}-{TradePolicy}-{Symbol}"; } } |
|
|
|
|
|
|
|
public string KLineKey { get { return $"KLine-{ExchangeId}-{BusinessType}-{Symbol}"; } } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 订单推送监听实例Key
|
|
|
|
/// <para>币安逐仓杠杆需要单独的运行实例</para>
|
|
|
|
/// </summary>
|
|
|
|
public string OrderPublishKey |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
if (State == Enums.RobotState.Runing && ExchangeAPIKey != null) |
|
|
|
{ |
|
|
|
string key = $"{BusinessType}-{ExchangeAPIKey.AccountId}"; //币安现货,币安合约,同一个账户内不区分websocket实例
|
|
|
|
if (ExchangeId == Enums.Exchange.Binance && BusinessType == Enums.BusinessType.IsolateMargin) |
|
|
|
key = $"{BusinessType}-{ExchangeAPIKey.AccountId}-{Symbol}"; //币安逐仓杠杆,同一个账户内的每个交易对需要区分websocket实例
|
|
|
|
return $"OrderPublish-{ExchangeId}-{key}"; |
|
|
|
} |
|
|
|
return string.Empty; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|