Skip to content

Commit

Permalink
displays options in notification mailer
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Jan 3, 2014
1 parent 8942c3b commit b00a336
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rbtc_arbitrage (1.4.0)
rbtc_arbitrage (1.4.1)
activemodel (>= 3.1)
activesupport (>= 3.1)
bitstamp
Expand Down
15 changes: 13 additions & 2 deletions lib/rbtc_arbitrage/trader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def trade

def trade_again
sleep @options[:repeat]
@logger.info " - " if @options[:verbose]
logger.info " - " if @options[:verbose]
@buy_client = @buy_client.class.new(@options)
@sell_client = @sell_client.class.new(@options)
trade
Expand Down Expand Up @@ -167,13 +167,24 @@ def notification
higher_ex = @sell_client.exchange.to_s.capitalize
<<-eos
Update from your friendly rbtc_arbitrage trader:
-------------------
#{lower_ex}: $#{buyer[:price].round(2)}
#{higher_ex}: $#{seller[:price].round(2)}
buying #{@options[:volume]} btc from #{lower_ex} for $#{@paid.round(2)}
selling #{@options[:volume]} btc on #{higher_ex} for $#{@received.round(2)}
profit: $#{(@received - @paid).round(2)} (#{@percent.round(2)}%)
options
-------------------
options:
#{options.reject{|k,v| v.is_a?(Logger)}.collect{|k,v| "#{k}: #{v.to_s}"}.join(" | ")}
-------------------
https://github.com/hstove/rbtc_arbitrage
eos
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rbtc_arbitrage/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RbtcArbitrage
VERSION = "1.4.0"
VERSION = "1.4.1"
end
3 changes: 3 additions & 0 deletions spec/trader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@
value.should include("$3.0")
value.should include("3.0%")
end
context "--live" do
it "should say that it made a trade"
end
end

end

0 comments on commit b00a336

Please sign in to comment.