Add updates scenario and strategy
This commit is contained in:
@@ -62,6 +62,13 @@ public class ScenarioController : ControllerBase
|
||||
return Ok(_scenarioService.DeleteScenario(name));
|
||||
}
|
||||
|
||||
// Update scenario
|
||||
[HttpPut]
|
||||
public ActionResult UpdateScenario(string name, List<string> strategies, int? loopbackPeriod = null)
|
||||
{
|
||||
return Ok(_scenarioService.UpdateScenario(name, strategies, loopbackPeriod));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all strategies.
|
||||
/// </summary>
|
||||
@@ -126,4 +133,32 @@ public class ScenarioController : ControllerBase
|
||||
{
|
||||
return Ok(_scenarioService.DeleteStrategy(name));
|
||||
}
|
||||
|
||||
// Update strategy
|
||||
[HttpPut]
|
||||
[Route("strategy")]
|
||||
public ActionResult UpdateStrategy(
|
||||
StrategyType strategyType,
|
||||
string name,
|
||||
int? period = null,
|
||||
int? fastPeriods = null,
|
||||
int? slowPeriods = null,
|
||||
int? signalPeriods = null,
|
||||
double? multiplier = null,
|
||||
int? stochPeriods = null,
|
||||
int? smoothPeriods = null,
|
||||
int? cyclePeriods = null)
|
||||
{
|
||||
return Ok(_scenarioService.UpdateStrategy(
|
||||
strategyType,
|
||||
name,
|
||||
period,
|
||||
fastPeriods,
|
||||
slowPeriods,
|
||||
signalPeriods,
|
||||
multiplier,
|
||||
stochPeriods,
|
||||
smoothPeriods,
|
||||
cyclePeriods));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user