diff --git "a/classes/types.BrokerBase.html" "b/classes/types.BrokerBase.html" --- "a/classes/types.BrokerBase.html" +++ "b/classes/types.BrokerBase.html" @@ -33,13 +33,13 @@ Extend this class to implement a real exchange adapter for:
onBreakevenCommit — stop-loss moved to entry priceonAverageBuyCommit — new DCA entry added to positionCalled when the stop-loss is moved to breakeven (entry price).
Triggered explicitly after all validations pass, before strategyCoreService.breakeven().
newStopLossPrice equals effectivePriceOpen — the position's effective entry price.
newTakeProfitPrice is unchanged by breakeven.
Default implementation: Logs breakeven event.
Breakeven details: symbol, currentPrice, newStopLossPrice, newTakeProfitPrice, context, backtest
-Called when a partial close at loss is executed.
+Called when a partial close at loss is executed.
Triggered explicitly from strategy.ts / Live.ts / Backtest.ts after all validations pass,
before strategyCoreService.partialLoss(). If this method throws, the DI mutation is skipped.
Use to partially close the position on the exchange at the loss level.
Default implementation: Logs partial loss event.
Partial loss details: symbol, percentToClose, cost (dollar value), currentPrice, context, backtest
-Called when a partial close at profit is executed.
+Called when a partial close at profit is executed.
Triggered explicitly from strategy.ts / Live.ts / Backtest.ts after all validations pass,
before strategyCoreService.partialProfit(). If this method throws, the DI mutation is skipped.
Use to partially close the position on the exchange at the profit level.
Default implementation: Logs partial profit event.
Partial profit details: symbol, percentToClose, cost (dollar value), currentPrice, context, backtest
-Called when a position is fully closed (SL/TP hit or manual close).
+Called when a position is fully closed (SL/TP hit or manual close).
Triggered automatically via syncSubject when a pending signal is closed. Use to place the exit order and record final PnL.
Default implementation: Logs signal-close event.
Signal close details: symbol, cost, position, currentPrice, pnl, totalEntries, totalPartials, context, backtest
-Called when a new position is opened (signal activated).
+Called when a new position is opened (signal activated).
Triggered automatically via syncSubject when a scheduled signal's priceOpen is hit. Use to place the actual entry order on the exchange.
Default implementation: Logs signal-open event.
Signal open details: symbol, cost, position, priceOpen, priceTakeProfit, priceStopLoss, context, backtest
-Called when the trailing stop-loss level is updated.
+Called when the trailing stop-loss level is updated.
Triggered explicitly after all validations pass, before strategyCoreService.trailingStop().
newStopLossPrice is the absolute SL price — use it to update the exchange order directly.
Default implementation: Logs trailing stop event.
Trailing stop details: symbol, percentShift, currentPrice, newStopLossPrice, context, backtest
-Called when the trailing take-profit level is updated.
+Called when the trailing take-profit level is updated.
Triggered explicitly after all validations pass, before strategyCoreService.trailingTake().
newTakeProfitPrice is the absolute TP price — use it to update the exchange order directly.
Default implementation: Logs trailing take event.
Trailing take details: symbol, percentShift, currentPrice, newTakeProfitPrice, context, backtest
-Performs async initialization before the broker starts receiving events.
+Performs async initialization before the broker starts receiving events.
Called once by BrokerProxy via waitForInit() (singleshot) before the first event.
Override to establish exchange connections, authenticate API clients, load configuration.
Default implementation: Logs initialization event.
-
Example
Example
-Example
Example
-Implements
Index
Constructors
Implements
Index
Constructors
Methods
costis the dollar amount of the new DCA entry.Default implementation: Logs average buy event.
Parameters
Average buy details: symbol, currentPrice, cost, context, backtest
-Returns Promise<void>
Example
Returns Promise<void>
Example
-on Breakeven Commit
Called when the stop-loss is moved to breakeven (entry price).
+