You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
36 lines
1.2 KiB
using Binance.TradeRobot.Common.DI;
|
|
using Binance.TradeRobot.Common.Extensions;
|
|
using Binance.TradeRobot.Model.Base;
|
|
using Binance.TradeRobot.Model.Db;
|
|
using Binance.TradeRobot.Model.Dto;
|
|
using Microsoft.Extensions.Caching.Memory;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Yitter.IdGenerator;
|
|
|
|
namespace Binance.TradeRobot.Business
|
|
{
|
|
/// <summary>
|
|
/// 现货策略
|
|
/// </summary>
|
|
[BatchRegistration(ServiceLifetime.Singleton, RegistrationType.Self)]
|
|
public class SpotPolicyBusiness : BaseBusiness
|
|
{
|
|
public SpotPolicyBusiness(IFreeSql fsql, NLogManager logManager, IIdGenerator idGenerator, IMemoryCache memoryCache) : base(fsql, logManager, idGenerator, memoryCache)
|
|
{
|
|
|
|
}
|
|
|
|
public void EditD21Policy(EditD21PolicyRequest editD21PolicyRequest)
|
|
{
|
|
var d21policy = fsql.Select<D21Policy>(editD21PolicyRequest.Id).ToOne();
|
|
if (d21policy == null)
|
|
throw new BusinessException("d21策略不存在");
|
|
editD21PolicyRequest.Map(d21policy);
|
|
fsql.Update<D21Policy>().SetSource(d21policy).ExecuteAffrows();
|
|
|
|
/*取消历史委托订单*/
|
|
|
|
/*检查是否有持仓 如果有重新下委托单*/
|
|
}
|
|
}
|
|
}
|
|
|