BarPrimitive class

Represents a single OHLCV data point in a time series.

This is the fundamental data primitive consumed by the chart engine. Each BarPrimitive corresponds to one candle/bar in a time-based chart.

Annotations
  • @freezed

Constructors

BarPrimitive({required int timestamp, required double open, required double high, required double low, required double close, @Default.new(0.0) double volume})
const
factory
BarPrimitive.fromArray(List arr)
Creates a BarPrimitive from a compact array format [timestamp, O, H, L, C, V].
factory
BarPrimitive.fromJson(Map<String, dynamic> json)
factory

Properties

bodySize double
Body size (absolute difference between Open and Close).
no setter
close double
Closing price of the period.
no setterinherited
copyWith → $BarPrimitiveCopyWith<BarPrimitive>
Create a copy of BarPrimitive with the given fields replaced by the non-null parameter values.
no setterinherited
dateTime DateTime
The DateTime corresponding to this bar's timestamp.
no setter
hashCode int
The hash code for this object.
no setterinherited
high double
Highest price during the period.
no setterinherited
isBearish bool
Whether the bar closed lower than it opened (bearish).
no setter
isBullish bool
Whether the bar closed higher than it opened (bullish).
no setter
isDoji bool
Whether this bar is a Doji (Open == Close).
no setter
low double
Lowest price during the period.
no setterinherited
lowerWick double
Lower wick size.
no setter
open double
Opening price of the period.
no setterinherited
range double
Total price range of the bar (High - Low).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp int
Epoch milliseconds — start of the period.
no setterinherited
upperWick double
Upper wick size.
no setter
volume double
Trade volume during the period.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toArray() List
Compact array representation [T, O, H, L, C, V].
toJson() Map<String, dynamic>
Serializes this BarPrimitive to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited