Skip to content

Commit

Permalink
fix: rustc 1.80 support
Browse files Browse the repository at this point in the history
  • Loading branch information
amv-dev committed Jul 28, 2024
1 parent e4a3bca commit 44cc371
Show file tree
Hide file tree
Showing 22 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/core/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub trait Method {
where
Self: Sized,
{
(std::mem::size_of::<Self>(), std::mem::align_of::<Self>())
(size_of::<Self>(), align_of::<Self>())
}

/// Iterates the `Method` over the given `inputs` slice and returns `Vec` of output values.
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/awesome_oscillator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::methods::{Cross, ReversalSignal};
/// # 2 signals
///
/// * "Twin Peaks". When `value` is below zero line and we got `conseq_peaks` lower peaks, then returns full positive signal
/// When `value` is above zero line and we got `conseq_peaks` higher peaks, then returns full negative signal.
/// Otherwise gives no signal.
/// When `value` is above zero line and we got `conseq_peaks` higher peaks, then returns full negative signal.
/// Otherwise gives no signal.
/// * Gives signal when `values` crosses zero line
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
Expand Down
2 changes: 1 addition & 1 deletion src/indicators/chande_kroll_stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::methods::{CrossAbove, Highest, Lowest};
/// # 3 values
///
/// * `stop long`
/// Range of values is the same as the range of the `source` values.
/// Range of values is the same as the range of the `source` values.
///
/// * `source` value
///
Expand Down
6 changes: 3 additions & 3 deletions src/indicators/donchian_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ use crate::methods::{Highest, Lowest};
/// # 1 signal
///
/// * When [`high`] value hits `upper bound`, returns full buy signal.
/// When [`low`] value hits `lower bound`, returns full sell signal.
/// Otherwise returns no signal.
/// If both values hit both bounds, returns no signal.
/// When [`low`] value hits `lower bound`, returns full sell signal.
/// Otherwise returns no signal.
/// If both values hit both bounds, returns no signal.
///
/// [`high`]: crate::core::OHLCV::high
/// [`low`]: crate::core::OHLCV::low
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/ease_of_movement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use crate::methods::Cross;
/// # 1 signal
///
/// * Signal 1 appears when `main value` crosses zero line.
/// When `main value` crosses zero line upwards, returns full buy signal.
/// When `main value` crosses zero line downwards, returns full sell signal.
/// When `main value` crosses zero line upwards, returns full buy signal.
/// When `main value` crosses zero line downwards, returns full sell signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EaseOfMovement<M: MovingAverageConstructor = MA> {
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/elders_force_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use crate::methods::Cross;
/// # 1 signal
///
/// * Signal 1 appears when `main value` crosses zero line.
/// When `main value` crosses zero line upwards, returns full buy signal.
/// When `main value` crosses zero line downwards, returns full sell signal.
/// When `main value` crosses zero line upwards, returns full buy signal.
/// When `main value` crosses zero line downwards, returns full sell signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EldersForceIndex<M: MovingAverageConstructor = MA> {
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/envelopes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use crate::helpers::MA;
/// # 1 signal
///
/// * Signal 1 appears when `Source2` value crosses bounds.
/// When `Source2` value crosses `upper bound` upwards, returns full sell signal.
/// When `Source2` value crosses `lower bound` downwards, returns full buy signal.
/// When `Source2` value crosses `upper bound` upwards, returns full sell signal.
/// When `Source2` value crosses `lower bound` downwards, returns full buy signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Envelopes<M: MovingAverageConstructor = MA> {
Expand Down
2 changes: 1 addition & 1 deletion src/indicators/fisher_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::methods::{Cross, Highest, Lowest};
/// # 2 signals
///
/// * Signal 1 appears when `main value` crosses zero line.
/// When `main value` changes direction, returns signal corresponds to relative position of `main value` in `zone`
/// When `main value` changes direction, returns signal corresponds to relative position of `main value` in `zone`
/// * Signal 2 appears when `main value` crosses `signal line` and after signal 1 appears
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/hull_moving_average.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use crate::methods::{ReversalSignal, HMA};
/// # 1 signal
///
/// * When `HMA value` reverses upwards, gives full positive signal.
/// When `HMA value` reverses downwards, gives full negative signal.
/// Otherwise returns no signal.
/// When `HMA value` reverses downwards, gives full negative signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HullMovingAverage {
Expand Down
12 changes: 6 additions & 6 deletions src/indicators/ichimoku_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ use crate::methods::{Cross, Highest, Lowest};
/// # 2 signals
///
/// * When `Tenkan Sen` crosses `Kijun Sen` upwards and `source` value is greater than both `Senkou Span A and B` and when `Senkou Span A` is greater than `Senkou Span B`,
/// returns full buy signal.
/// When `Tenkan Sen` crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`,
/// returns full sell signal.
/// returns full buy signal.
/// When `Tenkan Sen` crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`,
/// returns full sell signal.
///
/// * When `source` value crosses `Kijun Sen` upwards and `source` value is greater than both `Senkou Span A and B` and when `Senkou Span A` is greater than `Senkou Span B`,
/// returns full buy signal.
/// When `source` value crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`,
/// returns full sell signal.
/// returns full buy signal.
/// When `source` value crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`,
/// returns full sell signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct IchimokuCloud {
Expand Down
6 changes: 3 additions & 3 deletions src/indicators/kaufman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use crate::methods::{Change, Cross, LinearVolatility, StDev};
/// # 1 signal
///
/// * if `filter_period` is less or equal than `0`, then returns signal when `KAMA` crosses `source` value.
/// When `source` crosses `KAMA` upwards, returns full buy signal.
/// When `source` crosses `KAMA` downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `source` crosses `KAMA` upwards, returns full buy signal.
/// When `source` crosses `KAMA` downwards, returns full sell signal.
/// Otherwise returns no signal.
///
/// * if `filter_period` is greater than `1`, it uses same cross between `source` and `KAMA`, but with additional filtering using standard deviation.
#[derive(Debug, Clone, Copy)]
Expand Down
8 changes: 4 additions & 4 deletions src/indicators/klinger_volume_oscillator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ use crate::methods::Cross;
/// # 2 signals
///
/// * When `main` value crosses `0.0` upwards, then returns full buy signal.
/// When `main` value crosses `0.0` downwards, then returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value crosses `0.0` downwards, then returns full sell signal.
/// Otherwise returns no signal.
///
/// * When `main` value crosses `signal line` value upwards, then returns full buy signal.
/// When `main` value crosses `signal line` downwards, then returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value crosses `signal line` downwards, then returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct KlingerVolumeOscillator<M: MovingAverageConstructor = MA> {
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/know_sure_thing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use crate::methods::{Cross, RateOfChange};
/// # 1 signal
///
/// * When `KST` crosses `Signal line` upwards, returns full buy signal.
/// When `KST` crosses `Signal line` downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `KST` crosses `Signal line` downwards, returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct KnowSureThing<M: MovingAverageConstructor = MA> {
Expand Down
8 changes: 4 additions & 4 deletions src/indicators/macd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ use crate::methods::Cross;
/// # 2 signal
///
/// * When `MACD` crosses `Signal line` upwards, returns full buy signal.
/// When `MACD` crosses `Signal line` downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `MACD` crosses `Signal line` downwards, returns full sell signal.
/// Otherwise returns no signal.
///
/// * When `MACD` crosses zero line upwards, returns full buy signal.
/// When `MACD` crosses zero line downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `MACD` crosses zero line downwards, returns full sell signal.
/// Otherwise returns no signal.
///
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/momentum_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use crate::methods::Momentum;
/// # 1 signal
///
/// * When both momentums are positive, returns full buy signal.
/// When both momentums are negative, returns full sell signal.
/// Otherwise returns no signal.
/// When both momentums are negative, returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MomentumIndex {
Expand Down
8 changes: 4 additions & 4 deletions src/indicators/money_flow_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ use crate::methods::Cross;
/// # 2 signals
///
/// * When `MFI` value crosses `lower bound` downwards, returns full buy signal.
/// When `MFI` value crosses `upper bound` upwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `MFI` value crosses `upper bound` upwards, returns full sell signal.
/// Otherwise returns no signal.
///
/// * When `MFI` value crosses `lower bound` upwards, returns full buy signal.
/// When `MFI` value crosses `upper bound` downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `MFI` value crosses `upper bound` downwards, returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MoneyFlowIndex {
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/parabolic_sar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use super::HLC;
///
/// # 1 signal
/// * When `trend` changes it's value to positive, then returns full buy signal.
/// When `trend` changes it's value to negative, then returns full sell signal.
/// Otherwise returns no signal.
/// When `trend` changes it's value to negative, then returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ParabolicSAR {
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/trend_strength_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use crate::methods::{CrossAbove, CrossUnder, ReversalSignal, WMA};
/// # 2 signals
///
/// * When `main value` crosses upper `zone` downwards, gives full negative #1 signal.
/// When `main value` crosses lower `zone` upwards, gives full positive #1 signal.
/// When `main value` crosses lower `zone` upwards, gives full positive #1 signal.
///
/// * When `main value` is below lower `zone` and changes direction upwards, gives full positive #2 signal
/// When `main value` is above upper `zone` and changes direction downwards, gives full negative #2 signal
/// When `main value` is above upper `zone` and changes direction downwards, gives full negative #2 signal
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TrendStrengthIndex {
Expand Down
12 changes: 6 additions & 6 deletions src/indicators/trix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ use serde::{Deserialize, Serialize};
/// # 3 signals
///
/// * When `main` value changes direction upwards, returns full buy signal.
/// When `main` value changes direction downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value changes direction downwards, returns full sell signal.
/// Otherwise returns no signal.
///
/// * When `main` value crosses `signal line` value upwards, returns full buy signal.
/// When `main` value crosses `signal line` value downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value crosses `signal line` value downwards, returns full sell signal.
/// Otherwise returns no signal.
///
/// * When `main` value crosses zero line upwards, returns full buy signal.
/// When `main` value crosses zero line downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value crosses zero line downwards, returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Trix<M: MovingAverageConstructor = MA> {
Expand Down
12 changes: 6 additions & 6 deletions src/indicators/true_strength_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ use crate::methods::{Cross, CrossAbove, CrossUnder, EMA, TSI};
/// Otherwise returns no signal.
///
/// * Signal #2.
/// When `main` value crosses zero line upwards, returns full buy signal.
/// When `main` value crosses zero line downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value crosses zero line upwards, returns full buy signal.
/// When `main` value crosses zero line downwards, returns full sell signal.
/// Otherwise returns no signal.
///
/// * Signal #3.
/// When `main` value crosses `signal line` upwards, returns full buy signal.
/// When `main` value crosses `signal line` downwards, returns full sell signal.
/// Otherwise returns no signal.
/// When `main` value crosses `signal line` upwards, returns full buy signal.
/// When `main` value crosses `signal line` downwards, returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TrueStrengthIndex {
Expand Down
4 changes: 2 additions & 2 deletions src/indicators/woodies_cci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const SCALE: ValueType = 1.0 / 1.5;
/// # 1 signals
///
/// * When `Trend CCI` stays above zero line for `s1_lag` bars, returns full buy signal.
/// When `Trend CCI` stays below zero line for `s1_lag` bars, returns full sell signal.
/// Otherwise returns no signal.
/// When `Trend CCI` stays below zero line for `s1_lag` bars, returns full sell signal.
/// Otherwise returns no signal.
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct WoodiesCCI {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ limitations under the License.
//! - [Simple moving average (SMA)](crate::methods::SMA);
//! - [Weighted moving average (WMA)](crate::methods::WMA);
//! - Exponential moving average family: [EMA](crate::methods::EMA), [DMA](crate::methods::DMA), [TMA](crate::methods::TMA),
//! [DEMA](crate::methods::DEMA), [TEMA](crate::methods::TEMA);
//! [DEMA](crate::methods::DEMA), [TEMA](crate::methods::TEMA);
//! - [Simple moving median (SMM)](crate::methods::SMM);
//! - [Linear regression moving average (LSMA)](crate::methods::LinReg);
//! - [Volume weighted moving average (VWMA)](crate::methods::VWMA);
Expand Down

0 comments on commit 44cc371

Please sign in to comment.