@@ -7,8 +7,6 @@ namespace Managing.Domain.Scenarios;
|
||||
|
||||
public static class ScenarioHelpers
|
||||
{
|
||||
|
||||
|
||||
public static IEnumerable<IStrategy> GetStrategiesFromScenario(Scenario scenario)
|
||||
{
|
||||
var strategies = new List<IStrategy>();
|
||||
@@ -45,6 +43,10 @@ public static class ScenarioHelpers
|
||||
strategy.SmoothPeriods.Value),
|
||||
StrategyType.Stc => new STCStrategy(strategy.Name, strategy.CyclePeriods.Value,
|
||||
strategy.FastPeriods.Value, strategy.SlowPeriods.Value),
|
||||
StrategyType.LaggingStc => new LaggingSTC(strategy.Name, strategy.CyclePeriods.Value,
|
||||
strategy.FastPeriods.Value, strategy.SlowPeriods.Value),
|
||||
StrategyType.SuperTrendCrossEma => new SuperTrendCrossEma(strategy.Name,
|
||||
strategy.Period.Value, strategy.Multiplier.Value),
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
|
||||
@@ -101,6 +103,7 @@ public static class ScenarioHelpers
|
||||
case StrategyType.ThreeWhiteSoldiers:
|
||||
break;
|
||||
case StrategyType.SuperTrend:
|
||||
case StrategyType.SuperTrendCrossEma:
|
||||
case StrategyType.ChandelierExit:
|
||||
if (!period.HasValue || !multiplier.HasValue)
|
||||
{
|
||||
@@ -132,6 +135,7 @@ public static class ScenarioHelpers
|
||||
|
||||
break;
|
||||
case StrategyType.Stc:
|
||||
case StrategyType.LaggingStc:
|
||||
if (!fastPeriods.HasValue || !slowPeriods.HasValue || !cyclePeriods.HasValue)
|
||||
{
|
||||
throw new Exception(
|
||||
@@ -168,6 +172,8 @@ public static class ScenarioHelpers
|
||||
StrategyType.StochRsiTrend => SignalType.Trend,
|
||||
StrategyType.Stc => SignalType.Signal,
|
||||
StrategyType.StDev => SignalType.Context,
|
||||
StrategyType.LaggingStc => SignalType.Signal,
|
||||
StrategyType.SuperTrendCrossEma => SignalType.Signal,
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user