pub struct GhostFeedConfig {
pub average_range_ticks: f64,
pub noise_ticks: f64,
}Expand description
How a Ghost Feed builds its projected candles from the clicked path.
Older saved spacing and wick settings are ignored and use these defaults.
Fields§
§average_range_ticks: f64Target average high-low range in ticks, before widening to contain the body and path. Must be positive and finite.
noise_ticks: f64Maximum close displacement from the path, and range variation, in ticks. Zero follows the path exactly. Must be nonnegative and finite.
Implementations§
Source§impl GhostFeedConfig
impl GhostFeedConfig
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Whether the range is positive and finite and the noise nonnegative and finite.
Sourcepub fn candles(
&self,
path: &[ChartPoint],
tick_size: f64,
drawing_id: &str,
) -> Vec<GhostCandle>
pub fn candles( &self, path: &[ChartPoint], tick_size: f64, drawing_id: &str, ) -> Vec<GhostCandle>
One candle per whole bar from the first to the last anchor in bar order, up to
MAX_GHOST_CANDLES. Each open is the preceding close; the first opens on the path.
Closes follow the linear path plus uniform noise, seeded by the persistent drawing id.
Range noise is also uniform; negative ranges become zero and bodies always fit.
Invalid inputs or overflowing prices produce no candles.
Trait Implementations§
Source§impl Clone for GhostFeedConfig
impl Clone for GhostFeedConfig
Source§fn clone(&self) -> GhostFeedConfig
fn clone(&self) -> GhostFeedConfig
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 GhostFeedConfig
Source§impl Debug for GhostFeedConfig
impl Debug for GhostFeedConfig
Source§impl Default for GhostFeedConfig
impl Default for GhostFeedConfig
Source§impl<'de> Deserialize<'de> for GhostFeedConfigwhere
GhostFeedConfig: Default,
impl<'de> Deserialize<'de> for GhostFeedConfigwhere
GhostFeedConfig: Default,
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 GhostFeedConfig
impl PartialEq for GhostFeedConfig
Source§impl Serialize for GhostFeedConfig
impl Serialize for GhostFeedConfig
impl StructuralPartialEq for GhostFeedConfig
Auto Trait Implementations§
impl Freeze for GhostFeedConfig
impl RefUnwindSafe for GhostFeedConfig
impl Send for GhostFeedConfig
impl Sync for GhostFeedConfig
impl Unpin for GhostFeedConfig
impl UnsafeUnpin for GhostFeedConfig
impl UnwindSafe for GhostFeedConfig
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