pub struct TPOProfile {Show 17 fields
pub session_date: DateTime<Utc>,
pub tick_size: f64,
pub instrument_tick: f64,
pub row_ticks: u64,
pub letters: Vec<TPOLetter>,
pub price_tpo_count: HashMap<i64, usize>,
pub poc_price: f64,
pub value_area_high: f64,
pub value_area_low: f64,
pub initial_balance_high: f64,
pub initial_balance_low: f64,
pub profile_high: f64,
pub profile_low: f64,
pub opening_price: f64,
pub single_prints: Vec<f64>,
pub has_poor_high: bool,
pub has_poor_low: bool,
}Expand description
A complete TPO profile for one trading session.
Contains all TPO letters, statistical levels (POC, value area, initial balance), and structural flags (poor high/low, single prints).
Fields§
§session_date: DateTime<Utc>Session timestamp
tick_size: f64Row height the profile’s prices are keyed on: row_ticks ticks of instrument_tick. It is
the configured tick size, rounded up to whole instrument ticks when one is configured and
widened to a whole number of rows when the bars span more than 1,000 of them, or the span
divided into 1,000 rows without a usable tick size.
instrument_tick: f64Tick the rows are counted in: TPOConfig::instrument_tick, or tick_size itself, making
every row one tick, without one or when prices are more than 2^50 ticks from zero.
row_ticks: u64Ticks of instrument_tick in each row. A row holds the ticks from a multiple of
row_ticks up to the next and spans from half a tick below its first tick to half a tick
below the next row’s, as footprint rows do.
letters: Vec<TPOLetter>All TPO letters in this profile
price_tpo_count: HashMap<i64, usize>TPO count at each price level
poc_price: f64Point of control: the price (lowest tick) of the row with the most TPOs. A tie takes the lower price.
value_area_high: f64Price of the highest row of the configured TPO-count value area. The area grows from the point of control toward whichever of the next two rows above or the next two rows below holds more TPOs; equal counts add one row on each side.
value_area_low: f64Price of its lowest row.
initial_balance_high: f64Highest price of the bars that open within the configured initial balance period, or
f64::MIN when none does, so the profile has no initial balance.
initial_balance_low: f64Lowest price of those bars, or f64::MAX when none does.
profile_high: f64Profile high
profile_low: f64Profile low
opening_price: f64Opening price
single_prints: Vec<f64>Single prints: the prices of the rows with exactly one TPO, in ascending order
has_poor_high: boolPoor highs (multiple TPOs at high)
has_poor_low: boolPoor lows (multiple TPOs at low)
Implementations§
Source§impl TPOProfile
impl TPOProfile
Sourcepub fn new(session_date: DateTime<Utc>, tick_size: f64) -> Self
pub fn new(session_date: DateTime<Utc>, tick_size: f64) -> Self
Create a new empty TPO profile on rows of one tick of tick_size
Sourcepub fn row_price(&self, price: f64) -> f64
pub fn row_price(&self, price: f64) -> f64
Price of the row holding price: the row’s lowest tick.
Sourcepub fn row_span(&self, price: f64) -> (f64, f64)
pub fn row_span(&self, price: f64) -> (f64, f64)
Lowest and highest price of the row holding price, from half a tick below its first tick
to half a tick below the next row’s first tick.
Sourcepub fn tpo_count_at(&self, price: f64) -> usize
pub fn tpo_count_at(&self, price: f64) -> usize
Get the TPO count at a specific price level
Sourcepub fn price_levels(&self) -> Vec<f64>
pub fn price_levels(&self) -> Vec<f64>
Get all unique price levels with TPOs
Sourcepub fn is_in_value_area(&self, price: f64) -> bool
pub fn is_in_value_area(&self, price: f64) -> bool
Check if a price is in the value area
Sourcepub fn is_in_initial_balance(&self, price: f64) -> bool
pub fn is_in_initial_balance(&self, price: f64) -> bool
Check if a price is in the initial balance
Sourcepub fn letters_at(&self, price: f64) -> Vec<&TPOLetter>
pub fn letters_at(&self, price: f64) -> Vec<&TPOLetter>
Get the letters at a specific price level
Source§impl TPOProfile
impl TPOProfile
Sourcepub fn classify_shape(&self) -> ProfileShape
pub fn classify_shape(&self) -> ProfileShape
Classify the profile shape
Trait Implementations§
Source§impl Clone for TPOProfile
impl Clone for TPOProfile
Source§fn clone(&self) -> TPOProfile
fn clone(&self) -> TPOProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TPOProfile
impl RefUnwindSafe for TPOProfile
impl Send for TPOProfile
impl Sync for TPOProfile
impl Unpin for TPOProfile
impl UnsafeUnpin for TPOProfile
impl UnwindSafe for TPOProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more