Expand description
Data types for bars, instruments, chart styles, trading and host analytics.
Start with Bar and BarData for price history, Instrument for symbol
metadata and Timeframe for bar intervals. The transformation modules build
price-based charts and TPO profiles without rendering; strategy records describe
host-computed runs and provide performance calculations.
Re-exports§
pub use bar::Bar;pub use bar::BarColors;pub use bar::BarData;pub use kagi::KagiConfig;pub use kagi::KagiLine;pub use kagi::KagiThickness;pub use kagi::to_kagi_lines;pub use line_break::LineBreakConfig;pub use line_break::LineBreakLine;pub use line_break::LineBreakSignal;pub use line_break::LineDirection;pub use line_break::detect_signal as detect_line_break_signal;pub use line_break::to_line_break_lines;pub use point_figure::ColumnDirection;pub use point_figure::PnfBoxesError;pub use point_figure::PnfColumn;pub use point_figure::PointFigureConfig;pub use point_figure::to_pnf_columns;pub use quote::ExtendedHoursQuote;pub use quote::ExtendedSession;pub use quote::Level1Quote;pub use quote::OrderBook;pub use quote::OrderBookLevel;pub use quote::Quote;pub use quote::Tick;pub use quote::TradeConditions;pub use range_bar::RangeBar;pub use range_bar::RangeBarConfig;pub use range_bar::RangeBarSource;pub use range_bar::to_range_bars_from_ohlc;pub use range_bar::to_range_bars_from_ticks;pub use renko::RenkoBrick;pub use renko::RenkoConfig;pub use renko::RenkoDirection;pub use renko::to_renko_bricks;pub use session::CompositeSessionProvider;pub use session::DailySessionProvider;pub use session::ExchangeSessionProvider;pub use session::MonthlySessionProvider;pub use session::SessionBreak;pub use session::SessionBreakType;pub use session::SessionProvider;pub use session::WeeklySessionProvider;pub use session::find_session_breaks;pub use tpo::ProfileShape;pub use tpo::SessionType;pub use tpo::TPOColorMode;pub use tpo::TPOConfig;pub use tpo::TPODisplayMode;pub use tpo::TPOLetter;pub use tpo::TPOProfile;pub use tpo::derive_tick_size;pub use tpo::to_tpo_profiles;
Modules§
- bar
- OHLCV bars and a series data container.
- kagi
- Kagi chart transformation.
- line_
break - Line Break chart transformation.
- point_
figure - Point & Figure (P&F) chart transformation.
- quote
- Market quotes and order-book data structures.
- range_
bar - Range-bar chart transformation.
- renko
- Renko chart transformation.
- session
- Trading session management and break detection.
- tpo
- TPO (Time Price Opportunity) / Market Profile chart model.
Structs§
- Account
- The account behind one
Brokervalue. - Alert
- An alert as the host stores and evaluates it. The library creates and edits alerts through
Alerts::saveand shows the ones the host pushes. It evaluates them only through the host’s service;AlertEngine(featurealert-engine) is one. - Alert
Calendar - The creation symbol’s exchange calendar, including an explicitly continuous session.
- AlertId
- The host’s identifier of an alert.
- Alert
Inputs - The source view and study definitions captured when an alert is created. The alert’s symbol and timeframe select its main series; auxiliary requests follow these saved studies.
- Alert
Rule - One additional condition of an alert; all rules must hold on the same bar.
- Alert
Study - Serializable calculation inputs of a study, without computed values or shared stream state.
- Area
Style - The Area chart’s line and vertical fill stops.
- Autoscale
Provider - The range a series contributes when its price scale fits the visible bars.
- Balance
Change - A change of the account’s cash balance, such as a closed trade’s profit or a commission.
- BarClock
- Bar boundaries for one timeframe, around the clock in UTC by default.
- Bars
Style - The Bars chart’s OHLC ticks.
- Baseline
Style - The Baseline chart’s independent colours and vertical fills on either side of its base.
- Candles
Style - The Candles chart’s bodies, wicks and colouring. Borders are drawn while the chart’s candle border width is above zero.
- Capabilities
- The order types the account accepts. The terminal hides the controls for the others. By default the account accepts none; set the fields it accepts:
- Change
Markers - Colours and lifetime of the marks that show where the close of a series rose or fell
between live updates; see
Chart::set_change_markers. - Chart
Type Params - The parameters of the chart types that need them. Sizes are in price units and are used as given; a size the chart cannot use is reported on the chart instead of being replaced.
- Chart
Type Styles - Styles of the candles, bars, line, step, marker, area, HLC area, baseline and Kagi chart types. Defaults use the design-token palette and remain independent of candle colours.
- Event
Visibility - Visibility of each time-axis event category.
- Execution
- One fill of an order.
- HlcArea
Style - The HLC area chart’s fill and close line. The fills take the chart’s bullish and bearish colours and the close line its bullish colour.
- Instrument
- What a feed or a search service reports about a symbol. Build it with
Instrument::newand thewith_setters; fields left out stay unknown. - Journal
Entry - One line of the account’s trading journal: an order placed, changed, cancelled or filled, a position closed, or anything else the broker logs.
- Kagi
Style - The Kagi chart’s stroke widths in logical points. Non-positive or non-finite widths hide the lines of that thickness.
- Line
Plot Style - A series line, with width in logical points.
- Logical
Range - A floating-point range of bar indices on the horizontal axis.
- Marker
- Marker for chart annotations
- Marker
Options - How the markers of one series are fitted and layered; see
Chart::set_marker_options. - Notification
Schedule - When an alert’s notifications may be delivered: on the selected weekdays, inside the time
windows, both read on the clock of
timezone, so a daylight-saving change moves the windows with the local clock. - Notification
Window - A window of the day, from
startup to but excludingend, in the schedule’s zone. A window whoseendis beforestartcrosses midnight and belongs to the weekday it starts on. - Order
- An order the broker holds. Pushed again on every change; the terminal replaces the order with the same id.
- OrderId
- Identifies an order. The broker chooses it.
- Order
Preview - What a broker estimates for an order it has not accepted, from
Broker::preview. Every estimate is optional. - Order
Request - An order as the user or the host asks for it.
- Override
Window - One window of a
SessionOverride. - Parse
Error - Why text did not parse as a colour, timeframe, time zone or price scale mode.
- Position
- The net position in one symbol.
- Post
Content - The content of a post or idea, as the host resolves a link to it.
- Post
Link - The post or idea a drawing links to, and its content once the host resolved it.
- Price
Line - A horizontal line at a price on a series’ scale, with an optional title and a price axis label.
- Profile
Resolution - A bar interval a feed suggests for volume profile studies and drawings, for profiles up to a length.
Report them in
Instrument::profile_resolutions. - Replay
Session - A resumable position in host-supplied history. Store it with the symbol’s source interval and fetch that same source before restoring it. Restoring always pauses playback.
- Series
Alerts - How the alert levels of one bar series are drawn.
- Series
Display Format - Saved numeric display settings for a bar series. Values and scale modes stay unchanged.
- Series
Style - A bar series’ last value label, price line, base line, autoscale, click tolerance and alert levels.
- Session
- Trading hours: the windows in which an instrument trades.
- Session
Override - The hours of one trading date, in place of its weekly windows and holiday.
- Session
Window - One trading window, repeated on each of
days. - Signal
- One finding of the host’s analytics: a marker, a level or a zone, for the chart to draw in the theme’s colours for its direction and category.
- Signal
Id - Identifies a signal. The host chooses it.
- Strategy
Comparison - Source-bar comparison of a run, from
StrategyReport::comparison. - Strategy
Excursion - Largest unrealised loss and gain relative to a trade’s entry, before fees.
- Strategy
Exit - How and when a trade was closed.
- Strategy
Performance - Metrics of a
StrategyReport, fromStrategyReport::performance. - Strategy
Report - The result of one strategy run, from any source: a backtest the host runs against the headless
engine, a forward test, or the host’s own analytics. Build it with
StrategyReport::newand set the remaining fields directly;StrategyReport::performancecomputes the metrics. - Strategy
Trade - One round trip. A host that scales out reports each partial exit as its own trade with its share of the entry.
- Take
Profit Level - A take profit that closes its own part of an order: one of
OrderRequest::take_profit_levels. - Time
Scale - Time-scale coordinate engine – pure logic, no UI dependencies.
- Time
Scale Event - An event supplied by the host, which owns its data and any external service.
- Timezone
Id - A validated time zone, independent of the optional time zone database.
- Timezone
Offset - An instant’s UTC offset, retaining its zone for chrono calendar operations.
- Trading
Rules - How a symbol trades at the broker. The order ticket sizes orders by these rules.
- Watchlist
- A named list of symbols and sections, in the order the user arranged them.
Enums§
- Alert
Channel Comparison - Relationship of a value to two inclusive, independently resolved boundaries.
- Alert
Comparison - Comparison of two outputs. Crossings require a strict previous side and include equality now.
- Alert
Condition - When an alert fires, judged on its source for each subject symbol. Each variant states its rule so that a host and a server evaluate it alike. Levels are finite and in the symbol’s price units.
- Alert
Frequency - How often an alert fires.
- Alert
Source - A host-resolved value on a bar. Identifiers remain meaningful to the host across sessions.
- Alert
Status - Where an alert stands. The host sets it; the library only shows it.
- Baseline
Level - Where the Baseline chart draws its base line.
- BoxSize
Method - How a price-based chart obtains its size in price units. Resolve from the loaded history when selecting the method, then keep the result while bars stream in. Reapply the parameters to explicitly recalculate from newer history.
- Chart
Type - Chart visualization types
- Chart
Type Category - Categories for grouping chart types in the UI
- Color
Type - A color specification that can be a solid RGBA value or a gradient.
- Data
Status - How current a feed’s data is.
- Date
Range - Preset date range for quick navigation.
- Direction
- Whether a signal is bullish, bearish or neither, which picks its colour.
- Event
Kind - Category of a host-supplied time-axis event.
- Feed
Service - An optional service of a
Datafeed, listed inFeedCapabilities::servicesandInstrument::services. - Input
Value - A study input’s current value.
- Last
Price Animation - When the Line, Step line, Line with markers, Area and Baseline charts pulse a circle at the last price.
- Line
Style - Line style of drawings, series, grid and price lines.
- Line
Type - How a series line connects its points.
- Marker
Pos - Marker position relative to the data point
- Marker
Shape - Marker shape
- MarkerZ
Order - Where a series’ markers are painted among the other content of the price pane.
- Order
Side - Buy or sell, shared by orders, executions, aggressor trades and strategy positions.
- Order
Status - Where an order stands.
Filled,CancelledandRejectedend the order. - Order
Type - How an order executes. Prices are in the symbol’s price units.
- Position
Bracket - The role of an exit order attached to the net position in its symbol.
- Price
Based Source - Input used to build Renko, Kagi and Line Break charts.
- Price
Line Source - The bar whose value a series’ price line and last value label show.
- Price
Source - Price source for series calculations
- Series
Format - The units a series writes, independently of its price scale’s transform.
- Series
Scale - Series with the same assignment share a range and scale options. Relative modes retain a separate first-visible-close reference for each series.
- Signal
Shape - Where a signal sits on the chart, anchored by time so it keeps its place through zoom, interval changes and history loads. Prices are finite and in the symbol’s price units.
- Study
Source - A price series or an output of another study on the chart.
- Symbol
Type - Symbol type categories for instrument classification.
- Time
InForce - How long an order stays working.
- Timeframe
- Timeframe for bar aggregation.
- Timeframe
Unit - Unit of an interval, as its label names it:
90minis 90Minutes and1DoneDay. Units are ordered as declared, trade-based units first. - Watchlist
Flag - A colour flag marking a watchlist symbol.
- Watchlist
Item - One row of a watchlist.