Skip to content

Latest commit

 

History

History
164 lines (130 loc) · 10.4 KB

TradeApi.md

File metadata and controls

164 lines (130 loc) · 10.4 KB

IO.Swagger.Api.TradeApi

All URIs are relative to https://www.bitmex.com/api/v1

Method HTTP request Description
TradeGet GET /trade Get Trades.
TradeGetBucketed GET /trade/bucketed Get previous trades in time buckets.

TradeGet

List TradeGet (string symbol = null, string filter = null, string columns = null, int? count = null, int? start = null, bool? reverse = null, DateTime? startTime = null, DateTime? endTime = null)

Get Trades.

Please note that indices (symbols starting with .) post trades at intervals to the trade feed. These have a size of 0 and are used only to indicate a changing price. See the FIX Spec for explanations of these fields.

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class TradeGetExample
    {
        public void main()
        {
            var apiInstance = new TradeApi();
            var symbol = symbol_example;  // string | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series.  You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`.  Symbols are case-insensitive. (optional) 
            var filter = filter_example;  // string | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#Timestamp-Filters) for more details. (optional) 
            var columns = columns_example;  // string | Array of column names to fetch. If omitted, will return all columns.  Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. (optional) 
            var count = 56;  // int? | Number of results to fetch. Must be a positive integer. (optional)  (default to 100)
            var start = 56;  // int? | Starting point for results. (optional)  (default to 0)
            var reverse = true;  // bool? | If true, will sort results newest first. (optional)  (default to false)
            var startTime = 2013-10-20T19:20:30+01:00;  // DateTime? | Starting date filter for results. (optional) 
            var endTime = 2013-10-20T19:20:30+01:00;  // DateTime? | Ending date filter for results. (optional) 

            try
            {
                // Get Trades.
                List<Trade> result = apiInstance.TradeGet(symbol, filter, columns, count, start, reverse, startTime, endTime);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TradeApi.TradeGet: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
symbol string Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive. [optional]
filter string Generic table filter. Send JSON key/value pairs, such as `{"key": "value"}`. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details. [optional]
columns string Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. [optional]
count int? Number of results to fetch. Must be a positive integer. [optional] [default to 100]
start int? Starting point for results. [optional] [default to 0]
reverse bool? If true, will sort results newest first. [optional] [default to false]
startTime DateTime? Starting date filter for results. [optional]
endTime DateTime? Ending date filter for results. [optional]

Return type

List

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TradeGetBucketed

List TradeGetBucketed (string binSize = null, bool? partial = null, string symbol = null, string filter = null, string columns = null, int? count = null, int? start = null, bool? reverse = null, DateTime? startTime = null, DateTime? endTime = null)

Get previous trades in time buckets.

Timestamps returned by our bucketed endpoints are the end of the period, indicating when the bucket was written to disk. Some other common systems use the timestamp as the beginning of the period. Please be aware of this when using this endpoint. Also note the open price is equal to the close price of the previous timeframe bucket.

Example

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class TradeGetBucketedExample
    {
        public void main()
        {
            var apiInstance = new TradeApi();
            var binSize = binSize_example;  // string | Time interval to bucket by. Available options: [1m,5m,1h,1d]. (optional)  (default to 1m)
            var partial = true;  // bool? | If true, will send in-progress (incomplete) bins for the current time period. (optional)  (default to false)
            var symbol = symbol_example;  // string | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series.  You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`.  Symbols are case-insensitive. (optional) 
            var filter = filter_example;  // string | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#Timestamp-Filters) for more details. (optional) 
            var columns = columns_example;  // string | Array of column names to fetch. If omitted, will return all columns.  Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. (optional) 
            var count = 56;  // int? | Number of results to fetch. Must be a positive integer. (optional)  (default to 100)
            var start = 56;  // int? | Starting point for results. (optional)  (default to 0)
            var reverse = true;  // bool? | If true, will sort results newest first. (optional)  (default to false)
            var startTime = 2013-10-20T19:20:30+01:00;  // DateTime? | Starting date filter for results. (optional) 
            var endTime = 2013-10-20T19:20:30+01:00;  // DateTime? | Ending date filter for results. (optional) 

            try
            {
                // Get previous trades in time buckets.
                List<TradeBin> result = apiInstance.TradeGetBucketed(binSize, partial, symbol, filter, columns, count, start, reverse, startTime, endTime);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TradeApi.TradeGetBucketed: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
binSize string Time interval to bucket by. Available options: [1m,5m,1h,1d]. [optional] [default to 1m]
partial bool? If true, will send in-progress (incomplete) bins for the current time period. [optional] [default to false]
symbol string Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive. [optional]
filter string Generic table filter. Send JSON key/value pairs, such as `{"key": "value"}`. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details. [optional]
columns string Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. [optional]
count int? Number of results to fetch. Must be a positive integer. [optional] [default to 100]
start int? Starting point for results. [optional] [default to 0]
reverse bool? If true, will sort results newest first. [optional] [default to false]
startTime DateTime? Starting date filter for results. [optional]
endTime DateTime? Ending date filter for results. [optional]

Return type

List

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]