Chartbreaker
    Preparing search index...

    BidAsk Generator

    The BidAsk generator displays real-time bid and ask price lines on the chart using live quote data from push subscriptions.

    Use a Controller object to add the generator to a chart:

    const bidAskGenerator = controller.addGenerator('BidAsk');
    
    • Not compatible with relative chart mode.
    • Requires a valid instrument with push data for real-time bid/ask updates.
    • Type: enum

    • Default: 'f'

    • Values: 'f' | 'm' | 'r' | 'mr'

    • Details

      Controls the presentation mode of the bid/ask lines:

      • 'f' - Full width: lines extend across the entire chart (strikethrough)
      • 'm' - Minimal: short lines next to the current quote
      • 'r' - Right extended: lines extend to the right
      • 'mr' - Mid-right: short lines on the right side
    • Example

      bidAskGenerator.set('pres', 'r');
      
    • Type: boolean

    • Default: true

    • Details

      When enabled, "bid" and "ask" text labels are displayed alongside the price lines.

    • Type

      interface BidAskGenerator {
      emit(type: 'exchangeClicked'): void;
      }
    • Details

      Emitted when the user clicks the "Exchange overview" button. Can be used to open an exchange information modal.

    • Type

      interface BidAskGenerator {
      setBid(bidValue?: number): void;
      }
    • Details

      Manually sets the bid price line value. If called without a value, the bid line is hidden.

    • Type

      interface BidAskGenerator {
      setAsk(askValue?: number): void;
      }
    • Details

      Manually sets the ask price line value. If called without a value, the ask line is hidden.

    The generator automatically subscribes to push data for the current instrument's exchange. As new bid/ask quotes arrive, the lines update in real time. The lines are drawn as horizontal lines at the respective price levels.