@page @model BuyListModel @{ Layout = null; System.Reflection.PropertyInfo propertyInfo = typeof(Core.Main.DataObjects.PTMagicData.BuyLogData).GetProperty(Model.SortFieldId); List buyLogResult = Model.PTData.BuyLog.OrderByDescending(d => propertyInfo.GetValue(d, null)).ToList(); if (Model.SortDirection.Equals("ASC")) { buyLogResult = Model.PTData.BuyLog.OrderBy(d => propertyInfo.GetValue(d, null)).ToList(); } } @foreach (Core.Main.DataObjects.PTMagicData.BuyLogData buyLogEntry in buyLogResult) { 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; } buyLogEntry.PercChange = @buyLogEntry.PercChange * 100; string currentValueText = Core.ProfitTrailer.StrategyHelper.GetCurrentValueText(buyLogEntry.BuyStrategies, buyLogEntry.BuyStrategy, buyLogEntry.CurrentLowBBValue, buyLogEntry.CurrentValue, true); string triggerValueText = Core.ProfitTrailer.StrategyHelper.GetTriggerValueText(Model.Summary, buyLogEntry.BuyStrategies, buyLogEntry.BuyStrategy, buyLogEntry.BBTrigger, buyLogEntry.TriggerValue, 0, true); @if (mps != null && (mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)) { @buyLogEntry.Market } else { @buyLogEntry.Market } @buyLogEntry.PercChange.ToString("#,#0.00")% @if (buyDisabled) { @Html.Raw(buyStrategyText) } else { @Html.Raw(buyStrategyText) } @Html.Raw(currentValueText) @Html.Raw(triggerValueText) @buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) }