Initial quant trader service baseline
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.quantai.trader.domain;
|
||||
|
||||
import com.quantai.trader.enums.TraderSide;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
public record TraderPositionPath(
|
||||
String runId,
|
||||
String cycleId,
|
||||
String actionId,
|
||||
String positionId,
|
||||
TraderSide side,
|
||||
Instant entryTime,
|
||||
Instant lastEventTime,
|
||||
BigDecimal entryPrice,
|
||||
BigDecimal currentPrice,
|
||||
BigDecimal mfeBps,
|
||||
BigDecimal maeBps,
|
||||
Long timeToTargetMs,
|
||||
Long timeToInvalidMs,
|
||||
boolean targetBeforeStop,
|
||||
boolean stagnationTimeoutHit,
|
||||
boolean proxyOnly,
|
||||
boolean reduceSeen,
|
||||
int filledLegCount,
|
||||
BigDecimal totalPositionRatio,
|
||||
Map<String, Object> pathSummary
|
||||
) {
|
||||
|
||||
public TraderPositionPath {
|
||||
pathSummary = Maps.immutable(pathSummary);
|
||||
}
|
||||
|
||||
public boolean opened() {
|
||||
return positionId != null && filledLegCount > 0;
|
||||
}
|
||||
|
||||
public boolean fullSize() {
|
||||
return totalPositionRatio != null && totalPositionRatio.compareTo(BigDecimal.ONE) >= 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user