Module: Quant

Defined in:
lib/quant/interval.rb,
lib/quant/errors.rb,
lib/quant/version.rb,
lib/quant/ticks/core.rb,
lib/quant/ticks/ohlc.rb,
lib/quant/ticks/spot.rb,
lib/quant/mixins/trig.rb,
lib/quant/ticks/value.rb,
lib/quant/time_period.rb,
lib/quant/time_methods.rb,
lib/quant/mixins/filters.rb,
lib/quant/mixins/direction.rb,
lib/quant/mixins/stochastic.rb,
lib/quant/refinements/array.rb,
lib/quant/mixins/super_smoother.rb,
lib/quant/ticks/indicator_points.rb,
lib/quant/mixins/fisher_transform.rb,
lib/quant/mixins/high_pass_filter.rb,
lib/quant/mixins/weighted_average.rb,
lib/quant/ticks/serializers/value.rb,
lib/quant/mixins/hilbert_transform.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: Mixins, Refinements, Ticks, TimeMethods Classes: ArrayMaxSizeError, Error, Interval, InvalidInterval, InvalidResolution, TimePeriod

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.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