Class: SQA::Trade

Inherits:
Object
  • Object
show all
Defined in:
lib/sqa/trade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = SQA::Config.trades_filename) ⇒ Trade

Returns a new instance of Trade.



7
8
9
10
11
# File 'lib/sqa/trade.rb', line 7

def initialize(
			filename = SQA::Config.trades_filename
		)
	@df = SQA::DataFrame.load(filename)
end

Instance Attribute Details

#dfObject

Returns the value of attribute df.



5
6
7
# File 'lib/sqa/trade.rb', line 5

def df
  @df
end

Instance Method Details

#confirm(uuid, shares, price) ⇒ Object



19
20
21
# File 'lib/sqa/trade.rb', line 19

def confirm(uuid, shares, price)
	# TODO: update the row in the data frame
end

#place(signal, ticker, shares, price = nil) ⇒ Object



13
14
15
16
17
# File 'lib/sqa/trade.rb', line 13

def place(signal, ticker, shares, price=nil)
	# TODO: insert row into @df

	uuid = rand(100000) # FIXME: place holder
end

#saveObject



23
24
25
# File 'lib/sqa/trade.rb', line 23

def save
	# TODO: save the data frame
end