Initial commit: Add project files
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
namespace KArtSell.Modules.ModelOperations.Domain;
|
||||
|
||||
public interface ITradingSessionCalendar
|
||||
{
|
||||
DateOnly AddTradingSessions(string calendarId, DateOnly startSession, int sessionCount);
|
||||
}
|
||||
|
||||
public sealed record EvaluationWindowDue(int WindowTradingDays, DateOnly DueSession, string WindowCode);
|
||||
|
||||
public sealed class EvaluationWindowPlanner
|
||||
{
|
||||
public static readonly int[] ApprovedWindows = [1, 5, 20, 63, 126, 252];
|
||||
|
||||
public IReadOnlyList<EvaluationWindowDue> Plan(
|
||||
string calendarId,
|
||||
DateOnly predictionSession,
|
||||
ITradingSessionCalendar calendar)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(calendarId);
|
||||
ArgumentNullException.ThrowIfNull(calendar);
|
||||
return ApprovedWindows
|
||||
.Select(window => new EvaluationWindowDue(
|
||||
window,
|
||||
calendar.AddTradingSessions(calendarId, predictionSession, window),
|
||||
$"W{window:D3}"))
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user