API Trading: How to create a Trade by program?

For you and the copiers of your Trades, for free

API Trading allows you to create a Trade from your own computer program. We will see in this tutorial how to create a trade on major cryptocurrency exchanges like Binance Futures, Binance Spot, Huobi, Crypto.com, Kraken, Kucoin, Bittrex, Bitfinex, OKX or Ascendex.

Thanks to our partnership with the main exchange platforms, it’s totally free. We are indeed a licensed broker/broker. Thus, they automatically pay us part of the trading fees. It does not change anything for you! On Binance Spot and Binance Futures, there is one condition: you must use a Binance account created after March 2020 and without a referral link.

If you want replicate your trades on the accounts of your subscribers, it is quite possible even with this method of API Trading. We will see how to create your Copy Trading group. We have other methods than the API Trading to create Trades like our Smart Trading Terminal suitable for Manual Trading.

For this API Trading method, you can code in any computer language.


API Trading: setting up your account

1) Create an account on Wall of Traders.

2) Connect by clicking on “Stay connected”:

API Trading: create an account

3) Switch to Developer mode : right click anywhere on the page then Inspect, or press F12 :

API Trading: developer mode

Then click on Traders in the Menu on the left, it refreshes the data. Then in the DevTools on the right: Click on “Network”, then on “Groups”, and scroll down to “authorization: Bearer ………” :

API Trading: configuration

Copy the characters after “Bearer”; in my example from eyJhbG….. to ….. 66qAkz4. Save this value somewhere. We will use it in {Token} in the code.

4) Create an API on the exchange of your choice, for example on Binance. Save the API Key and API Secret.

5) Then on your Wall Of Traders account, add the API Key and API Secret of this exchange.

6) Then modify this exchange by clicking on the pencil:

Modify an exchange on Wall Of Traders

In the URL you will see https://walloftraders.com/exchanges/12345 where 12345 is the {ExchangeId}. Copy this number and save it. It will be used in {ExchangeId} in the code.

7) On the Traders page, click at the top right on “CREATE A TRADER“. When you will validate the form, you will be redirected to a page. In the URL you will see https://walloftraders.com/manageFollowers/56789 where 56789 is the {GroupId}. Copy this number and save it. It will be used in {GroupId} in the code.

Preparation is complete! Now all you have to do is Coding using the code below.


API Trading: how to create a Trade

It’s your turn by copying and pasting the code below and adapting it to your programming language:


POST https://api2.walloftraders.com/api/v1/Order

Header:

Authorization: ‘Bearer {Token}’,

Content-Type: ‘application/json’,

Body:

{

“isBuy”: true, //true: Buy/Long mode – false: Sell/Short mode

“accountId”: {ExchangeId},

“pair”: “BTC-USDT”,

“groupId”: {GroupId},

“leverage”: 1, //Add this line only if the exchange you are trading on uses leverage. For example add it for Binance Futures but remove it for Binance Spot.

“pourcentage”: 5, //Percentage of capital for the Trade. Between 0.01 and 100.

“startPrice”: 19000, //Limit entry price. Put 0 to enter the market.

“targets”: [ //The sum of the “percentages” must not be greater than 100.

{

“pourcentage”: 50, //Share in % to close for this Take Profit. For example, put 100 for a single Take Profit, or 50 to close the half.

“orderType”: 0, //0: limit order – 1: market order.

“price”: null, //Take Profit price, if “price” != null, the next line “profit” is not read.

“profit”: 2, //If “price” == null, the target price will be equal to startPrice*(1+-profit/100).

“trailing”: null, //Trailing percentage (optional line).

}

],

“stopPrice”: 18000, //Put null if you don’t want to put Stop Loss.

“stopProfit”: -2, //If stopPrice == null, then we automatically calculate the Stop price = startPrice-stopProfit/100 (optional line)

“orderId”: 987654, //To update the Trade, insert the orderId here (optional line)

//Other optional features

“note”: “Blabla”, //Free text

“dontDoOrder”: false, //Doesn’t create the Trade for me, but creates it for the copiers. Only if GroupId defined.

“dontDoStart”: false, //Do not create entry but create TP and SL.

“timeOutStart”: null,

“timeOutStopLoss”: null,

“trailingStart”: null,

“startTriggerPrice”: null,

“startTradingViewGuid”: null,

“trailingStopLoss”: null,

“orderTypeStop”: 0,

}


I hope this article has you more! If you have any questions, you can talk to us directly on Telegram.

This article is not investment advice. Do your own research before investing in the cryptocurrency market.

Leave a comment