2018-05-22 10:11:50 +02:00
|
|
|
@page
|
|
|
|
@model BuyListModel
|
|
|
|
@{
|
|
|
|
Layout = null;
|
|
|
|
|
|
|
|
System.Reflection.PropertyInfo propertyInfo = typeof(Core.Main.DataObjects.PTMagicData.BuyLogData).GetProperty(Model.SortFieldId);
|
|
|
|
List<Core.Main.DataObjects.PTMagicData.BuyLogData> 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) {
|
2018-06-05 09:40:22 +02:00
|
|
|
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);
|
2018-05-22 10:11:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool buyDisabled = false;
|
2018-06-05 09:40:22 +02:00
|
|
|
string buyStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, buyLogEntry.BuyStrategies, buyLogEntry.BuyStrategy, isBuyStrategyTrue, isTrailingBuyActive);
|
2018-05-22 10:11:50 +02:00
|
|
|
if (!Core.ProfitTrailer.StrategyHelper.IsValidStrategy(buyStrategyText, true)) {
|
|
|
|
buyDisabled = true;
|
|
|
|
}
|
|
|
|
|
2019-03-17 08:49:19 +01:00
|
|
|
buyLogEntry.PercChange = @buyLogEntry.PercChange * 100;
|
2018-05-22 10:11:50 +02:00
|
|
|
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);
|
|
|
|
<tr>
|
|
|
|
@if (mps != null && (mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)) {
|
2024-01-23 19:05:28 +01:00
|
|
|
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, buyLogEntry.Market, Model.Summary.MainMarket, Model.PTMagicConfiguration.GeneralSettings.Monitor.TVCustomLayout)" target="_blank">@buyLogEntry.Market</a></th>
|
2018-05-22 10:11:50 +02:00
|
|
|
} else {
|
2024-01-23 19:05:28 +01:00
|
|
|
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, buyLogEntry.Market, Model.Summary.MainMarket, Model.PTMagicConfiguration.GeneralSettings.Monitor.TVCustomLayout)" target="_blank">@buyLogEntry.Market</a> <i class="fa fa-exclamation-triangle text-highlight" data-toggle="tooltip" data-placement="top" data-html="true" title="@await Component.InvokeAsync("PairIcon", mps)" data-template="<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner pair-tooltip'></div></div>"></i></th>
|
2018-05-22 10:11:50 +02:00
|
|
|
}
|
2019-03-19 00:32:10 +01:00
|
|
|
<td class="text-autocolor">@buyLogEntry.PercChange.ToString("#,#0.00")%</td>
|
2018-05-22 10:11:50 +02:00
|
|
|
@if (buyDisabled) {
|
|
|
|
<td>@Html.Raw(buyStrategyText)</td>
|
|
|
|
} else {
|
|
|
|
<td>@Html.Raw(buyStrategyText)</td>
|
|
|
|
}
|
|
|
|
<td class="text-right">@Html.Raw(currentValueText)</td>
|
|
|
|
<td class="text-right">@Html.Raw(triggerValueText)</td>
|
|
|
|
<td class="text-right">@buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|