[GAP-052]: tick value table consolidation complete
- InstrumentTickValueTable.cs: add shared platform-neutral union tick-value table - BasicRiskManager.cs and BasicPositionSizer.cs: delegate tick lookup and supported symbols to shared table - AdvancedRiskManager.cs and AdvancedPositionSizer.cs: remove duplicate tick tables and delegate to shared table - BasicRiskManagerTests.cs: prove risk/sizing table parity and 6A uses tick value - SPRINT_BOARD.md and decisions.md: record Option A, platform-neutrality rationale, and verification evidence Build: clean | Tests: 552 passing; Core 463 passing | Dual-deployed: no - skipped per operator instruction
This commit is contained in:
47
src/NT8.Core/Common/InstrumentTickValueTable.cs
Normal file
47
src/NT8.Core/Common/InstrumentTickValueTable.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NT8.Core.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Shared Phase 0 tick-value lookup for platform-neutral risk and sizing components.
|
||||
/// </summary>
|
||||
public static class InstrumentTickValueTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the currency value of one tick for the supplied symbol.
|
||||
/// </summary>
|
||||
public static double GetTickValue(string symbol)
|
||||
{
|
||||
switch (symbol)
|
||||
{
|
||||
case "ES": return 12.50;
|
||||
case "MES": return 1.25;
|
||||
case "NQ": return 5.00;
|
||||
case "MNQ": return 0.50;
|
||||
case "CL": return 10.00;
|
||||
case "GC": return 10.00;
|
||||
case "6E": return 12.50;
|
||||
case "6A": return 10.00;
|
||||
default: return 12.50;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets supported symbols with their tick values.
|
||||
/// </summary>
|
||||
public static Dictionary<string, double> GetSupportedSymbols()
|
||||
{
|
||||
var symbols = new Dictionary<string, double>();
|
||||
symbols.Add("ES", 12.50);
|
||||
symbols.Add("MES", 1.25);
|
||||
symbols.Add("NQ", 5.00);
|
||||
symbols.Add("MNQ", 0.50);
|
||||
symbols.Add("CL", 10.00);
|
||||
symbols.Add("GC", 10.00);
|
||||
symbols.Add("6E", 12.50);
|
||||
symbols.Add("6A", 10.00);
|
||||
return symbols;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using NT8.Core.Common;
|
||||
using NT8.Core.Common.Models;
|
||||
using NT8.Core.Logging;
|
||||
using System;
|
||||
@@ -539,17 +540,7 @@ namespace NT8.Core.Risk
|
||||
/// </summary>
|
||||
private static double GetTickValue(string symbol)
|
||||
{
|
||||
// Static tick values - will be enhanced with dynamic lookup in future phases
|
||||
switch (symbol)
|
||||
{
|
||||
case "ES": return 12.50;
|
||||
case "MES": return 1.25;
|
||||
case "NQ": return 5.00;
|
||||
case "MNQ": return 0.50;
|
||||
case "CL": return 10.00;
|
||||
case "GC": return 10.00;
|
||||
default: return 12.50; // Default to ES
|
||||
}
|
||||
return InstrumentTickValueTable.GetTickValue(symbol);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -931,4 +922,4 @@ namespace NT8.Core.Risk
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using NT8.Core.Common;
|
||||
using NT8.Core.Common.Models;
|
||||
using NT8.Core.Logging;
|
||||
using System;
|
||||
@@ -177,17 +178,7 @@ namespace NT8.Core.Risk
|
||||
|
||||
private static double GetTickValue(string symbol)
|
||||
{
|
||||
// Static tick values for Phase 0 - will be configurable in Phase 1
|
||||
switch (symbol)
|
||||
{
|
||||
case "ES": return 12.50;
|
||||
case "MES": return 1.25;
|
||||
case "NQ": return 5.00;
|
||||
case "MNQ": return 0.50;
|
||||
case "CL": return 10.00;
|
||||
case "GC": return 10.00;
|
||||
default: return 12.50; // Default to ES
|
||||
}
|
||||
return InstrumentTickValueTable.GetTickValue(symbol);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -195,14 +186,7 @@ namespace NT8.Core.Risk
|
||||
/// </summary>
|
||||
public static Dictionary<string, double> GetSupportedSymbols()
|
||||
{
|
||||
var symbols = new Dictionary<string, double>();
|
||||
symbols.Add("ES", 12.50);
|
||||
symbols.Add("MES", 1.25);
|
||||
symbols.Add("NQ", 5.00);
|
||||
symbols.Add("MNQ", 0.50);
|
||||
symbols.Add("CL", 10.00);
|
||||
symbols.Add("GC", 10.00);
|
||||
return symbols;
|
||||
return InstrumentTickValueTable.GetSupportedSymbols();
|
||||
}
|
||||
|
||||
private int GetOpenPositionCount()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using NT8.Core.Common;
|
||||
using NT8.Core.Common.Models;
|
||||
using NT8.Core.Intelligence;
|
||||
using NT8.Core.Logging;
|
||||
@@ -506,19 +507,7 @@ namespace NT8.Core.Sizing
|
||||
|
||||
private static double GetTickValue(string symbol)
|
||||
{
|
||||
// Static tick values for Phase 0 - will be configurable in Phase 1
|
||||
switch (symbol)
|
||||
{
|
||||
case "ES": return 12.50; // E-mini S&P 500
|
||||
case "MES": return 1.25; // Micro E-mini S&P 500
|
||||
case "NQ": return 5.00; // E-mini NASDAQ-100
|
||||
case "MNQ": return 0.50; // Micro E-mini NASDAQ-100
|
||||
case "CL": return 10.00; // Crude Oil
|
||||
case "GC": return 10.00; // Gold
|
||||
case "6E": return 12.50; // Euro FX
|
||||
case "6A": return 10.00; // Australian Dollar
|
||||
default: return 12.50; // Default to ES value
|
||||
}
|
||||
return InstrumentTickValueTable.GetTickValue(symbol);
|
||||
}
|
||||
|
||||
public SizingMetadata GetMetadata()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using NT8.Core.Common;
|
||||
using NT8.Core.Common.Models;
|
||||
using NT8.Core.Logging;
|
||||
using System;
|
||||
@@ -154,19 +155,7 @@ namespace NT8.Core.Sizing
|
||||
|
||||
private static double GetTickValue(string symbol)
|
||||
{
|
||||
// Static tick values for Phase 0 - will be configurable in Phase 1
|
||||
switch (symbol)
|
||||
{
|
||||
case "ES": return 12.50; // E-mini S&P 500
|
||||
case "MES": return 1.25; // Micro E-mini S&P 500
|
||||
case "NQ": return 5.00; // E-mini NASDAQ-100
|
||||
case "MNQ": return 0.50; // Micro E-mini NASDAQ-100
|
||||
case "CL": return 10.00; // Crude Oil
|
||||
case "GC": return 10.00; // Gold
|
||||
case "6E": return 12.50; // Euro FX
|
||||
case "6A": return 10.00; // Australian Dollar
|
||||
default: return 12.50; // Default to ES value
|
||||
}
|
||||
return InstrumentTickValueTable.GetTickValue(symbol);
|
||||
}
|
||||
|
||||
public SizingMetadata GetMetadata()
|
||||
@@ -230,17 +219,7 @@ namespace NT8.Core.Sizing
|
||||
/// </summary>
|
||||
public static Dictionary<string, double> GetSupportedSymbols()
|
||||
{
|
||||
var symbols = new Dictionary<string, double>();
|
||||
symbols.Add("ES", 12.50);
|
||||
symbols.Add("MES", 1.25);
|
||||
symbols.Add("NQ", 5.00);
|
||||
symbols.Add("MNQ", 0.50);
|
||||
symbols.Add("CL", 10.00);
|
||||
symbols.Add("GC", 10.00);
|
||||
symbols.Add("6E", 12.50);
|
||||
symbols.Add("6A", 10.00);
|
||||
|
||||
return symbols;
|
||||
return InstrumentTickValueTable.GetSupportedSymbols();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user