Created
May 23, 2014 03:35
-
-
Save janx/e5561a5f10a3e92e73ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = Member.find_by_email '[email protected]' | |
market = Market.find :btccny | |
puts "Ready ..." | |
a = m.get_account(:cny) | |
puts "balance: #{a.balance.to_s('F')}" | |
puts "locked: #{a.locked.to_s('F')}" | |
gets | |
puts "Started." | |
orders = [] | |
100.times do | |
order = OrderBid.new( | |
source: 'debug', | |
state: Order::WAIT, | |
member_id: m.id, | |
ask: market.target_unit, | |
bid: market.price_unit, | |
currency: market.id, | |
price: 3000, | |
volume: 1, | |
origin_volume: 1 | |
) | |
Ordering.new(order).submit | |
a = m.get_account(:cny) | |
puts "balance: #{a.balance.to_s('F')}" | |
puts "locked: #{a.locked.to_s('F')}" | |
orders << order | |
end | |
orders.each do |o| | |
Ordering.new(o).cancel | |
a = m.get_account(:cny) | |
puts "balance: #{a.balance.to_s('F')}" | |
puts "locked: #{a.locked.to_s('F')}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment