Update StrategyHelper.cs

removed a few empty lines
This commit is contained in:
HojouFotytu 2020-07-15 00:31:23 +09:00 committed by GitHub
parent 6116272e77
commit 929e855334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 32 deletions

View File

@ -438,7 +438,6 @@ namespace Core.ProfitTrailer
default: default:
break; break;
} }
if (onlyValidStrategies) if (onlyValidStrategies)
{ {
if (strategyName.IndexOf("SOM") > -1 || strategyName.IndexOf("MAX") > -1 || strategyName.IndexOf("MIN") > -1 || strategyName.IndexOf("PRICE") > -1 || strategyName.IndexOf("BLACK") > -1 || strategyName.IndexOf("INSUFFICIENT") > -1 || strategyName.IndexOf("COST") > -1) if (strategyName.IndexOf("SOM") > -1 || strategyName.IndexOf("MAX") > -1 || strategyName.IndexOf("MIN") > -1 || strategyName.IndexOf("PRICE") > -1 || strategyName.IndexOf("BLACK") > -1 || strategyName.IndexOf("INSUFFICIENT") > -1 || strategyName.IndexOf("COST") > -1)
@ -446,7 +445,6 @@ namespace Core.ProfitTrailer
result = ""; result = "";
} }
} }
return result; return result;
} }
@ -458,13 +456,11 @@ namespace Core.ProfitTrailer
public static bool IsValidStrategy(string strategyName, bool checkForAnyInvalid) public static bool IsValidStrategy(string strategyName, bool checkForAnyInvalid)
{ {
bool result = false; bool result = false;
// buy/sell strategies beginning with PT 2.3.3 contain the letter followed by a colon and space. // buy/sell strategies beginning with PT 2.3.3 contain the letter followed by a colon and space.
if (strategyName.Contains(":")) if (strategyName.Contains(":"))
{ {
result = true; result = true;
} }
// Prior to PT 2.3.3 // Prior to PT 2.3.3
if (!checkForAnyInvalid) if (!checkForAnyInvalid)
{ {
@ -534,14 +530,11 @@ namespace Core.ProfitTrailer
result = true; result = true;
} }
} }
return result; return result;
} }
public static int GetStrategyValueDecimals(string strategyName) public static int GetStrategyValueDecimals(string strategyName)
{ {
int result = 0; int result = 0;
switch (strategyName.ToLower()) switch (strategyName.ToLower())
{ {
case "lowbb": case "lowbb":
@ -580,10 +573,8 @@ namespace Core.ProfitTrailer
default: default:
break; break;
} }
return result; return result;
} }
public static string GetStrategyText(Summary summary, List<Strategy> strategies, string strategyText, bool isTrue, bool isTrailingBuyActive) public static string GetStrategyText(Summary summary, List<Strategy> strategies, string strategyText, bool isTrue, bool isTrailingBuyActive)
{ {
bool isValidStrategy = false; bool isValidStrategy = false;
@ -594,9 +585,7 @@ namespace Core.ProfitTrailer
foreach (Strategy strategy in strategies) foreach (Strategy strategy in strategies)
{ {
string textClass = (strategy.IsTrue) ? "label-success" : "label-danger"; string textClass = (strategy.IsTrue) ? "label-success" : "label-danger";
isValidStrategy = StrategyHelper.IsValidStrategy(strategy.Name); isValidStrategy = StrategyHelper.IsValidStrategy(strategy.Name);
if (!isValidStrategy) if (!isValidStrategy)
{ {
// Parse Formulas // Parse Formulas
@ -615,14 +604,7 @@ namespace Core.ProfitTrailer
{ {
strategyText += "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">(FORM)</span> "; strategyText += "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">(FORM)</span> ";
} }
} }
//else
//{
// strategyText += "<span class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategy.Name + "\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + "</span> ";
//}
if (strategy.Name.Contains("LEVEL") && !strategy.Name.Contains("TRIGGERED")) if (strategy.Name.Contains("LEVEL") && !strategy.Name.Contains("TRIGGERED"))
{ {
string level = strategy.Name.Substring(5, 2); string level = strategy.Name.Substring(5, 2);
@ -641,26 +623,17 @@ namespace Core.ProfitTrailer
} }
} }
//else
//{
// strategyText += "<span class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategy.Name + "\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + "</span> ";
//}
if (strategy.Name.Contains("LEVEL") && strategy.Name.Contains("TRIGGERED")) if (strategy.Name.Contains("LEVEL") && strategy.Name.Contains("TRIGGERED"))
{ {
string level = strategy.Name.Substring(5, 2); string level = strategy.Name.Substring(5, 2);
strategyText += "<span class=\"label label-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">LEVEL " + level + "TRIG</span> "; strategyText += "<span class=\"label label-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">LEVEL " + level + "TRIG</span> ";
} }
} }
else else
{ {
strategyText += "<span class=\"label " + textClass + "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategy.Name + "\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + "</span> "; strategyText += "<span class=\"label " + textClass + "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategy.Name + "\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + "</span> ";
} }
} }
if (isTrailingBuyActive) if (isTrailingBuyActive)
{ {
strategyText += " <i class=\"fa fa-flag text-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Trailing active!\"></i>"; strategyText += " <i class=\"fa fa-flag text-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Trailing active!\"></i>";
@ -679,14 +652,11 @@ namespace Core.ProfitTrailer
} }
else else
{ {
isValidStrategy = StrategyHelper.IsValidStrategy(strategyText); isValidStrategy = StrategyHelper.IsValidStrategy(strategyText);
if (isValidStrategy) if (isValidStrategy)
{ {
strategyText = "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategyText + "\">" + StrategyHelper.GetStrategyShortcut(strategyText, true) + "</span>"; strategyText = "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategyText + "\">" + StrategyHelper.GetStrategyShortcut(strategyText, true) + "</span>";
} }
else if (strategyText.Equals("") && isValidStrategy == false) else if (strategyText.Equals("") && isValidStrategy == false)
{ {
strategyText = "<span class=\"label label-muted\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Not Applicable: Not using DCA!\"></span>"; strategyText = "<span class=\"label label-muted\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Not Applicable: Not using DCA!\"></span>";
@ -697,10 +667,8 @@ namespace Core.ProfitTrailer
} }
} }
} }
return strategyText; return strategyText;
} }
public static string GetCurrentValueText(List<Strategy> strategies, string strategyText, double bbValue, double simpleValue, bool includeShortcut) public static string GetCurrentValueText(List<Strategy> strategies, string strategyText, double bbValue, double simpleValue, bool includeShortcut)
{ {
string result = ""; string result = "";