Merge branch 'develop' of https://github.com/HojouFotytu/PTMagic into develop
This commit is contained in:
commit
fbebf93d8c
|
@ -433,7 +433,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)
|
||||||
|
@ -452,13 +451,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)
|
||||||
{
|
{
|
||||||
|
@ -530,7 +527,6 @@ namespace Core.ProfitTrailer
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetStrategyValueDecimals(string strategyName)
|
public static int GetStrategyValueDecimals(string strategyName)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
@ -574,7 +570,6 @@ namespace Core.ProfitTrailer
|
||||||
}
|
}
|
||||||
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;
|
||||||
|
@ -585,9 +580,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
|
||||||
|
@ -635,7 +628,6 @@ namespace Core.ProfitTrailer
|
||||||
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>";
|
||||||
|
@ -654,14 +646,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>";
|
||||||
|
@ -672,10 +661,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 = "";
|
||||||
|
|
Loading…
Reference in New Issue