From 4fc5fa6e5146b72dee0ddfa8cbb1fb4f220e1fec Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Fri, 17 Jul 2020 19:30:42 +0900 Subject: [PATCH] update code for isolated leverage --- Monitor/Pages/_get/DashboardTop.cshtml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index bcdb82c..c93a6e6 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -147,25 +147,20 @@ buyDisabled = true; } - - + // if leverage, recalculate profit target if (buyStrategyText.Contains("CROSSED")) { string leverageText = buyStrategyText.Remove(0, buyStrategyText.IndexOf("CROSSED")+9); leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); leverageValue = double.Parse(leverage); - Write(leverageValue); } if (buyStrategyText.Contains("ISOLATED")) { - leverage = buyStrategyText.Remove(0, 10); - leverage = leverage.Remove(leverage.Length - 3, 3); - //leverageValue = double.Parse(leverage); - Write(leverage); + string leverageText = buyStrategyText.Remove(0, buyStrategyText.IndexOf("ISOLATED")+10); + leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); + leverageValue = double.Parse(leverage); } - - - + string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive); // Check for when PT loses the value of a pair