Exchange fees

This commit is contained in:
HojouFotytu 2019-10-16 10:05:19 +09:00
parent 2ea0ec698a
commit aa08050fcc
1 changed files with 12 additions and 1 deletions

View File

@ -149,7 +149,18 @@
// Aggregate totals // Aggregate totals
Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost; Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost;
double TradingFee = (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) * 0.002;
if (Model.PTMagicConfiguration.GeneralSettings.Application.Exchange.Equals("Binance")) {
double ExchangeFee = 0.002;
}
if (Model.PTMagicConfiguration.GeneralSettings.Application.Exchange.Equals("Bittrex")) {
double ExchangeFee = 0.0025;
}
if (Model.PTMagicConfiguration.GeneralSettings.Application.Exchange.Equals("Poloniex")) {
double ExchangeFee = 0.0025;
}
double TradingFee = (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) * ExchangeFee;
Model.TotalBagValue = Model.TotalBagValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) - TradingFee); Model.TotalBagValue = Model.TotalBagValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) - TradingFee);
// Render the row // Render the row