Ejemplo n.º 1
0
 public static AccountStatContract ConvertToContract(this IMarginTradingAccount account)
 {
     return(new AccountStatContract
     {
         AccountId = account.Id,
         BaseAssetId = account.BaseAssetId,
         Balance = account.Balance,
         LastBalanceChangeTime = account.LastBalanceChangeTime,
         MarginCallLevel = account.GetMarginCall1Level(),
         StopOutLevel = account.GetStopOutLevel(),
         TotalCapital = account.GetTotalCapital(),
         FreeMargin = account.GetFreeMargin(),
         MarginAvailable = account.GetMarginAvailable(),
         UsedMargin = account.GetUsedMargin(),
         CurrentlyUsedMargin = account.GetCurrentlyUsedMargin(),
         InitiallyUsedMargin = account.GetInitiallyUsedMargin(),
         MarginInit = account.GetMarginInit(),
         PnL = account.GetPnl(),
         UnrealizedDailyPnl = account.GetUnrealizedDailyPnl(),
         OpenPositionsCount = account.GetOpenPositionsCount(),
         ActiveOrdersCount = account.GetActiveOrdersCount(),
         MarginUsageLevel = account.GetMarginUsageLevel(),
         LegalEntity = account.LegalEntity,
         IsInLiquidation = account.IsInLiquidation(),
         MarginNotificationLevel = account.GetAccountLevel().ToString()
     });
 }
Ejemplo n.º 2
0
 public static AccountCapitalFigures ConvertToCapitalFiguresContract(this IMarginTradingAccount account)
 {
     return(new AccountCapitalFigures
     {
         Balance = account.Balance,
         LastBalanceChangeTime = account.LastBalanceChangeTime,
         TotalCapital = account.GetTotalCapital(),
         FreeMargin = account.GetFreeMargin(),
         UsedMargin = account.GetUsedMargin(),
         CurrentlyUsedMargin = account.GetCurrentlyUsedMargin(),
         InitiallyUsedMargin = account.GetInitiallyUsedMargin(),
         PnL = account.GetPnl(),
         UnrealizedDailyPnl = account.GetUnrealizedDailyPnl(),
         OpenPositionsCount = account.GetOpenPositionsCount(),
         TodayStartBalance = account.TodayStartBalance,
         TodayRealizedPnL = account.TodayRealizedPnL,
         TodayUnrealizedPnL = account.TodayUnrealizedPnL,
         TodayDepositAmount = account.TodayDepositAmount,
         TodayWithdrawAmount = account.TodayWithdrawAmount,
         TodayCommissionAmount = account.TodayCommissionAmount,
         TodayOtherAmount = account.TodayOtherAmount,
         AdditionalInfo = account.AdditionalInfo
     });
 }