1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#![allow(missing_docs)]
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use crate::core::{ValueType, OHLCV};

pub mod example;

#[derive(Clone, Copy, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
struct HLC {
	high: ValueType,
	low: ValueType,
	close: ValueType,
}

impl HLC {
	fn from<T: OHLCV>(src: &T) -> Self {
		Self {
			high: src.high(),
			low: src.low(),
			close: src.close(),
		}
	}
}

impl OHLCV for HLC {
	fn open(&self) -> ValueType {
		ValueType::NAN
	}

	#[inline]
	fn high(&self) -> ValueType {
		self.high
	}

	#[inline]
	fn low(&self) -> ValueType {
		self.low
	}

	#[inline]
	fn close(&self) -> ValueType {
		self.close
	}

	fn volume(&self) -> ValueType {
		ValueType::NAN
	}
}

mod aroon;
pub use aroon::Aroon;

mod average_directional_index;
pub use average_directional_index::AverageDirectionalIndex;

mod awesome_oscillator;
pub use awesome_oscillator::AwesomeOscillator;

mod bollinger_bands;
pub use bollinger_bands::BollingerBands;

mod chaikin_money_flow;
pub use chaikin_money_flow::ChaikinMoneyFlow;

mod chaikin_oscillator;
pub use chaikin_oscillator::ChaikinOscillator;

mod chande_kroll_stop;
pub use chande_kroll_stop::ChandeKrollStop;

mod chande_momentum_oscillator;
pub use chande_momentum_oscillator::ChandeMomentumOscillator;

mod commodity_channel_index;
pub use commodity_channel_index::CommodityChannelIndex;

mod coppock_curve;
pub use coppock_curve::CoppockCurve;

mod detrended_price_oscillator;
pub use detrended_price_oscillator::DetrendedPriceOscillator;

mod donchian_channel;
pub use donchian_channel::DonchianChannel;

mod ease_of_movement;
pub use ease_of_movement::EaseOfMovement;

mod elders_force_index;
pub use elders_force_index::EldersForceIndex;

mod envelopes;
pub use envelopes::Envelopes;

mod fisher_transform;
pub use fisher_transform::FisherTransform;

mod hull_moving_average;
pub use hull_moving_average::HullMovingAverage;

mod ichimoku_cloud;
pub use ichimoku_cloud::IchimokuCloud;

mod kaufman;
pub use kaufman::{Kaufman, KAMA};

mod keltner_channel;
pub use keltner_channel::KeltnerChannel;

mod klinger_volume_oscillator;
pub use klinger_volume_oscillator::KlingerVolumeOscillator;

mod know_sure_thing;
pub use know_sure_thing::KnowSureThing;

mod macd;
pub use macd::{MovingAverageConvergenceDivergence, MACD};

mod momentum_index;
pub use momentum_index::MomentumIndex;

mod money_flow_index;
pub use money_flow_index::MoneyFlowIndex;

mod parabolic_sar;
pub use parabolic_sar::{ParabolicSAR, ParabolicStopAndReverse};

mod pivot_reversal_strategy;
pub use pivot_reversal_strategy::PivotReversalStrategy;

mod price_channel_strategy;
pub use price_channel_strategy::PriceChannelStrategy;

mod relative_strength_index;
pub use relative_strength_index::{RelativeStrengthIndex, RSI};

mod relative_vigor_index;
pub use relative_vigor_index::RelativeVigorIndex;

mod smi_ergodic_indicator;
pub use smi_ergodic_indicator::SMIErgodicIndicator;

mod stochastic_oscillator;
pub use stochastic_oscillator::StochasticOscillator;

mod trix;
pub use trix::Trix;

mod trend_strength_index;
pub use trend_strength_index::TrendStrengthIndex;

mod true_strength_index;
pub use true_strength_index::TrueStrengthIndex;

mod woodies_cci;
pub use woodies_cci::WoodiesCCI;