Refactor strategy execution logic to improve clarity on arming conditions
This commit is contained in:
parent
3640cd745e
commit
67b633ae9b
@ -629,8 +629,7 @@ export default function PortfolioSection() {
|
||||
: "Strategy stopped";
|
||||
|
||||
const marketState = marketStatus?.status ?? "UNKNOWN";
|
||||
const executionAllowed =
|
||||
marketState === "OPEN" && (liveness === "ACTIVE" || liveness === "STOPPED");
|
||||
const canArmStrategy = liveness === "ACTIVE" || liveness === "STOPPED";
|
||||
|
||||
const nextEligibleTs = engineStatus?.next_eligible_ts
|
||||
? new Date(engineStatus.next_eligible_ts)
|
||||
@ -1143,7 +1142,7 @@ export default function PortfolioSection() {
|
||||
<MotionButton
|
||||
{...ctaMotionProps}
|
||||
onClick={handleStart}
|
||||
disabled={isStarting || !executionAllowed || isStrategyActive}
|
||||
disabled={isStarting || !canArmStrategy || isStrategyActive}
|
||||
className="shimmer"
|
||||
>
|
||||
{isStarting ? "Starting..." : "Start Strategy"}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user