Add StochasticCross indicator support in GeneticService and related classes
- Introduced StochasticCross indicator type in GeneticService with configuration settings for stochPeriods, signalPeriods, smoothPeriods, kFactor, and dFactor. - Updated IIndicator interface and IndicatorBase class to include KFactor and DFactor properties. - Enhanced LightIndicator class to support new properties and ensure proper conversion back to full Indicator. - Modified ScenarioHelpers to handle StochasticCross indicator creation and validation, ensuring default values and error handling for kFactor and dFactor.
This commit is contained in:
@@ -84,6 +84,14 @@ public class GeneticService : IGeneticService
|
||||
["signalPeriods"] = 9.0,
|
||||
["smoothPeriods"] = 3.0
|
||||
},
|
||||
[IndicatorType.StochasticCross] = new()
|
||||
{
|
||||
["stochPeriods"] = 14.0,
|
||||
["signalPeriods"] = 3.0,
|
||||
["smoothPeriods"] = 3.0,
|
||||
["kFactor"] = 3.0,
|
||||
["dFactor"] = 2.0
|
||||
},
|
||||
[IndicatorType.Stc] = new()
|
||||
{
|
||||
["cyclePeriods"] = 10.0,
|
||||
@@ -159,6 +167,14 @@ public class GeneticService : IGeneticService
|
||||
["signalPeriods"] = (3.0, 15.0),
|
||||
["smoothPeriods"] = (1.0, 10.0)
|
||||
},
|
||||
[IndicatorType.StochasticCross] = new()
|
||||
{
|
||||
["stochPeriods"] = (5.0, 30.0),
|
||||
["signalPeriods"] = (3.0, 15.0),
|
||||
["smoothPeriods"] = (1.0, 10.0),
|
||||
["kFactor"] = (0.1, 10.0),
|
||||
["dFactor"] = (0.1, 10.0)
|
||||
},
|
||||
[IndicatorType.Stc] = new()
|
||||
{
|
||||
["cyclePeriods"] = (5.0, 50.0),
|
||||
@@ -188,6 +204,7 @@ public class GeneticService : IGeneticService
|
||||
[IndicatorType.SuperTrendCrossEma] = ["period", "multiplier"],
|
||||
[IndicatorType.ChandelierExit] = ["period", "multiplier"],
|
||||
[IndicatorType.StochRsiTrend] = ["period", "stochPeriods", "signalPeriods", "smoothPeriods"],
|
||||
[IndicatorType.StochasticCross] = ["stochPeriods", "signalPeriods", "smoothPeriods", "kFactor", "dFactor"],
|
||||
[IndicatorType.Stc] = ["cyclePeriods", "fastPeriods", "slowPeriods"],
|
||||
[IndicatorType.LaggingStc] = ["cyclePeriods", "fastPeriods", "slowPeriods"]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user