|
@ -199,15 +199,14 @@ namespace Binance.TradeRobot.Business |
|
|
bool isLoadRecentTradeProfit = true, |
|
|
bool isLoadRecentTradeProfit = true, |
|
|
bool isLoadAPIKey = false) |
|
|
bool isLoadAPIKey = false) |
|
|
{ |
|
|
{ |
|
|
var robotList = fsql.Select<Robot, SymbolInfo, RobotAccount, D21Policy, ExchangeAPIKey>().InnerJoin((r, s, ra, d, e) => r.Id == ra.RobotId) |
|
|
var robotList = fsql.Select<Robot, RobotAccount, D21Policy, ExchangeAPIKey>().InnerJoin((r, ra, d, e) => r.Id == ra.RobotId) |
|
|
.InnerJoin((r, s, ra, d, e) => r.Symbol == s.Symbol && r.ExchangeId == s.ExchangeId) |
|
|
.InnerJoin((r, ra, d, e) => r.Id == d.RobotId) |
|
|
.InnerJoin((r, s, ra, d, e) => r.Id == d.RobotId) |
|
|
.InnerJoin((r, ra, d, e) => r.Id == e.RobotId) |
|
|
.InnerJoin((r, s, ra, d, e) => r.Id == e.RobotId) |
|
|
.WhereIf(robotState != null, (r, ra, d, e) => r.State == robotState) |
|
|
.WhereIf(robotState != null, (r, s, ra, d, e) => r.State == robotState) |
|
|
.WhereIf(signalPeriod != null, (r, ra, d, e) => d.PeriodicSignal == signalPeriod) |
|
|
.WhereIf(signalPeriod != null, (r, s, ra, d, e) => d.PeriodicSignal == signalPeriod) |
|
|
.WhereIf(!string.IsNullOrEmpty(symbol), (r, ra, d, e) => r.Symbol == symbol) |
|
|
.WhereIf(!string.IsNullOrEmpty(symbol), (r, s, ra, d, e) => r.Symbol == symbol) |
|
|
.Where((r, ra, d, e) => r.TradePolicy == Enums.TradePolicy.D21) |
|
|
.Where((r, s, ra, d, e) => r.TradePolicy == Enums.TradePolicy.D21) |
|
|
.ToList((r, ra, d, e) => new Robot |
|
|
.ToList((r, s, ra, d, e) => new Robot() |
|
|
|
|
|
{ |
|
|
{ |
|
|
Id = r.Id, |
|
|
Id = r.Id, |
|
|
BusinessType = r.BusinessType, |
|
|
BusinessType = r.BusinessType, |
|
@ -218,8 +217,8 @@ namespace Binance.TradeRobot.Business |
|
|
CreateTime = r.CreateTime, |
|
|
CreateTime = r.CreateTime, |
|
|
TradePolicy = r.TradePolicy, |
|
|
TradePolicy = r.TradePolicy, |
|
|
|
|
|
|
|
|
SymbolId = s.Id, |
|
|
//SymbolId = s.Id,
|
|
|
SymbolSaleQuantityAccuracy = s.SaleQuantityAccuracy, |
|
|
//SymbolSaleQuantityAccuracy = s.SaleQuantityAccuracy,
|
|
|
|
|
|
|
|
|
RobotAccountId = ra.Id, |
|
|
RobotAccountId = ra.Id, |
|
|
ClosePositionCount = ra.ClosePositionCount, |
|
|
ClosePositionCount = ra.ClosePositionCount, |
|
@ -249,6 +248,8 @@ namespace Binance.TradeRobot.Business |
|
|
D21MaxSystemLoanRatio = d.MaxSystemLoanRatio, |
|
|
D21MaxSystemLoanRatio = d.MaxSystemLoanRatio, |
|
|
D21CreateTime = d.CreateTime |
|
|
D21CreateTime = d.CreateTime |
|
|
}).Map<IList<D21PolicyRobotResponse>>(); |
|
|
}).Map<IList<D21PolicyRobotResponse>>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isLoadRecentTradeProfit) |
|
|
if (isLoadRecentTradeProfit) |
|
|
{ |
|
|
{ |
|
|
//统计近期订单利润
|
|
|
//统计近期订单利润
|
|
@ -259,7 +260,6 @@ namespace Binance.TradeRobot.Business |
|
|
foreach (var r in robotList) |
|
|
foreach (var r in robotList) |
|
|
r.ExchangeAPIKey = null; |
|
|
r.ExchangeAPIKey = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return robotList; |
|
|
return robotList; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|