d1278b26ee
Deploy to Production / Build Release Package (push) Failing after 17s
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 5s
Deploy to Production / Deploy to Production Server (push) Has been skipped
Deploy to Production / Post-Deployment Checks (push) Has been skipped
Snapshot Admin Deployment / build-and-deploy (push) Failing after 38s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 2m19s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Xunit;
|
|
using QuantEngine.Core.Domain;
|
|
|
|
namespace QuantEngine.Core.Tests
|
|
{
|
|
public class PullbackTriggerCalculatorTests
|
|
{
|
|
[Theory]
|
|
[InlineData(100000, 100000, 3000, "PULLBACK_ZONE", "PASS")] // close <= ma20*1.03
|
|
[InlineData(105000, 100000, 3000, "ABOVE_PULLBACK_ZONE", "BLOCKED")] // close > ma20*1.03
|
|
public void ComputePullbackTrigger_Prices_ReturnExpectedVerdictAndState(
|
|
double close,
|
|
double ma20,
|
|
double atr20,
|
|
string expectedVerdict,
|
|
string expectedState)
|
|
{
|
|
var res = PullbackTriggerCalculator.ComputePullbackTrigger(close, ma20, atr20);
|
|
Assert.Equal(expectedVerdict, res.PullbackEntryVerdict);
|
|
Assert.Equal(expectedState, res.PullbackState);
|
|
}
|
|
|
|
[Fact]
|
|
public void ComputePullbackTrigger_TriggerPrice_CalculatesCorrectly()
|
|
{
|
|
// triggerPrice = ma20 - 0.5 * atr20 = 100000 - 1500 = 98500
|
|
var res = PullbackTriggerCalculator.ComputePullbackTrigger(100000, 100000, 3000);
|
|
Assert.Equal(98500, res.PullbackEntryTriggerPrice);
|
|
}
|
|
}
|
|
}
|