Expand description
§RustTI
A Technical Indicators library for Rust
What differentiates RustTI from other Technical Indicator packages is how configurable the functions are.
Many models were created decades ago when the work weeks were different (such as RSI, SO, Ichimoku cloud…). For example, if one studies stocks the work week is 5 days, but if one studies cryptocurrencies the work week is 7 days.
Everything is configurable in the RustTI functions, from period to moving average models.
A lot of online articles recommend sticking with the TI defaults as these are used by traders. I would recommend the opposite. While it is true that most day traders tend to stick to the defaults, large financial institutions such as investment banks and hedge funds have their own quantitative teams who build them custom models. This is what this package allows you to do.
Many of the functions accept parameters that allow the caller to move the technial indicators away from its default behaviour. For example, if a TI uses the mean to calculate part of the indicator, it can be told to use the median, or mode instead.
For this reason, RustTI is a more advanced Technical Inidcators package, and the users should have some basic knowledge of the indicators they plan on using.
RustTI is split into different modules, organised by common TI areas. Each module is then split
into a single
and a bulk
submodule.
The single
submodule is used to calculate the indicator once, using the entire price slice
that is passed in.
The bulk
submodule is used to iterate over a slice of prices to calculate the indicator for a period.
§Available indicators:
§Standard Indicators
standard_indicators
are configurable indicators that have had their configurations hardcoded to
follow industry standards.
These are essentially wrappers for the other functions.
§Bulk
§Single
§Basic Indicators
basic_indicators
are basic functions that are often the foundation of more complex
indicators.
§Bulk
absolute_deviation
- Calculates the absolute deviationlog
- Calculates the natural logrithm of slice of priceslog_difference
- Calculates the difference between the natural logarithm at t and t-1mean
- Calculates the mean (average) of a slice of pricesmedian
- Calculates the median (middle value) of a slice of pricesmode
- Calculates the mode (most common price) of a slice of pricesstandard_deviation
- Calculates the standard deviation of a slice of pricesvariance
- Calculates the variance of slice of prices
§Single
absolute_deviation
- Calculates the absolute deviationlog_difference
- Calculates the difference between the natural logarithm at t and t-1max
- Calculates the maximum of a slice of pricesmean
- Calculates the mean (average) of a slice of pricesmedian
- Calculates the median (middle value) of a slice of pricesmin
- Calculates the minimum of a slice of pricesmode
- Calculates the mode (most common price) of a slice of pricesstandard_deviation
- Calculates the standard deviation of a slice of pricesvariance
- Calculates the variance of slice of prices
§Candle Indicators
candle_indicators
are indicators that are used with candle charts.
§Bulk
ichimoku_cloud
- Calculates the Ichimoku Cloudmcginley_dynamic_bands
- The McGinley Dynamic version of themoving_constant_bands
mcginley_dynamic_envelopes
- The McGinley Dynamic version of themoving_constant_envelopes
moving_constant_bands
- Calculates the moving constant bandsmoving_constant_envelopes
- Calculates the moving constant envelopesdonchian_channels
keltner_channel
supertrend
§Single
ichimoku_cloud
- Calculates the Ichimoku Cloudmcginley_dynamic_bands
- The McGinley Dynamic version of themoving_constant_bands
mcginley_dynamic_envelopes
- The McGinley Dynamic version of themoving_constant_envelopes
moving_constant_bands
- Calculates the moving constant bandsmoving_constant_envelopes
- Calculates the movingdonchian_channels
keltner_channel
supertrend
§Chart Trends
chart_trends
shows trends on charts. Unlike the other modules it has no bulk or single.
break_down_trends
- Breaks down the chart into different price trendsoverall_trend
- Calculates the overall trend for all price pointspeak_trend
- Calculates the trend of the peakspeaks
- Returns all the peaksvalley_trend
- Calculates trend of the valleysvalleys
- Returns all the valleys
§Correlation indicators
correlation_indicators
show how closely the prices of two different assets move together.
§Bulk
correlate_asset_prices
- Calculates the correlation between two assets
§Single
correlate_asset_prices
- Calculates the correlation between two assets
§Momentum Indicators
momentum_indicators
show how much the price is rising or falling
§Bulk
chaikin_oscillator
- Calculates the Chaikin Oscillatorcommodity_channel_index
- Calculate the Commodity Channel Indexmacd_line
- Calculates the Moving Average Convergence Divergence linemcginley_dynamic_chaikin_oscillator
- Calculate the McGinley dynanic version of the Chaikin Oscillatormcginley_dynamic_commodity_channel_index
- Calculates the McGinley dynamic version of the Commodity Channel Indexmcginley_dynamic_macd_line
- Calculates the McGinley dynamic version of the Moving Average Convergence Divergence linemcginley_dynamic_rsi
- Calculates the McGinley dynamic version of the Relative Strength Indexmoney_flow_index
- Calculates the Money Flow Indexon_balance_volume
- Calculates the On-balance Volumerate_of_change
- Calculates the Rate of Changerelative_strength_index
- Calculates the Relative Strength Indexsignal_line
- Calculates the Signal line to be used with the MACD lineslow_stochastic
- Calculates the slow stochastic to be used with the stochastic oscillatorslowest_stochastic
- Calculates the slowest stochastic to be used with the stochastic oscillatorstochastic_oscillator
- Calculates the Stochastic Oscillatorwilliams_percent_r
- Calcualtes the Williams %Rpercentage_price_oscillator
chande_momentum_oscillator
§Single
chaikin_oscillator
- Calculates the Chaikin Oscillatorcommodity_channel_index
- Calculate the Commodity Channel Indexmacd_line
- Calculates the Moving Average Convergence Divergence linemcginley_dynamic_chaikin_oscillator
- Calculate the McGinley dynanic version of the Chaikin Oscillatormcginley_dynamic_commodity_channel_index
- Calculates the McGinley dynamic version of the Commodity Channel Indexmcginley_dynamic_macd_line
- Calculates the McGinley dynamic version of the Moving Average Convergence Divergence linemcginley_dynamic_rsi
- Calculates the McGinley dynamic version of the Relative Strength Indexmoney_flow_index
- Calculates the Money Flow Indexon_balance_volume
- Calculates the On-balance Volumerate_of_change
- Calculates the Rate of Changerelative_strength_index
- Calculates the Relative Strength Indexsignal_line
- Calculates the Signal line to be used with the MACD lineslow_stochastic
- Calculates the slow stochastic to be used with the stochastic oscillatorslowest_stochastic
- Calculates the slowest stochastic to be used with the stochastic oscillatorstochastic_oscillator
- Calculates the Stochastic Oscillatorwilliams_percent_r
- Calcualtes the Williams %Rpercentage_price_oscillator
chande_momentum_oscillator
§Moving Averages
The moving_average
module has functions used to calculate the moving average
§Bulk
mcginley_dynamic
- Calculates the McGinley Dynamicmoving_average
- Calculates different types Moving Averages
§Single
mcginley_dynamic
- Calculates the McGinley Dynamicmoving_average
- Calculates different types Moving Averages
§Other Indicators
other_indicators
don’t really fit in anywhere else
§Bulk
return_on_investment
- Calculates the return on investmenttrue_range
average_true_range
internal_bar_strength
§Single
return_on_investment
- Calculates the return on investmenttrue_range
average_true_range
internal_bar_strength
§Strength Indicators
strength_indicators
show the strength of a trend
§Bulk
accumulation_distribution
- Calculates the Accumulation Distributionpositive_volume_index
negative_volume_index
relative_vigor_index
§Single
accumulation_distribution
- Calculates the Accumulation Distributionvolume_index
relative_vigor_index
§Trend Indicators
trend_indicators
show the trend direction of an asset
§Bulk
aroon_down
- Calculates the Aroon downaroon_indicator
- Calculates the Aroon indicatoraroon_oscillator
- Calculates the Aroon Oscillatoraroon_up
- Calculates the Aroon upparabolic_time_price_system
- Calculates the parabolic time price systemvolume_price_trend
true_strength_index
§Single
aroon_down
- Calculates the Aroon downaroon_indicator
- Calculates the Aroon indicatoraroon_oscillator
- Calculates the Aroon Oscillatoraroon_up
- Calculates the Aroon uplong_parabolic_time_price_system
- Calculates the parabolic time price system for long positionsshort_parabolic_time_price_system
- Calculates the parabolic time price system for short positionsvolume_price_trend
true_strength_index
§Volatility Indicators
volatility_indicators
show how volatile an asset are.
§Bulk
ulcer_index
- Calculates the Ulcer Indexvoltility_system
- Calculates Welles volatility system
§Single
ulcer_index
- Calculates the Ulcer Index
Modules§
- Basic Indicators
- Candle indicators
- Chart Trends
- Correlation indicators
- Momentum Indicators
- Moving Averages
- Other Indicators
- Standard Indicators
- Strength Indicators
- Trend Indicators
- Volatility Indicators
Enums§
- The
CentralPoint enum
is used to determine the central point - The
ConstantModelType
enum is used by a number of functions to determine the centerpoint around which to do its calculations. - The
DeviationModel
enum is used by a number of functions to determine the deviation from a central point. - The
MovingAverageType
is used when calculating themoving_average
. The simple caclculates the moving average without interferring, however the smoothed and exponential types assign weights to the more recent prices. - The
Position
enum is used for indicators that need to know the position of the trade (short, long) to perform their calculations.