Module: Quant

Defined in:
lib/quant/interval.rb,
lib/quant/asset.rb,
lib/quant/config.rb,
lib/quant/errors.rb,
lib/quant/series.rb,
lib/quant/version.rb,
lib/quant/settings.rb,
lib/quant/attributes.rb,
lib/quant/indicators.rb,
lib/quant/ticks/ohlc.rb,
lib/quant/ticks/spot.rb,
lib/quant/ticks/tick.rb,
lib/quant/asset_class.rb,
lib/quant/mixins/trig.rb,
lib/quant/time_period.rb,
lib/quant/time_methods.rb,
lib/quant/indicators/ma.rb,
lib/quant/mixins/filters.rb,
lib/quant/indicators/ping.rb,
lib/quant/indicators_proxy.rb,
lib/quant/mixins/direction.rb,
lib/quant/mixins/stochastic.rb,
lib/quant/refinements/array.rb,
lib/quant/indicators_sources.rb,
lib/quant/settings/indicators.rb,
lib/quant/indicators/indicator.rb,
lib/quant/mixins/super_smoother.rb,
lib/quant/ticks/serializers/ohlc.rb,
lib/quant/ticks/serializers/spot.rb,
lib/quant/ticks/serializers/tick.rb,
lib/quant/mixins/fisher_transform.rb,
lib/quant/mixins/high_pass_filter.rb,
lib/quant/mixins/weighted_average.rb,
lib/quant/mixins/hilbert_transform.rb,
lib/quant/indicators/indicator_point.rb

Overview

Quantitative is a statistical and quantitative library for Ruby 3.x. It provides a number of classes and modules for working with time-series data, financial data, and other quantitative data. It is designed to be fast, efficient, and easy to use.

Installation

Add this line to your application’s Gemfile:

gem 'quantitative'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install quantitative

Usage

Quantitative provides a number of classes and modules for working with time-series data, financial data, and other quantitative data. It is designed to be fast, efficient, and easy to use.

Here’s a simple example of how to use Quantitative:

require "quantitative"

# Create a new series
series = Quant::Series.new

# Add some data to the series
ticks = [25.0, 26.0, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, 29.5, 30.5]
ticks.each { |tick| series << tick }

# Print the series
pp series

Defined Under Namespace

Modules: Attributes, Config, Errors, Mixins, Refinements, Settings, Ticks, TimeMethods Classes: Asset, AssetClass, Indicators, IndicatorsProxy, IndicatorsSources, Interval, Series, TimePeriod

Constant Summary collapse

VERSION =
"0.1.5"

Class Method Summary collapse

Class Method Details

.configObject



24
25
26
# File 'lib/quant/config.rb', line 24

def config
  Config.config
end

.configure_indicators(**settings) {|config.indicators| ... } ⇒ Object

Yields:



28
29
30
31
# File 'lib/quant/config.rb', line 28

def configure_indicators(**settings)
  config.apply_indicator_settings(**settings)
  yield config.indicators if block_given?
end

.current_dateObject

This method, similar to current_time, provides a single point of access for the current date.



14
15
16
# File 'lib/quant/time_methods.rb', line 14

def current_date
  Date.today
end

.current_timeObject

The library is designed to work with UTC time. This method provides a single point of access for the current time. This is useful for testing and for retrieving the current time in one place for the entire library.



9
10
11
# File 'lib/quant/time_methods.rb', line 9

def current_time
  Time.now.utc
end