public DeltaStrategy( ISearcher searcher, IStakingService stakingService, DeltaParameters parameters) { _searcher = searcher; _stakingService = stakingService; _parameters = parameters; }
public void DeltaStrategyTest() { var data = CreateMarketData(); var parameters = new DeltaParameters(); var target = SimulateStrategy(data, x => x.Create(parameters)); var actual = ToApprovedString(target); Approvals.Verify(actual); }
public void Optimise(DateTime fromDate, DateTime endDate) { _stakingService.Evaluate(fromDate, endDate); var potentials = Enumerable.Range(1, 100).Select(x => { var threshold = (decimal)x / 1000; return(new DeltaParameters { Threshold = threshold }); }); var optimum = _searcher.Maximum(potentials, fromDate, endDate); _parameters = (DeltaParameters)optimum; }
public IStrategy Create(IParameters parameters) { return(parameters switch { LinearRegressionParameters p => Create(p), RelativeStrengthParameters p => Create(p), DeltaParameters p => Create(p), VolumeParameters p => Create(p), GradientParameters p => Create(p), EntropyParameters p => Create(p), StaticDatesParameters p => Create(p), MovingAverageParameters p => Create(p), HolidayEffectParameters p => Create(p), WeightedParameters p => Create(p), OptimalStoppingParameters p => Create(p), ProbabilityParameters p => Create(p), SpreadParameters p => Create(p), ClusteringParameters p => Create(p), _ => throw new NotImplementedException(), });