Module: SQA

Includes:
Constants
Defined in:
lib/sqa/init.rb,
lib/sqa/config.rb,
lib/sqa/version.rb,
lib/sqa/constants.rb,
lib/sqa/plugin_manager.rb,
lib/sqa/indicator/predict_next_value.rb

Overview

lib/sqa/indicator/predict_next_values.rb

Defined Under Namespace

Modules: CLI, Commands, Constants Classes: Activity, Config, DataFrame, Indicator, PluginManager, Portfolio, Stock, Strategy, Ticker, Trade

Constant Summary collapse

VERSION =
"0.0.24"
@@config =
nil
@@av =
ApiKeyManager::RateLimited.new(
	api_keys: 		ENV['AV_API_KEYS'],
	delay: 				true,
	rate_count: 	ENV['AV_RATE_CNT'] ||  5,
	rate_period: 	ENV['AV_RATE_PER'] || 60
)

Constants included from Constants

Constants::Signal, Constants::Swing, Constants::Trend

Class Method Summary collapse

Class Method Details

.avObject



38
# File 'lib/sqa/init.rb', line 38

def av() 								= @@av

.configObject



45
# File 'lib/sqa/init.rb', line 45

def config()            = @@config

.config=(an_object) ⇒ Object



47
48
49
# File 'lib/sqa/init.rb', line 47

def config=(an_object)
	@@config = an_object
end

.data_dirObject



44
# File 'lib/sqa/init.rb', line 44

def data_dir() 					= Pathname.new(config.data_dir)

.debug?Boolean

Returns:

  • (Boolean)


40
# File 'lib/sqa/init.rb', line 40

def debug?() 						= @@config.debug?

.homify(filepath) ⇒ Object



43
# File 'lib/sqa/init.rb', line 43

def homify(filepath) 		= filepath.gsub(/^~/, Nenv.home)

.init(argv = ARGV) ⇒ Object

Initializes the SQA modules returns the configuration



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/sqa/init.rb', line 16

def init(argv=ARGV)
	if argv.is_a? String
		argv = argv.split()
	end


	# Ran at SQA::Config elaboration time
	# @@config = Config.new

	if defined? CLI
		CLI.run!    # TODO: how to parse a fake argv?  (argv)
	else
		# There are no real command line parameters
		# because the sqa gem is being required within
		# the context of a larger program.
	end

	config.data_dir = homify(config.data_dir)

	config
end

.verbose?Boolean

Returns:

  • (Boolean)


41
# File 'lib/sqa/init.rb', line 41

def verbose?() 					= @@config.verbose?

.versionObject



7
8
9
# File 'lib/sqa/version.rb', line 7

def version
  @@version ||= VERSION.to_version
end