Merge Target & Profit

This commit is contained in:
HojouFotytu 2021-04-21 19:29:42 +09:00
parent e4e5d92444
commit d8b3ee612c
2 changed files with 29 additions and 41 deletions

View File

@ -190,7 +190,7 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-md-4 col-form-label">Market Analyzer Chart <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="By default the price chart on the analyzer page displays your base currency. You can select a different currency here"></i></label> <label class="col-md-4 col-form-label">Market Analyzer Chart <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="By default the price chart on the analyzer page displays your base market currency against your fiat. You can change this to another pair."></i></label>
<div class="col-md-8"> <div class="col-md-8">
<input type="text" class="form-control" name="Monitor_AnalyzerChart" value="@Model.PTMagicConfiguration.GeneralSettings.Monitor.AnalyzerChart.ToString(new System.Globalization.CultureInfo("en-US"))"> <input type="text" class="form-control" name="Monitor_AnalyzerChart" value="@Model.PTMagicConfiguration.GeneralSettings.Monitor.AnalyzerChart.ToString(new System.Globalization.CultureInfo("en-US"))">
</div> </div>

View File

@ -98,10 +98,9 @@
<th class="text-left" data-toggle="tooltip" data-placement="top" title="24 Hour Trend">24H</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="24 Hour Trend">24H</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Total Buy Cost">Cost</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Total Buy Cost">Cost</th>
<th></th> <th></th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Active buy strategies">DCA</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Active Buy Strategies">DCA</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Active sell strategies">Sell</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Active Sell Strategies">Sell</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Target profit to sell">Target</th> <th class="text-left" data-toggle="tooltip" data-html="true" data-placement="top" title="Profit Target <br> Current Profit">Profit</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Current Profit">Profit</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -202,41 +201,31 @@
<td>@Html.Raw(buyStrategyText)</td> <td>@Html.Raw(buyStrategyText)</td>
<!-- Sell Strategy --> <!-- Sell Strategy -->
<td>@Html.Raw(sellStrategyText)</td> <td>@Html.Raw(sellStrategyText)</td>
<!-- Target --> <!-- Target/Profit -->
@if (!sellStrategyText.Contains("WATCHMODE"))
{
@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)
{
<td class="@Html.Raw((dcaLogEntry.TargetGainValue.HasValue && (profitPercentage > dcaLogEntry.TargetGainValue.Value)) ? "text-success" : "text-danger")">@Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? dcaLogEntry.TargetGainValue.Value.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : "&nbsp")</td>
}
else
{
double TargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value;
<td class="@Html.Raw((dcaLogEntry.TargetGainValue.HasValue && (profitPercentage > dcaLogEntry.TargetGainValue.Value)) ? "text-success" : "text-danger")">@Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : "&nbsp")</td>
}
}
else
{
<td class="text-left"></td>
}
<!-- Profit -->
@if (!@lostValue) @if (!@lostValue)
{ {
profitPercentage = profitPercentage * leverageValue; @if (!sellStrategyText.Contains("WATCHMODE"))
<td class="text-autocolor">@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</td> {
@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);
}
profitPercentage = profitPercentage * leverageValue;
double TargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value;
<td>@TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
<br>
<div class="text-autocolor">@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</div>
</td>
}
} }
else else
{ {
@ -258,7 +247,6 @@
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
<td class="text-autocolor">@Html.Raw((((Model.TotalBagGain) / Model.TotalBagCost) * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))%</td> <td class="text-autocolor">@Html.Raw((((Model.TotalBagGain) / Model.TotalBagCost) * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))%</td>
</tbody> </tbody>
</table> </table>