Interface TradingStrategy
- All Known Implementing Classes:
BollingerBandsStrategy,EmaCrossStrategy,MacdStrategy,RsiStrategy,SmaCrossStrategy,StrategyBuilder.DslStrategy
public interface TradingStrategy
A bar-driven trading strategy.
init(BarSeries) is called once by the
backtester (or live engine) to precompute indicators; onBar(int) is
then invoked for each bar in order and must be allocation-free for
low-latency execution.-
Method Details
-
name
String name() -
init
-
onBar
-
stopLossPct
default double stopLossPct()Optional per-trade stop loss as a fraction (0 = disabled). -
takeProfitPct
default double takeProfitPct()Optional per-trade take profit as a fraction (0 = disabled).
-