Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions lib/rest/v2/orders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@ def orders
authenticated_post("auth/r/orders").body
end

# Returns historic closed or cancelled orders
#
# @param symbol [string] symbol used for the order
# @param params :start [int32] Millisecond start time
# @param params :end [int32] Millisecond end time
# @param params :limit [int32] Number of records
# @param params :id [Array<int32>] Allows you to retrieve specific orders by order ID (id: [ID1, ID2, ID3])
#
# @return [Array]
#
# @example:
# client.orders_history
# client.orders_history(symbol: 'tBTCUSD')
# client.orders_history(symbol: 'tBTCUSD', params: { id: [123, 234] })
def orders_history(symbol: nil, params: {})
check_params(params, %i{start end limit id})
if symbol
path = "auth/r/orders/#{symbol}/hist"
else
path = "auth/r/orders/hist"
end

authenticated_post(path, params: params).body
end

# Get Trades generated by an Order
#
# @param order_id [int32] Id of the order
Expand Down