En raison d'une augmentation de la demande, vous pourriez rencontrer des retards avec Live Support. Si vous avez des difficultés pour vous connecter à votre compte, veuillez consulter ce guide.
REST API indicator based trading bot (Node.js)
One of the intended uses of our REST API is to create automated trading bots that interact with our markets and accounts.
While trading bots come in an almost endless variety, they all share similar API integration characteristics, and all perform the following common tasks:
  • retrieving market data (ticker, order book, etc.)
  • making trading decisions (based upon the market data, or indicators derived from the market data, or other possible criteria)
  • placing/cancelling orders
Our REST API provides all of the functionality needed to implement a full featured trading bot, but knowing how to combine the different aspects of our API can be difficult, hence the following trading bot code is provided as an example.
The example code implements an indicator based trading bot (specifically an 80/20 over bought/sold RSI, with trading decisions based upon a 1 minute slope change), and shows how to integrate the market data, decision making, and trading aspects of a trading bot successfully.
Example Code (Node.js)
The trading bot code is a single Node.js file and integrates directly with our API. All configuration (API key, currency pair, indicator, order type, leverage etc.) is contained within the code for ease of reference.
The example code can be viewed below and can also be downloaded.