Sha256: 2efc5e82e9a5ed11046ebf9e802617d73542aab55ce3fba0db2ebddcad0c9deb
Contents?: true
Size: 731 Bytes
Versions: 18
Compression:
Stored size: 731 Bytes
Contents
# lib/sqa/strategry/common.rb # This module needs to be extend'ed within # a strategy class so that these common class # methods are available in every trading strategy. class SQA::Strategy module Common def trade_against(vector) return :hold unless respond_to? :trade recommendation = trade(vector) if :sell == recommendation :buy elsif :buy == recommendation :sell else :hold end end def desc doc_filename = self.name.split('::').last.downcase + ".md" doc_path = Pathname.new(__dir__) + doc_filename debug_me{[ :doc_path ]} if doc_path.exist? doc = doc_path.read else doc = "A description of #{self.name} is not available" end puts doc end end end
Version data entries
18 entries across 18 versions & 1 rubygems