Sha256: b3501a8ac2ba8ac16eceaefa7c088a8f8855819d67d3d2b4987b4a81c27de735
Contents?: true
Size: 867 Bytes
Versions: 21
Compression:
Stored size: 867 Bytes
Contents
# lib/sqa/indicator/double_top_bottom_pattern.rb class SQA::Indicator; class << self def double_top_bottom_pattern( prices # Array of prices ) return :no_pattern if prices.length < 5 data = prices.last(5) first_peak = data[0] valley = data[1] second_peak = data[2] neckline = data[3] confirmation_price = data[4] if first_peak < second_peak && valley > first_peak && valley > second_peak && confirmation_price < neckline :double_top elsif first_peak > second_peak && valley < first_peak && valley < second_peak && confirmation_price > neckline :double_bottom else :no_pattern end end end; end
Version data entries
21 entries across 21 versions & 1 rubygems