示例#1
0
        public string Reset(DateTime eventTime)
        {
            var warnings = new List <string>();

            if (!string.IsNullOrEmpty(LiquidationOperationId))
            {
                warnings.Add($"Liquidation is in progress with id {LiquidationOperationId}. ");
            }

            if (AccountFpl.UnconfirmedMarginData.Any())
            {
                warnings.Add($"There is some unconfirmed margin data on account: {string.Join(",", AccountFpl.UnconfirmedMarginData)}. ");
            }

            if (AccountFpl.WithdrawalFrozenMarginData.Any())
            {
                warnings.Add($"There is some withdrawal frozen margin data on account: {string.Join(",", AccountFpl.WithdrawalFrozenMarginData)}. ");
            }

            Balance                = 0;
            TodayStartBalance      = 0;
            TodayRealizedPnL       = 0;
            TodayUnrealizedPnL     = 0;
            TodayDepositAmount     = 0;
            TodayWithdrawAmount    = 0;
            TodayCommissionAmount  = 0;
            TodayOtherAmount       = 0;
            LiquidationOperationId = string.Empty;
            LastUpdateTime         = LastBalanceChangeTime = eventTime;
            AccountFpl             = new AccountFpl();

            return(string.Join(", ", warnings));
        }
示例#2
0
 public static MarginTradingAccount Create(IMarginTradingAccount src, AccountFpl accountFpl)
 {
     return(new MarginTradingAccount
     {
         Id = src.Id,
         TradingConditionId = src.TradingConditionId,
         ClientId = src.ClientId,
         BaseAssetId = src.BaseAssetId,
         Balance = src.Balance,
         WithdrawTransferLimit = src.WithdrawTransferLimit,
         AccountFpl = accountFpl ?? new AccountFpl()
         {
             ActualHash = 1
         },
         LegalEntity = src.LegalEntity,
     });
 }
示例#3
0
 public static MarginTradingAccount Create(IMarginTradingAccount src, AccountFpl accountFpl = null)
 {
     return(new MarginTradingAccount
     {
         Id = src.Id,
         TradingConditionId = src.TradingConditionId,
         ClientId = src.ClientId,
         BaseAssetId = src.BaseAssetId,
         Balance = src.Balance,
         WithdrawTransferLimit = src.WithdrawTransferLimit,
         AccountFpl = accountFpl ?? new AccountFpl {
             ActualHash = 1
         },
         LegalEntity = src.LegalEntity,
         IsDisabled = src.IsDisabled,
         IsDeleted = src.IsDeleted,
         LastUpdateTime = src.LastUpdateTime,
         LastBalanceChangeTime = src.LastBalanceChangeTime,
         IsWithdrawalDisabled = src.IsWithdrawalDisabled
     });
 }