Skip to main content

Module model

Module model 

Source
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 Broker value.
Alert
An alert as the host stores and evaluates it. The library creates and edits alerts through Alerts::save and shows the ones the host pushes. It evaluates them only through the host’s service; AlertEngine (feature alert-engine) is one.
AlertCalendar
The creation symbol’s exchange calendar, including an explicitly continuous session.
AlertId
The host’s identifier of an alert.
AlertInputs
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.
AlertRule
One additional condition of an alert; all rules must hold on the same bar.
AlertStudy
Serializable calculation inputs of a study, without computed values or shared stream state.
AreaStyle
The Area chart’s line and vertical fill stops.
AutoscaleProvider
The range a series contributes when its price scale fits the visible bars.
BalanceChange
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.
BarsStyle
The Bars chart’s OHLC ticks.
BaselineStyle
The Baseline chart’s independent colours and vertical fills on either side of its base.
CandlesStyle
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:
ChangeMarkers
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.
ChartTypeParams
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.
ChartTypeStyles
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.
EventVisibility
Visibility of each time-axis event category.
Execution
One fill of an order.
HlcAreaStyle
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::new and the with_ setters; fields left out stay unknown.
JournalEntry
One line of the account’s trading journal: an order placed, changed, cancelled or filled, a position closed, or anything else the broker logs.
KagiStyle
The Kagi chart’s stroke widths in logical points. Non-positive or non-finite widths hide the lines of that thickness.
LinePlotStyle
A series line, with width in logical points.
LogicalRange
A floating-point range of bar indices on the horizontal axis.
Marker
Marker for chart annotations
MarkerOptions
How the markers of one series are fitted and layered; see Chart::set_marker_options.
NotificationSchedule
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.
NotificationWindow
A window of the day, from start up to but excluding end, in the schedule’s zone. A window whose end is before start crosses 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.
OrderPreview
What a broker estimates for an order it has not accepted, from Broker::preview. Every estimate is optional.
OrderRequest
An order as the user or the host asks for it.
OverrideWindow
One window of a SessionOverride.
ParseError
Why text did not parse as a colour, timeframe, time zone or price scale mode.
Position
The net position in one symbol.
PostContent
The content of a post or idea, as the host resolves a link to it.
PostLink
The post or idea a drawing links to, and its content once the host resolved it.
PriceLine
A horizontal line at a price on a series’ scale, with an optional title and a price axis label.
ProfileResolution
A bar interval a feed suggests for volume profile studies and drawings, for profiles up to a length. Report them in Instrument::profile_resolutions.
ReplaySession
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.
SeriesAlerts
How the alert levels of one bar series are drawn.
SeriesDisplayFormat
Saved numeric display settings for a bar series. Values and scale modes stay unchanged.
SeriesStyle
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.
SessionOverride
The hours of one trading date, in place of its weekly windows and holiday.
SessionWindow
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.
SignalId
Identifies a signal. The host chooses it.
StrategyComparison
Source-bar comparison of a run, from StrategyReport::comparison.
StrategyExcursion
Largest unrealised loss and gain relative to a trade’s entry, before fees.
StrategyExit
How and when a trade was closed.
StrategyPerformance
Metrics of a StrategyReport, from StrategyReport::performance.
StrategyReport
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::new and set the remaining fields directly; StrategyReport::performance computes the metrics.
StrategyTrade
One round trip. A host that scales out reports each partial exit as its own trade with its share of the entry.
TakeProfitLevel
A take profit that closes its own part of an order: one of OrderRequest::take_profit_levels.
TimeScale
Time-scale coordinate engine – pure logic, no UI dependencies.
TimeScaleEvent
An event supplied by the host, which owns its data and any external service.
TimezoneId
A validated time zone, independent of the optional time zone database.
TimezoneOffset
An instant’s UTC offset, retaining its zone for chrono calendar operations.
TradingRules
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§

AlertChannelComparison
Relationship of a value to two inclusive, independently resolved boundaries.
AlertComparison
Comparison of two outputs. Crossings require a strict previous side and include equality now.
AlertCondition
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.
AlertFrequency
How often an alert fires.
AlertSource
A host-resolved value on a bar. Identifiers remain meaningful to the host across sessions.
AlertStatus
Where an alert stands. The host sets it; the library only shows it.
BaselineLevel
Where the Baseline chart draws its base line.
BoxSizeMethod
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.
ChartType
Chart visualization types
ChartTypeCategory
Categories for grouping chart types in the UI
ColorType
A color specification that can be a solid RGBA value or a gradient.
DataStatus
How current a feed’s data is.
DateRange
Preset date range for quick navigation.
Direction
Whether a signal is bullish, bearish or neither, which picks its colour.
EventKind
Category of a host-supplied time-axis event.
FeedService
An optional service of a Datafeed, listed in FeedCapabilities::services and Instrument::services.
InputValue
A study input’s current value.
LastPriceAnimation
When the Line, Step line, Line with markers, Area and Baseline charts pulse a circle at the last price.
LineStyle
Line style of drawings, series, grid and price lines.
LineType
How a series line connects its points.
MarkerPos
Marker position relative to the data point
MarkerShape
Marker shape
MarkerZOrder
Where a series’ markers are painted among the other content of the price pane.
OrderSide
Buy or sell, shared by orders, executions, aggressor trades and strategy positions.
OrderStatus
Where an order stands. Filled, Cancelled and Rejected end the order.
OrderType
How an order executes. Prices are in the symbol’s price units.
PositionBracket
The role of an exit order attached to the net position in its symbol.
PriceBasedSource
Input used to build Renko, Kagi and Line Break charts.
PriceLineSource
The bar whose value a series’ price line and last value label show.
PriceSource
Price source for series calculations
SeriesFormat
The units a series writes, independently of its price scale’s transform.
SeriesScale
Series with the same assignment share a range and scale options. Relative modes retain a separate first-visible-close reference for each series.
SignalShape
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.
StudySource
A price series or an output of another study on the chart.
SymbolType
Symbol type categories for instrument classification.
TimeInForce
How long an order stays working.
Timeframe
Timeframe for bar aggregation.
TimeframeUnit
Unit of an interval, as its label names it: 90min is 90 Minutes and 1D one Day. Units are ordered as declared, trade-based units first.
WatchlistFlag
A colour flag marking a watchlist symbol.
WatchlistItem
One row of a watchlist.