Sha256: 491bdd6dc67f378d9c4befc8c4350bd985f7eb19196185b614e0c15ae9559fca

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

require './test/test_helper'

class TestAverageDirectionalIndex < Minitest::Test
  def setup
    ticker = "TESTING"
    @days = 90

    YahooFinance.stub(:get_historical_quotes, data_for_tests(@days)) do
      @stock = SignalTools::Stock.new(ticker)
    end

    @stock_data = @stock.stock_data
  end

  def test_calculate
    assert_equal "0.491321", "%.6f" % SignalTools::Technicals::AverageDirectionalIndex.new(@stock_data, 14).calculate[-1]
    assert_equal "0.496588", "%.6f" % SignalTools::Technicals::AverageDirectionalIndex.new(@stock_data, 14).calculate[-5]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signal_tools-0.3.1 test/lib/signal_tools/technicals/test_average_directional_index.rb