Skip to content

📦 SQA::SectorAnalyzer

Source Information

Defined in: lib/sqa/sector_analyzer.rb:26

Inherits from: Object

🔨 Instance Methods

#blackboards()

Returns the value of attribute blackboards.

Source Location

lib/sqa/sector_analyzer.rb:40


#stocks_by_sector()

Returns the value of attribute stocks_by_sector.

Source Location

lib/sqa/sector_analyzer.rb:40


#initialize(db_dir: = '/tmp/sqa_sectors')

Returns

Type: SectorAnalyzer

a new instance of SectorAnalyzer

Source Location

lib/sqa/sector_analyzer.rb:42


#add_stock(stock, sector:)

Add a stock to sector analysis

Parameters

Name Type Description
stock SQA::Stock, String Stock object or ticker
sector Symbol Sector classification
Source Location

lib/sqa/sector_analyzer.rb:62


#discover_sector_patterns(sector, stocks, **options)

Discover patterns for an entire sector

Parameters

Name Type Description
sector Symbol Sector to analyze
stocks Array<SQA::Stock> Stock objects to analyze
options Hash Pattern discovery options

Returns

Type: Array<Hash>

Sector-wide patterns

Source Location

lib/sqa/sector_analyzer.rb:86


#detect_sector_regime(sector, stocks)

Detect sector regime

Parameters

Name Type Description
sector Symbol Sector to analyze
stocks Array<SQA::Stock> Stock objects

Returns

Type: Hash

Sector regime information

Source Location

lib/sqa/sector_analyzer.rb:146


#query_sector(sector, fact_type, pattern = {})

Query sector blackboard

Parameters

Name Type Description
sector Symbol Sector to query
fact_type Symbol Type of fact to query
pattern Hash Pattern to match

Returns

Type: Array<KBS::Fact>

Matching facts

Source Location

lib/sqa/sector_analyzer.rb:190


Print sector summary

Parameters

Name Type Description
sector Symbol Sector to summarize
Source Location

lib/sqa/sector_analyzer.rb:202


📝 Attributes

👁️ blackboards read-only

Returns the value of attribute blackboards.

👁️ stocks_by_sector read-only

Returns the value of attribute stocks_by_sector.