Class MarketHintSignal
java.lang.Object
com.wualabs.qtsurfer.engine.strategy.event.AbstractStrategyEvent
com.wualabs.qtsurfer.engine.strategy.event.signal.AbstractStrategySignal
com.wualabs.qtsurfer.engine.strategy.event.signal.InfoStrategySignal
com.wualabs.qtsurfer.engine.strategy.event.signal.EventTypeValueSignal
com.wualabs.qtsurfer.engine.strategy.event.signal.MarketHintSignal
- All Implemented Interfaces:
Event<Strategy>, StrategySignal, StrategyEvent
- Direct Known Subclasses:
BuySignal, SellSignal
Market hint signal
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class AbstractStrategyEvent
strategy, type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMarketHintSignal(@NonNull Strategy strategy, @NonNull MarketHintSignal.Kind hintKind, @NonNull Instrument instrument, @NonNull Number price) -
Method Summary
Modifier and TypeMethodDescriptionabstract <T extends MarketHintSignal>
Tcopy()protected <T extends MarketHintSignal>
TcopyInternal(T copy) Copies all properties, timestamp, and order kind to the target signal.Collection<com.wualabs.qtsurfer.engine.exchange.trade.OrderFlag> getFlags()Returns order flags (FOK, IOC, etc.) supporting multiple storage formats: array, single value, or collection.getKind()getPrice()doublebooleanReturns whether this signal carries stop-loss parameters.<T extends MarketHintSignal>
TsetFlags(@NonNull com.wualabs.qtsurfer.engine.exchange.trade.OrderFlag... flags) <T extends MarketHintSignal>
TsetMaxTries(int maxTries) <T extends MarketHintSignal>
TsetOrderKind(@NonNull MarketHintSignal.OrderKind orderKind) <T extends MarketHintSignal>
TsetSellPercent(double percent) <T extends MarketHintSignal>
TsetStopCondition(BooleanSupplier stopCondition) Gates an engine-side stop (trailing or fixed) this signal arms on a strategy-supplied macro condition: the stop then fires only on a price crossing and while the predicate returnstrue, reproducing the ScalpingV2 "stop only in confirmed weakness" pattern as a config seam rather than per-strategy code.<T extends MarketHintSignal>
TsetStopLimitPrice(Number limitPrice) Sets the limit price for a stop-limit order.<T extends MarketHintSignal>
TsetStopPrice(Number stopPrice) Sets the stop-loss trigger price on this signal, allowing aBuySignalto carry stop-loss configuration so the pipeline can auto-place a stop order after the buy fills.<T extends MarketHintSignal>
TsetTrailPercent(Number trailPercent) Sets the trailing-stop distance as a PERCENT of the running price extreme .Methods inherited from class EventTypeValueSignal
getEventTypeValueMethods inherited from class AbstractStrategySignal
equals, getInstrument, hashCode, toStringMethods inherited from class AbstractStrategyEvent
get, getProperties, getStrategy, getTimestamp, getType, has, now, set, setTimestamp, toStringMethods inherited from interface StrategyEvent
getProperties, getSource, getStrategy, getTimestamp, getType
-
Field Details
-
EXCHANGE_NAME
- See Also:
-
KEY_FLAGS
- See Also:
-
KEY_MAX_TRIES
- See Also:
-
KEY_SELL_PERCENT
- See Also:
-
KEY_STOP_PRICE
- See Also:
-
KEY_STOP_LIMIT_PRICE
- See Also:
-
KEY_TRAIL_PERCENT
- See Also:
-
-
Constructor Details
-
MarketHintSignal
protected MarketHintSignal(@NonNull @NonNull Strategy strategy, @NonNull @NonNull MarketHintSignal.Kind hintKind, @NonNull @NonNull Instrument instrument, @NonNull @NonNull Number price)
-
-
Method Details
-
setOrderKind
public <T extends MarketHintSignal> T setOrderKind(@NonNull @NonNull MarketHintSignal.OrderKind orderKind) -
setMaxTries
-
getMaxTries
-
setSellPercent
-
getSellPercent
public double getSellPercent() -
setFlags
public <T extends MarketHintSignal> T setFlags(@NonNull @NonNull com.wualabs.qtsurfer.engine.exchange.trade.OrderFlag... flags) -
getFlags
Returns order flags (FOK, IOC, etc.) supporting multiple storage formats: array, single value, or collection. Returns null if no flags are set.- Returns:
- the order flags collection, or null
-
setStopPrice
Sets the stop-loss trigger price on this signal, allowing aBuySignalto carry stop-loss configuration so the pipeline can auto-place a stop order after the buy fills. -
getStopPrice
-
setStopLimitPrice
Sets the limit price for a stop-limit order. If not set, the stop will be placed as a stop-market order. -
getStopLimitPrice
-
setTrailPercent
Sets the trailing-stop distance as a PERCENT of the running price extreme . Only meaningful whengetOrderKind()isMarketHintSignal.OrderKind.stopTrailing: the backtest pending-order resolver tracksmax(extreme, tick.last())for a trailing SELL (mirrored as a running min for a trailing BUY) and fires when price retraces this percent from that extreme, filling at the trigger level. -
getTrailPercent
-
setStopCondition
Gates an engine-side stop (trailing or fixed) this signal arms on a strategy-supplied macro condition: the stop then fires only on a price crossing and while the predicate returnstrue, reproducing the ScalpingV2 "stop only in confirmed weakness" pattern as a config seam rather than per-strategy code. The predicate is consulted afresh on every observed price, so a strategy can suppress a stop while the wider trend is still in its favour and let it through once that turns.Unset (the default) means always fire — behaviour is unchanged for a strategy that never sets one. This can only take effect on an engine-side stop: a native resting order on the exchange fires unconditionally and cannot consult a live predicate, which is one of the reasons conditional stops are emulated in the engine. Setting a stop condition on a signal that also carries a fixed stop price places that stop engine-side instead of as a native order.
-
getStopCondition
-
hasStopLoss
public boolean hasStopLoss()Returns whether this signal carries stop-loss parameters. -
copy
-
copyInternal
Copies all properties, timestamp, and order kind to the target signal. Used by subclasscopy()implementations to clone signal state.- Parameters:
copy- the target signal to copy state into- Returns:
- the populated copy
-
getKind
-
getPrice
-
getOrderKind
-