hoodkit
    Preparing search index...

    Interface PriceTriggers

    Fire callbacks when Stock Token prices cross thresholds. Wraps streamPrices; tracks the last price per symbol and emits a CrossEvent each time a configured threshold is crossed.

    const triggers = createPriceTriggers(hood)
    triggers.onCross('AAPL', 250, 'up', (e) => console.log('AAPL broke $250', e.price))
    // later: triggers.stop()
    interface PriceTriggers {
        onCross(
            symbol: string,
            threshold: number,
            direction: CrossDirection,
            callback: (event: CrossEvent) => void,
        ): () => void;
        stop(): void;
    }
    Index
    • Register a threshold crossing callback. Returns an unsubscribe fn.

      Parameters

      Returns () => void