Phase 0 completion: NT8 SDK core framework with risk management and position sizing
Some checks failed
Build and Test / build (push) Has been cancelled

This commit is contained in:
Billy Valentine
2025-09-09 17:06:37 -04:00
parent 97e5050d3e
commit 92f3732b3d
109 changed files with 38593 additions and 380 deletions

View File

@@ -0,0 +1,49 @@
using NT8.Core.Common.Models;
using System;
using System.Collections.Generic;
namespace NT8.Core.Tests
{
public static class TestDataBuilder
{
public static StrategyIntent CreateValidIntent(
string symbol = "ES",
int stopTicks = 8,
OrderSide side = OrderSide.Buy)
{
return new StrategyIntent(
symbol: symbol,
side: side,
entryType: OrderType.Market,
limitPrice: null,
stopTicks: stopTicks,
targetTicks: 16,
confidence: 0.8,
reason: "Test intent",
metadata: new Dictionary<string, object>()
);
}
public static StrategyContext CreateTestContext(string symbol = "ES")
{
return new StrategyContext(
symbol: symbol,
currentTime: DateTime.UtcNow,
currentPosition: new Position(symbol, 0, 0, 0, 0, DateTime.UtcNow),
account: new AccountInfo(50000, 50000, 0, 0, DateTime.UtcNow),
session: new MarketSession(DateTime.Today.AddHours(9.5), DateTime.Today.AddHours(16), true, "RTH"),
customData: new Dictionary<string, object>()
);
}
public static RiskConfig CreateTestRiskConfig()
{
return new RiskConfig(
dailyLossLimit: 1000,
maxTradeRisk: 500,
maxOpenPositions: 5,
emergencyFlattenEnabled: true
);
}
}
}