removed formula parsing
This commit is contained in:
parent
4d1ab9e061
commit
992ba2a713
|
@ -219,7 +219,6 @@ namespace Core.ProfitTrailer
|
||||||
string strategyNameOnly = strategyName;
|
string strategyNameOnly = strategyName;
|
||||||
|
|
||||||
// PT allows for "advanced_stats" to be turned on in the application settings, to show details of the trailing logic.
|
// PT allows for "advanced_stats" to be turned on in the application settings, to show details of the trailing logic.
|
||||||
// This code ensures PTM doesn't generate an unnecessary shortcut for this information
|
|
||||||
if (result.Contains("STATS"))
|
if (result.Contains("STATS"))
|
||||||
{
|
{
|
||||||
result = "";
|
result = "";
|
||||||
|
@ -592,7 +591,6 @@ namespace Core.ProfitTrailer
|
||||||
isValidStrategy = StrategyHelper.IsValidStrategy(strategy.Name);
|
isValidStrategy = StrategyHelper.IsValidStrategy(strategy.Name);
|
||||||
if (!isValidStrategy)
|
if (!isValidStrategy)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strategy.Name.Contains("TRIGGERED"))
|
if (strategy.Name.Contains("TRIGGERED"))
|
||||||
// remove levels already triggered, to show only currently waiting trigger
|
// remove levels already triggered, to show only currently waiting trigger
|
||||||
{
|
{
|
||||||
|
@ -609,37 +607,13 @@ namespace Core.ProfitTrailer
|
||||||
if (strategy.Name.Contains("LEVEL"))
|
if (strategy.Name.Contains("LEVEL"))
|
||||||
// level X
|
// level X
|
||||||
{
|
{
|
||||||
string level = strategy.Name.Substring(5, 2);
|
string level = strategy.Name.Substring(5, 1);
|
||||||
string expression = strategy.Name.Remove(0, 17);
|
strategyText += "<span class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"LEVEL FORMULA\">L " + level + "</span> ";
|
||||||
expression = expression.Replace("<span class=\"tdgreen\">", "true").Replace("<span class=\"red\">", "false").Replace("</span>", "").Replace("&&", "and").Replace("||", "or");
|
|
||||||
expression = regx.Replace(expression, String.Empty);
|
|
||||||
var tokens = new Tokenizer(expression).Tokenize();
|
|
||||||
var parser = new Parser(tokens);
|
|
||||||
if (parser.Parse())
|
|
||||||
{
|
|
||||||
strategyText += "<span class=\"label label-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"LEVEL FORMULA\">L " + level + "</span> ";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strategyText += "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"LEVEL FORMULA\">L " + level + "</span> ";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// standard formula
|
// standard formula
|
||||||
{
|
{
|
||||||
string expression = strategy.Name.Remove(0, 10);
|
strategyText += "<span class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">FORM</span> ";
|
||||||
expression = expression.Replace("<span class=\"tdgreen\">", "true").Replace("<span class=\"red\">", "false").Replace("</span>", "").Replace("&&", "and").Replace("||", "or");
|
|
||||||
expression = regx.Replace(expression, String.Empty);
|
|
||||||
var tokens = new Tokenizer(expression).Tokenize();
|
|
||||||
var parser = new Parser(tokens);
|
|
||||||
if (parser.Parse())
|
|
||||||
{
|
|
||||||
strategyText += "<span class=\"label label-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">FORM</span> ";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strategyText += "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"CONDITIONAL FORMULA\">FORM</span> ";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue