- @if (Model.PTData.BuyLog.Count == 0) {
-
+ @if (Model.PTData.BuyLog.Count == 0)
+ {
Your Profit Trailer did not find anything worth buying so far.
-
- } else {
-
+ }
+ else
+ {
@@ -25,51 +25,51 @@
- @foreach (Core.Main.DataObjects.PTMagicData.BuyLogData buyLogEntry in Model.PTData.BuyLog.OrderBy(b => b.IsSom).
- ThenByDescending(b => b.IsTrailing).
- ThenByDescending(b => b.IsTrue).
- ThenByDescending(b => b.TrueStrategyCount).
- ThenByDescending(b => b.PercChange).
- Take(Model.PTMagicConfiguration.GeneralSettings.Monitor.MaxDashboardBuyEntries)) {
-
- Core.Main.DataObjects.PTMagicData.MarketPairSummary mps = null;
- if (Model.Summary.MarketSummary.ContainsKey(buyLogEntry.Market)) {
- mps = Model.Summary.MarketSummary[buyLogEntry.Market];
- }
-
- bool isTrailingBuyActive = buyLogEntry.IsTrailing;
- if (buyLogEntry.BuyStrategies.Count > 0) {
- isTrailingBuyActive = (buyLogEntry.BuyStrategies.FindAll(bs => bs.IsTrailing).Count > 0);
- }
-
- bool isBuyStrategyTrue = buyLogEntry.IsTrue;
- if (buyLogEntry.BuyStrategies.Count > 0) {
- isBuyStrategyTrue = (buyLogEntry.BuyStrategies.FindAll(bs => !bs.IsTrue).Count == 0);
- }
-
- bool buyDisabled = false;
- string buyStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, buyLogEntry.BuyStrategies, buyLogEntry.BuyStrategy, isBuyStrategyTrue, isTrailingBuyActive);
- if (!Core.ProfitTrailer.StrategyHelper.IsValidStrategy(buyStrategyText, true)) {
- buyDisabled = true;
- }
-
-
- @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0) {
- @buyLogEntry.Market |
- } else {
- @buyLogEntry.Market |
- }
- @string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00")) |
- @string.Format("{0}", (buyLogEntry.Volume24h).ToString()) |
- @buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) |
-
- @if (buyDisabled) {
- @Html.Raw(buyStrategyText) |
- } else {
- @Html.Raw(buyStrategyText) |
- }
-
+ @foreach (Core.Main.DataObjects.PTMagicData.BuyLogData buyLogEntry in Model.PTData.BuyLog.OrderBy(b => b.IsSom).
+ ThenByDescending(b => b.IsTrailing).
+ ThenByDescending(b => b.IsTrue).
+ ThenByDescending(b => b.TrueStrategyCount).
+ ThenByDescending(b => b.PercChange).
+ Take(Model.PTMagicConfiguration.GeneralSettings.Monitor.MaxDashboardBuyEntries)) {
+ Core.Main.DataObjects.PTMagicData.MarketPairSummary mps = null;
+ if (Model.Summary.MarketSummary.ContainsKey(buyLogEntry.Market))
+ {
+ mps = Model.Summary.MarketSummary[buyLogEntry.Market];
}
+
+ bool isTrailingBuyActive = buyLogEntry.IsTrailing;
+ if (buyLogEntry.BuyStrategies.Count > 0) {
+ isTrailingBuyActive = (buyLogEntry.BuyStrategies.FindAll(bs => bs.IsTrailing).Count > 0);
+ }
+
+ bool isBuyStrategyTrue = buyLogEntry.IsTrue;
+ if (buyLogEntry.BuyStrategies.Count > 0) {
+ isBuyStrategyTrue = (buyLogEntry.BuyStrategies.FindAll(bs => !bs.IsTrue).Count == 0);
+ }
+
+ bool buyDisabled = false;
+ string buyStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, buyLogEntry.BuyStrategies, buyLogEntry.BuyStrategy, isBuyStrategyTrue, isTrailingBuyActive);
+ if (!Core.ProfitTrailer.StrategyHelper.IsValidStrategy(buyStrategyText, true)) {
+ buyDisabled = true;
+ }
+
+
+ @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0) {
+ @buyLogEntry.Market |
+ } else {
+ @buyLogEntry.Market |
+ }
+ @string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00")) |
+ @string.Format("{0}", (buyLogEntry.Volume24h).ToString()) |
+ @buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) |
+
+ @if (buyDisabled) {
+ @Html.Raw(buyStrategyText) |
+ } else {
+ @Html.Raw(buyStrategyText) |
+ }
+
+ }
@@ -113,8 +113,6 @@
mps = Model.Summary.MarketSummary[dcaLogEntry.Market];
}
- // bool shorting = Model.PTProperties.Shorting;
-
bool dcaEnabled = true;
if (mps != null) {
dcaEnabled = mps.IsDCAEnabled;
@@ -142,89 +140,86 @@
bool buyDisabled = false;
string leverage = "";
- double leverageValue = 0;
-
+ double leverageValue = 1;
string buyStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, dcaLogEntry.BuyStrategies, dcaLogEntry.BuyStrategy, isBuyStrategyTrue, isTrailingBuyActive);
if (!Core.ProfitTrailer.StrategyHelper.IsValidStrategy(buyStrategyText, true))
{
buyDisabled = true;
}
-
string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive);
-
- // if leverage, recalculate profit target
- if (sellStrategyText.Contains("CROSSED"))
- {
- string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("CROSSED")+9);
- leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)"));
- leverageValue = double.Parse(leverage);
- }
- if (sellStrategyText.Contains("ISOLATED"))
- {
- string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("ISOLATED")+10);
- leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)"));
- leverageValue = double.Parse(leverage);
- }
// Check for when PT loses the value of a pair
bool lostValue = false;
lostValue = (dcaLogEntry.TotalCost == 0.0) || (dcaLogEntry.AverageBuyPrice == 0.0);
- // Aggregate totals
- Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost;
- double ExchangeFee = 0;
-
+ double exchangeFee = 0;
switch (Model.PTMagicConfiguration.GeneralSettings.Application.Exchange.ToLower())
{
case "binance":
- ExchangeFee = 0.002;
+ exchangeFee = 0.002;
break;
case "binanceus":
- ExchangeFee = 0.002;
+ exchangeFee = 0.002;
break;
case "binancefutures":
- ExchangeFee = 0.002;
+ exchangeFee = 0.002;
break;
case "bittrex":
- ExchangeFee = 0.0025;
+ exchangeFee = 0.0025;
break;
case "poloniex":
- ExchangeFee = 0.0025;
+ exchangeFee = 0.0025;
break;
default:
break;
}
-
- double TradingFee = (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) * ExchangeFee;
- Model.TotalBagValue = Model.TotalBagValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) - TradingFee);
-
+ // Aggregate totals
+ double tradingFee = (exchangeFee * dcaLogEntry.TotalCost) * 2;
+ double bagGain = (dcaLogEntry.ProfitPercent / 100) * dcaLogEntry.TotalCost * leverageValue;
+ Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost;
+ Model.TotalBagGain = Model.TotalBagGain + bagGain;
+
// Render the row
- @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0) {
+ @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)
+ {
@dcaLogEntry.Market |
- } else {
+ } else
+ {
@dcaLogEntry.Market |
}
-
@Html.Raw((dcaLogEntry.PercChange * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))% |
-
@Html.Raw(dcaLogEntry.TotalCost.ToString("#,#0.000000", new System.Globalization.CultureInfo("en-US"))) |
-
- @if (dcaEnabled) {
- @if (dcaLogEntry.BoughtTimes > 0) {
+ @if (dcaEnabled)
+ {
+ @if (dcaLogEntry.BoughtTimes > 0)
+ {
@dcaLogEntry.BoughtTimes;
}
- } else {
+ } else
+ {
}
|
@Html.Raw(buyStrategyText) |
@Html.Raw(sellStrategyText) |
-
-
- @if (leverageValue == 0)
+
+ @if (sellStrategyText.Contains("CROSSED"))
+ // if leverage, recalculate profit target
+ {
+ string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("CROSSED")+9);
+ leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)"));
+ leverageValue = double.Parse(leverage);
+ }
+ @if (sellStrategyText.Contains("ISOLATED"))
+ {
+ string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("ISOLATED")+10);
+ leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)"));
+ leverageValue = double.Parse(leverage);
+ }
+ @if (leverageValue == 1)
{
@Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? dcaLogEntry.TargetGainValue.Value.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : " ") |
}
@@ -233,8 +228,7 @@
double leverageTargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value;
@Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? leverageTargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : " ") |
}
-
- @if(!@lostValue)
+ @if (!@lostValue)
{
@dcaLogEntry.ProfitPercent.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% |
}
@@ -242,25 +236,21 @@
{
No Value! |
}
-
|
}
-
Totals: |
|
@Html.Raw(Model.TotalBagCost.ToString("#,#0.000000", new System.Globalization.CultureInfo("en-US"))) |
+
@Html.Raw(Model.TotalBagValue.ToString("#,#0.000000", new System.Globalization.CultureInfo("en-US"))) |
|
|
|
|
-
-
@Html.Raw( (((Model.TotalBagValue - Model.TotalBagCost) / Model.TotalBagCost) * 100).ToString("#0.00", new System.Globalization.CultureInfo("en-US")))% |
-
+
@Html.Raw((((Model.TotalBagGain) / Model.TotalBagCost) * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))% |