2018-05-22 10:11:50 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.IO;
|
|
|
|
using System.Net;
|
|
|
|
using System.Net.Security;
|
|
|
|
using System.Security.Cryptography.X509Certificates;
|
|
|
|
using System.Net.Http;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Core.Main;
|
|
|
|
using Core.Helper;
|
|
|
|
using Core.Main.DataObjects.PTMagicData;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
namespace Core.ProfitTrailer
|
|
|
|
{
|
|
|
|
public static class StrategyHelper
|
|
|
|
{
|
|
|
|
public static string GetStrategyShortcut(string strategyName, bool onlyValidStrategies)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
string result = strategyName;
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
switch (strategyName.ToLower())
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
case "lowbb":
|
|
|
|
result = "LBB";
|
|
|
|
break;
|
|
|
|
case "highbb":
|
|
|
|
result = "HBB";
|
|
|
|
break;
|
|
|
|
case "gain":
|
|
|
|
result = "G";
|
|
|
|
break;
|
|
|
|
case "loss":
|
|
|
|
result = "L";
|
|
|
|
break;
|
|
|
|
case "smagain":
|
|
|
|
result = "SG";
|
|
|
|
break;
|
|
|
|
case "emagain":
|
|
|
|
result = "EG";
|
2019-01-24 13:09:45 +01:00
|
|
|
break;
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmagain":
|
|
|
|
result = "EG";
|
2019-01-24 13:09:45 +01:00
|
|
|
break;
|
2019-01-24 13:03:19 +01:00
|
|
|
case "dmagain":
|
|
|
|
result = "EG";
|
2018-05-22 10:11:50 +02:00
|
|
|
break;
|
|
|
|
case "smaspread":
|
|
|
|
result = "SS";
|
|
|
|
break;
|
|
|
|
case "emaspread":
|
|
|
|
result = "ES";
|
|
|
|
break;
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmaspread":
|
|
|
|
result = "ES";
|
2019-01-24 13:09:45 +01:00
|
|
|
break;
|
2019-01-24 13:03:19 +01:00
|
|
|
case "dmaspread":
|
|
|
|
result = "ES";
|
2019-01-24 13:09:45 +01:00
|
|
|
break;
|
2018-05-22 10:11:50 +02:00
|
|
|
case "smacross":
|
|
|
|
result = "SC";
|
|
|
|
break;
|
|
|
|
case "emacross":
|
|
|
|
result = "EC";
|
|
|
|
break;
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmacross":
|
|
|
|
result = "SC";
|
|
|
|
break;
|
|
|
|
case "dmacross":
|
|
|
|
result = "EC";
|
|
|
|
break;
|
2018-05-22 10:11:50 +02:00
|
|
|
case "rsi":
|
|
|
|
result = "RSI";
|
|
|
|
break;
|
|
|
|
case "stoch":
|
|
|
|
result = "STOCH";
|
|
|
|
break;
|
|
|
|
case "stochrsi":
|
|
|
|
result = "SRSI";
|
|
|
|
break;
|
2018-12-01 17:55:12 +01:00
|
|
|
case "stochrsik":
|
|
|
|
result = "SRSIK";
|
|
|
|
break;
|
|
|
|
case "stochrsid":
|
|
|
|
result = "SRSID";
|
|
|
|
break;
|
|
|
|
case "stochrsicross":
|
|
|
|
result = "SRSIC";
|
|
|
|
break;
|
2018-05-22 10:11:50 +02:00
|
|
|
case "macd":
|
|
|
|
result = "MACD";
|
|
|
|
break;
|
|
|
|
case "obv":
|
|
|
|
result = "OBV";
|
|
|
|
break;
|
|
|
|
case "bbwidth":
|
|
|
|
result = "BBW";
|
2019-01-24 13:09:45 +01:00
|
|
|
break;
|
2019-01-24 13:03:19 +01:00
|
|
|
case "pdhigh":
|
|
|
|
result = "PDH";
|
2018-05-22 10:11:50 +02:00
|
|
|
break;
|
|
|
|
case "anderson":
|
|
|
|
result = "AND";
|
|
|
|
break;
|
|
|
|
case "som enabled":
|
|
|
|
result = "SOM";
|
|
|
|
break;
|
|
|
|
case "max buy times":
|
2018-12-19 15:40:44 +01:00
|
|
|
result = "DCAMAX";
|
2018-05-22 10:11:50 +02:00
|
|
|
break;
|
|
|
|
case "max pairs":
|
|
|
|
result = "PAIRS";
|
|
|
|
break;
|
|
|
|
case "max spread":
|
|
|
|
result = "SPREAD";
|
|
|
|
break;
|
|
|
|
case "price increase":
|
|
|
|
result = "PIN";
|
|
|
|
break;
|
|
|
|
case "min buy volume":
|
|
|
|
result = "VOL";
|
|
|
|
break;
|
|
|
|
case "min buy balance":
|
|
|
|
result = "MIN";
|
|
|
|
break;
|
|
|
|
case "coin age":
|
|
|
|
result = "AGE";
|
|
|
|
break;
|
|
|
|
case "too new":
|
|
|
|
result = "NEW";
|
|
|
|
break;
|
|
|
|
case "blacklisted":
|
|
|
|
result = "BLACK";
|
|
|
|
break;
|
|
|
|
case "insufficient balance":
|
|
|
|
result = "BAL";
|
|
|
|
break;
|
|
|
|
case "max cost reached":
|
|
|
|
result = "COST";
|
2019-03-21 11:13:15 +01:00
|
|
|
break;
|
2019-03-21 10:56:48 +01:00
|
|
|
case "rebuy timeout":
|
|
|
|
result = "TIMEOUT";
|
2018-05-22 10:11:50 +02:00
|
|
|
break;
|
2019-03-21 15:07:10 +01:00
|
|
|
case "min/max change perc":
|
|
|
|
result = "MIN/MAX";
|
|
|
|
break;
|
2018-05-22 10:11:50 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (onlyValidStrategies)
|
|
|
|
{
|
2019-01-14 05:41:09 +01:00
|
|
|
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)
|
2018-12-15 22:07:29 +01:00
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
public static bool IsValidStrategy(string strategyName)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
return StrategyHelper.IsValidStrategy(strategyName, false);
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
public static bool IsValidStrategy(string strategyName, bool checkForAnyInvalid)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
bool result = false;
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (!checkForAnyInvalid)
|
|
|
|
{
|
|
|
|
switch (strategyName.ToLower())
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
case "lowbb":
|
|
|
|
case "highbb":
|
|
|
|
case "gain":
|
|
|
|
case "loss":
|
|
|
|
case "smagain":
|
|
|
|
case "emagain":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmagain":
|
|
|
|
case "dmagain":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "smaspread":
|
|
|
|
case "emaspread":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmaspread":
|
|
|
|
case "dmaspread":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "smacross":
|
|
|
|
case "emacross":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmacross":
|
|
|
|
case "dmacross":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "rsi":
|
|
|
|
case "stoch":
|
|
|
|
case "stochrsi":
|
2018-12-01 18:06:14 +01:00
|
|
|
case "stochrsik":
|
|
|
|
case "stochrsid":
|
|
|
|
case "stochrsicross":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "macd":
|
|
|
|
case "obv":
|
|
|
|
case "bbwidth":
|
|
|
|
case "anderson":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "dema":
|
|
|
|
case "hma":
|
|
|
|
case "pdhigh":
|
2019-02-15 21:26:37 +01:00
|
|
|
case "signal":
|
2018-05-22 10:11:50 +02:00
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
if (strategyName.IndexOf("max", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("min", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("som", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("price", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("black", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("new", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("insufficient", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("timeout", StringComparison.InvariantCultureIgnoreCase) == -1
|
|
|
|
&& strategyName.IndexOf("spread", StringComparison.InvariantCultureIgnoreCase) == -1
|
2018-12-15 22:07:29 +01:00
|
|
|
&& strategyName.IndexOf("pairs", StringComparison.InvariantCultureIgnoreCase) == -1)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
public static int GetStrategyValueDecimals(string strategyName)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
int result = 0;
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
switch (strategyName.ToLower())
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
case "lowbb":
|
|
|
|
case "highbb":
|
|
|
|
result = 8;
|
|
|
|
break;
|
|
|
|
case "gain":
|
|
|
|
case "loss":
|
|
|
|
case "smagain":
|
|
|
|
case "emagain":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmagain":
|
|
|
|
case "dmagain":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "smaspread":
|
|
|
|
case "emaspread":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmaspread":
|
|
|
|
case "dmaspread":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "smacross":
|
|
|
|
case "emacross":
|
2019-01-24 13:03:19 +01:00
|
|
|
case "hmacross":
|
|
|
|
case "dmacross":
|
|
|
|
case "anderson":
|
|
|
|
case "pdhigh":
|
2018-05-22 10:11:50 +02:00
|
|
|
result = 2;
|
|
|
|
break;
|
|
|
|
case "rsi":
|
|
|
|
case "stochrsi":
|
2018-12-01 18:06:14 +01:00
|
|
|
case "stochrsik":
|
|
|
|
case "stochrsid":
|
|
|
|
case "stochrsicross":
|
2018-05-22 10:11:50 +02:00
|
|
|
case "stoch":
|
|
|
|
case "macd":
|
|
|
|
case "obv":
|
|
|
|
case "bbwidth":
|
|
|
|
result = 0;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
public static string GetStrategyText(Summary summary, List<Strategy> strategies, string strategyText, bool isTrue, bool isTrailingBuyActive)
|
2019-02-23 04:20:07 +01:00
|
|
|
{
|
|
|
|
bool isValidStrategy = false;
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (strategies.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (Strategy strategy in strategies)
|
|
|
|
{
|
2018-06-05 09:40:22 +02:00
|
|
|
string textClass = (strategy.IsTrue) ? "label-success" : "label-danger";
|
2019-02-23 04:20:07 +01:00
|
|
|
|
|
|
|
isValidStrategy = StrategyHelper.IsValidStrategy(strategy.Name);
|
|
|
|
|
|
|
|
if (!isValidStrategy)
|
2018-12-15 22:07:29 +01:00
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
strategyText += "<span class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategy.Name + "\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + "</span> ";
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
strategyText += "<span class=\"label " + textClass + "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategy.Name + "\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + "</span> ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (isTrailingBuyActive)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
strategyText += " <i class=\"fa fa-flag text-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Trailing active!\"></i>";
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (isTrue)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
strategyText = "<span class=\"label label-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategyText + "\">" + StrategyHelper.GetStrategyShortcut(strategyText, true) + "</span>";
|
2018-06-05 09:40:22 +02:00
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (isTrailingBuyActive)
|
|
|
|
{
|
2018-06-05 09:40:22 +02:00
|
|
|
strategyText += " <i class=\"fa fa-flag text-success\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Trailing active!\"></i>";
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-23 04:20:07 +01:00
|
|
|
|
|
|
|
isValidStrategy = StrategyHelper.IsValidStrategy(strategyText);
|
|
|
|
|
|
|
|
if (isValidStrategy)
|
2018-12-15 22:07:29 +01:00
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
strategyText = "<span class=\"label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategyText + "\">" + StrategyHelper.GetStrategyShortcut(strategyText, true) + "</span>";
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
2019-02-23 04:20:07 +01:00
|
|
|
|
|
|
|
else if (strategyText.Equals("") && isValidStrategy == false)
|
2018-12-15 22:07:29 +01:00
|
|
|
{
|
2019-02-23 04:20:07 +01:00
|
|
|
strategyText = "<span class=\"label label-muted\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Not Applicable: Not using DCA!\"></span>";
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
strategyText = "<span class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"" + strategyText + "\">" + StrategyHelper.GetStrategyShortcut(strategyText, false) + "</span> ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return strategyText;
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
public static string GetCurrentValueText(List<Strategy> strategies, string strategyText, double bbValue, double simpleValue, bool includeShortcut)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
string result = "";
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (strategies.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (Strategy strategy in strategies)
|
|
|
|
{
|
|
|
|
if (StrategyHelper.IsValidStrategy(strategy.Name))
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
if (!result.Equals("")) result += "<br />";
|
|
|
|
|
|
|
|
string decimalFormat = "";
|
|
|
|
int decimals = StrategyHelper.GetStrategyValueDecimals(strategy.Name);
|
2018-12-15 22:07:29 +01:00
|
|
|
for (int d = 1; d <= decimals; d++)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
decimalFormat += "0";
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (includeShortcut)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += "<span class=\"text-muted\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, true) + "</span> ";
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (StrategyHelper.GetStrategyShortcut(strategy.Name, true).IndexOf("and", StringComparison.InvariantCultureIgnoreCase) > -1)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += simpleValue.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"));
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (decimals == 0)
|
|
|
|
{
|
|
|
|
if (!SystemHelper.IsInteger(strategy.CurrentValue))
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.CurrentValue.ToString("#,#", new System.Globalization.CultureInfo("en-US"));
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.CurrentValue.ToString("#,#0", new System.Globalization.CultureInfo("en-US"));
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.CurrentValue.ToString("#,#0." + decimalFormat, new System.Globalization.CultureInfo("en-US"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (StrategyHelper.GetStrategyShortcut(strategyText, true).IndexOf("bb", StringComparison.InvariantCultureIgnoreCase) > -1)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result = bbValue.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"));
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result = simpleValue.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
public static string GetTriggerValueText(Summary summary, List<Strategy> strategies, string strategyText, double bbValue, double simpleValue, int buyLevel, bool includeShortcut)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
string result = "";
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (strategies.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (Strategy strategy in strategies)
|
|
|
|
{
|
|
|
|
if (StrategyHelper.IsValidStrategy(strategy.Name))
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
if (!result.Equals("")) result += "<br />";
|
|
|
|
|
|
|
|
string decimalFormat = "";
|
|
|
|
int decimals = StrategyHelper.GetStrategyValueDecimals(strategy.Name);
|
2018-12-15 22:07:29 +01:00
|
|
|
for (int d = 1; d <= decimals; d++)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
decimalFormat += "0";
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (includeShortcut)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += "<span class=\"text-muted\">" + StrategyHelper.GetStrategyShortcut(strategy.Name, true) + "</span> ";
|
|
|
|
}
|
|
|
|
|
2018-12-15 22:07:29 +01:00
|
|
|
if (StrategyHelper.GetStrategyShortcut(strategy.Name, true).IndexOf("and", StringComparison.InvariantCultureIgnoreCase) > -1)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.TriggerValue.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"));
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (decimals == 0)
|
|
|
|
{
|
|
|
|
if (!SystemHelper.IsInteger(strategy.EntryValue))
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.EntryValue.ToString(new System.Globalization.CultureInfo("en-US"));
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.EntryValue.ToString("#,#0", new System.Globalization.CultureInfo("en-US"));
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result += strategy.EntryValue.ToString("#,#0." + decimalFormat, new System.Globalization.CultureInfo("en-US"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (StrategyHelper.GetStrategyShortcut(strategyText, true).IndexOf("bb", StringComparison.InvariantCultureIgnoreCase) > -1)
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
result = bbValue.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"));
|
2018-12-15 22:07:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (simpleValue == Constants.MinTrendChange)
|
|
|
|
{
|
|
|
|
if (summary.DCATriggers.ContainsKey(buyLevel + 1))
|
|
|
|
{
|
2018-05-22 10:11:50 +02:00
|
|
|
simpleValue = summary.DCATriggers[buyLevel + 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result = simpleValue.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
2019-02-15 21:26:37 +01:00
|
|
|
}
|