pub struct VolumeProfileConfig {
pub display: ProfileDisplay,
pub up_color: [u8; 4],
pub down_color: [u8; 4],
pub value_area_colors: Option<[[u8; 4]; 2]>,
pub show_value_area_lines: bool,
/* private fields */
}Expand description
Row layout and display settings shared by volume profile studies and drawings.
Fields§
§display: ProfileDisplayVolume displayed in each row. Totals still determine POC and value area.
up_color: [u8; 4]Colour of rising bars, including an unchanged close, in split and delta modes.
down_color: [u8; 4]Colour of falling bars in split and delta modes.
value_area_colors: Option<[[u8; 4]; 2]>Optional colours inside the value area; absent uses the ordinary side colours.
show_value_area_lines: boolDraw the high and low boundaries of the value area.
Implementations§
Source§impl VolumeProfileConfig
impl VolumeProfileConfig
Sourcepub const ROWS: RangeInclusive<usize>
pub const ROWS: RangeInclusive<usize>
Price rows a profile may have.
Sourcepub fn new(rows: usize, value_area: f64) -> Option<Self>
pub fn new(rows: usize, value_area: f64) -> Option<Self>
A profile of rows equal price rows whose value area holds the
value_area share of its volume (above 0, at most 1); None when
either is out of bounds.
Sourcepub fn with_row_size(self, height: Option<f64>) -> Option<Self>
pub fn with_row_size(self, height: Option<f64>) -> Option<Self>
Fix each row to a price height, aligned to multiples of that height.
None restores equal rows over the span. Rejects nonpositive or nonfinite heights.
Profiles spanning more than 10,000 fixed rows are not drawn.
Sourcepub fn row_size(&self) -> Option<f64>
pub fn row_size(&self) -> Option<f64>
Fixed price height per row, or equal rows over the span when absent.
Sourcepub fn value_area(&self) -> f64
pub fn value_area(&self) -> f64
Share of the volume inside the value area.
Sourcepub fn drawing_default() -> Self
pub fn drawing_default() -> Self
Settings a new volume profile drawing starts with: up and down volume side by side in
cyan and pink, drawn at half opacity outside the value area. Studies keep
Self::default.
Trait Implementations§
Source§impl Clone for VolumeProfileConfig
impl Clone for VolumeProfileConfig
Source§fn clone(&self) -> VolumeProfileConfig
fn clone(&self) -> VolumeProfileConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VolumeProfileConfig
Source§impl Debug for VolumeProfileConfig
impl Debug for VolumeProfileConfig
Source§impl Default for VolumeProfileConfig
impl Default for VolumeProfileConfig
Source§impl<'de> Deserialize<'de> for VolumeProfileConfig
impl<'de> Deserialize<'de> for VolumeProfileConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for VolumeProfileConfig
impl PartialEq for VolumeProfileConfig
Source§impl Serialize for VolumeProfileConfig
impl Serialize for VolumeProfileConfig
impl StructuralPartialEq for VolumeProfileConfig
Auto Trait Implementations§
impl Freeze for VolumeProfileConfig
impl RefUnwindSafe for VolumeProfileConfig
impl Send for VolumeProfileConfig
impl Sync for VolumeProfileConfig
impl Unpin for VolumeProfileConfig
impl UnsafeUnpin for VolumeProfileConfig
impl UnwindSafe for VolumeProfileConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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