File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ export const datasets: CandleDataset[] = [
8585 } ,
8686] ;
8787
88- /** Look up a dataset by its `id` (e.g. `'uptrend-stx'`), or `undefined` if there is no match. */
8988export function getDataset ( id : string ) : CandleDataset | undefined {
9089 return datasets . find ( dataset => dataset . id === id ) ;
9190}
Original file line number Diff line number Diff line change @@ -19,15 +19,7 @@ export abstract class MarketDataSource extends EventEmitter {
1919
2020 /**
2121 * Fetch the most recent `count` candles of the given interval, oldest first β so a strategy can
22- * say "300 hourly candles" without computing calendar windows itself. This is the `count > 1`
23- * generalization of `getLatestCandle`: same "anchor to the latest real bar" trick, wider window.
24- *
25- * Anchors the window's end to the latest real bar (so market closures β nights, weekends,
26- * holidays β don't leave us with an empty "now" window that never fills) and pins it there while
27- * widening the start backward. `getCandles` already paginates a time window to exhaustion, so each
28- * attempt returns a superset of the previous one β no cross-window dedupe needed. We over-ask and
29- * widen only because `count` bars can span far more wall-clock than `count * interval` once closed
30- * sessions are excluded. Built purely on the abstract `getCandles`/`getLatestCandle`.
22+ * say "300 hourly candles" without computing calendar windows itself.
3123 */
3224 async getRecentCandles ( pair : TradingPair , count : number , intervalInMillis : number ) : Promise < Candle [ ] > {
3325 if ( count <= 0 ) {
Original file line number Diff line number Diff line change @@ -69,9 +69,7 @@ export class TradingSession extends EventEmitter<TradingSessionEventMap> {
6969 tradingRules,
7070 } ;
7171
72- if ( this . #strategy. init ) {
73- await this . #strategy. init ( this . #broker, this . #pair) ;
74- }
72+ await this . #strategy. init ?.( this . #broker, this . #pair) ;
7573
7674 // Subscribe to candles only after state is ready
7775 const openTimeInISO = new Date ( ) . toISOString ( ) ;
You canβt perform that action at this time.
0 commit comments