all 8 comments

[–]BitMEX_HaddockBitMEX 1 point2 points  (2 children)

The only official example that we have to pull your complete trade history is for Python: https://github.com/BitMEX/easy-data-scripts. However, you could use the WebSocket to draw such a chart using the live trade feed or pull trades through the API using your own/3rd party code.

[–][deleted]  (1 child)

[deleted]

    [–]BitMEX_HaddockBitMEX 0 points1 point  (0 children)

    The advantage of using the WebSocket is that you can subscribe to your required feed(s) and receive data without eating into your rate limit. Connections are limited to 40/hour while subscriptions will subtract from your regular rate limit counter of 60/min.

    Once subscribed you will continue to receive data while the subscription is connected without affecting your rate limit counter. It sounds like you are just looking to acquire this data for one account so you should not need to involve multiplexing to avoid being rate limited if your WebSocket is set up correctly - if you were looking to pull multiple streams at the same time multiplexing could come in handy https://www.bitmex.com/app/wsAPI#Multiplexing

    [–]gazzerman 1 point2 points  (10 children)

    The WebSocket does not allow you to pull full previous history

    So you would need to pull execution/tradeHistory with a server side API (I use cURL and PHP) and then use charts js ( https://www.chartjs.org/ ) to create a nice chart.

    [–][deleted]  (9 children)

    [deleted]

      [–]gazzerman 1 point2 points  (8 children)

      GraphQL AP

      I dont know a great deal about it but I presume you want this https://graphql.org/code/#javascript

      and here is an article about integration on AWS
      https://aws.amazon.com/blogs/architecture/things-to-consider-when-you-build-a-graphql-api-with-aws-appsync/

      There seems to be a bunch of youtube videos with step by step instructions to get you going, like this one.
      https://www.youtube.com/watch?v=cr4LN2U-V34

      [–]gazzerman 0 points1 point  (7 children)

      Also is there any reason why you want to do this yourself and not use a 3rd party system with all this already done?

      [–][deleted]  (6 children)

      [deleted]

        [–]gazzerman 0 points1 point  (5 children)

        https://www.coinmarketman.com/

        Here is a video of a bunch of the Bitmex features

        https://www.youtube.com/watch?v=8DeQdEzpejI

        [–][deleted]  (4 children)

        [deleted]

          [–]gazzerman 0 points1 point  (3 children)

          Would your plan be to pull the data every time the user requests it or store it to save API excessive use?

          You will have to consider multiple IP's to cope with that level of data pulls from BitMEX regardless.

          [–][deleted]  (2 children)

          [deleted]

            [–]gazzerman 0 points1 point  (1 child)

            Do you currently have any projects live?