2ba8def9bb
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Has been cancelled
Quant Engine CI/CD Pipeline / validate-core (pull_request) Has been cancelled
Quant Engine CI/CD Pipeline / validate-ui-and-storage (pull_request) Has been cancelled
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (pull_request) Has been cancelled
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace QuantEngine.Core.Domain
|
|
{
|
|
public class AntiChasingResult
|
|
{
|
|
public string AntiChasingVerdict { get; set; } = "CLEAR";
|
|
public string AntiChasingVelocityStatus { get; set; } = "PASS";
|
|
public double Velocity1dInput { get; set; }
|
|
}
|
|
|
|
public static class AntiChasingCalculator
|
|
{
|
|
public static AntiChasingResult ComputeAntiChasing(double velocity1d)
|
|
{
|
|
string verdict;
|
|
string status;
|
|
|
|
if (velocity1d >= 3.0)
|
|
{
|
|
verdict = "BLOCK_CHASE";
|
|
status = "BLOCKED";
|
|
}
|
|
else if (velocity1d >= 1.5)
|
|
{
|
|
verdict = "PULLBACK_WAIT";
|
|
status = "WAIT";
|
|
}
|
|
else
|
|
{
|
|
verdict = "CLEAR";
|
|
status = "PASS";
|
|
}
|
|
|
|
return new AntiChasingResult
|
|
{
|
|
AntiChasingVerdict = verdict,
|
|
AntiChasingVelocityStatus = status,
|
|
Velocity1dInput = Math.Round(velocity1d, 4)
|
|
};
|
|
}
|
|
}
|
|
}
|