diff --git a/Core/ProfitTrailer/StrategyHelper.cs b/Core/ProfitTrailer/StrategyHelper.cs index 07b27ef..e30a26b 100644 --- a/Core/ProfitTrailer/StrategyHelper.cs +++ b/Core/ProfitTrailer/StrategyHelper.cs @@ -21,12 +21,12 @@ namespace Core.ProfitTrailer { string result = strategyName; string time = ""; + int strategyLength = strategyName.Length-3; + string strategyLetter = strategyName.Remove(3, strategyLength); + string strategyNameOnly = strategyName.Remove(0, 3); + // strategy labels that are variable, so can't be caught by the switch statement - if (result.Contains("FORMULA")) - { - result = "FORM"; - } if (result.Contains("REBUY")) { time = strategyName.Remove(0,14); @@ -37,127 +37,127 @@ namespace Core.ProfitTrailer result = "CHANGE"; } - switch (strategyName.ToLower()) + switch (strategyNameOnly.ToLower()) { case "lowbb": - result = "LBB"; + result = String.Concat(strategyLetter, "LBB"); break; case "highbb": - result = "HBB"; + result = String.Concat(strategyLetter, "HBB"); break; case "gain": - result = "G"; + result = String.Concat(strategyLetter, "GAIN"); break; case "loss": - result = "L"; + result = String.Concat(strategyLetter, "LOSS"); break; case "smagain": - result = "SG"; + result = String.Concat(strategyLetter, "SG"); break; case "emagain": - result = "EG"; + result = String.Concat(strategyLetter, "EG"); break; case "hmagain": - result = "EG"; + result = String.Concat(strategyLetter, "EG"); break; case "dmagain": - result = "EG"; + result = String.Concat(strategyLetter, "EG"); break; case "smaspread": - result = "SS"; + result = String.Concat(strategyLetter, "SS"); break; case "emaspread": - result = "ES"; + result = String.Concat(strategyLetter, "ES"); break; case "hmaspread": - result = "ES"; + result = String.Concat(strategyLetter, "HES"); break; case "dmaspread": - result = "ES"; + result = String.Concat(strategyLetter, "DES"); break; case "smacross": - result = "SC"; + result = String.Concat(strategyLetter, "SC"); break; case "emacross": - result = "EC"; + result = String.Concat(strategyLetter, "EC"); break; case "hmacross": - result = "SC"; + result = String.Concat(strategyLetter, "HSC"); break; case "dmacross": - result = "EC"; + result = String.Concat(strategyLetter, "DEC"); break; case "rsi": - result = "RSI"; + result = String.Concat(strategyLetter, "RSI"); break; case "stoch": - result = "STOCH"; + result = String.Concat(strategyLetter, "STOCH"); break; case "stochrsi": - result = "SRSI"; + result = String.Concat(strategyLetter, "SRSI"); break; case "stochrsik": - result = "SRSIK"; + result = String.Concat(strategyLetter, "SRSIK"); break; case "stochrsid": - result = "SRSID"; + result = String.Concat(strategyLetter, "SRSID"); break; case "stochrsicross": - result = "SRSIC"; + result = String.Concat(strategyLetter, "SRSIC"); break; case "macd": - result = "MACD"; + result = String.Concat(strategyLetter, "MACD"); break; case "obv": - result = "OBV"; + result = String.Concat(strategyLetter, "OBV"); break; case "bbwidth": - result = "BBW"; + result = String.Concat(strategyLetter, "BBW"); break; case "pdhigh": - result = "PDH"; + result = String.Concat(strategyLetter, "PDH"); break; case "anderson": - result = "AND"; + result = String.Concat(strategyLetter, "AND"); break; case "som enabled": - result = "SOM"; + result = String.Concat(strategyLetter, "SOM"); break; case "max buy times": - result = "DCAMAX"; + result = String.Concat(strategyLetter, "DCAMAX"); break; case "max pairs": - result = "PAIRS"; + result = String.Concat(strategyLetter, "PAIRS"); break; case "max spread": - result = "SPREAD"; + result = String.Concat(strategyLetter, "SPREAD"); break; case "price increase": - result = "PIN"; + result = String.Concat(strategyLetter, "INC"); break; case "min buy volume": - result = "VOL"; + result = String.Concat(strategyLetter, "VOL"); break; case "min buy balance": - result = "MIN"; + result = String.Concat(strategyLetter, "MIN"); break; case "coin age": - result = "AGE"; + result = String.Concat(strategyLetter, "AGE"); break; case "too new": - result = "NEW"; + result = String.Concat(strategyLetter, "NEW"); break; case "blacklisted": - result = "BLACK"; + result = String.Concat(strategyLetter, "BLACK"); break; case "insufficient balance": - result = "BAL"; + result = String.Concat(strategyLetter, "BAL"); break; case "max cost reached": - result = "COST"; + result = String.Concat(strategyLetter, "COST"); break; case "buy value below dust": - result = "DUST"; + result = String.Concat(strategyLetter, "DUST"); break; default: break; @@ -183,12 +183,13 @@ namespace Core.ProfitTrailer { bool result = false; - // Custom Strategy Labels in PT - add * - if (strategyName.Contains("*")) + // Strategy Labels in PT 2.3.3 -- all valid strategies are a letter followed by a colon. + if (strategyName.Contains(":")) { result = true; } + // Prior to PT 2.3.3 if (!checkForAnyInvalid) { switch (strategyName.ToLower()) @@ -307,9 +308,16 @@ namespace Core.ProfitTrailer isValidStrategy = StrategyHelper.IsValidStrategy(strategy.Name); - if (!isValidStrategy) + if (!isValidStrategy ) { - strategyText += "" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + " "; + if (strategy.Name.Contains("FORMULA")) + { + strategyText += "FORM "; + } + else + { + strategyText += "" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + " "; + } } else {