Sending Orders - TradingView Integration
BOTSpedia
Onboarding
Sending Orders - TradingView Integration
Onboarding
This is some text inside of a div block.

Sending Orders - TradingView Integration

It is possible to seamlessly send buy/sell orders from TradingView to BOTS. This can be done by using the Webhook URL option in your TradingView alert box.

It is possible to seamlessly send buy/sell orders from TradingView to BOTS. This can be done by using the Webhook URL option in your TradingView alert box. You can also use strategy alerts to automate your trading.

Read on to find out how to send signals to the BOTS platform/BEM API -

 

It is important to note that TradingView can only send signals to BOTS - but it cannot receive messages. Therefore, it is important to create a separate live environment on your system. This is very simple. Please see our GitHub to get your live environment up and running. Once this is done, the unique id that is provided to enter the trade can be used to track the status of the order.

 

Alternatively, Postman can also be used to make api calls for the sake of tracking order status and receiving bot asset percentage. This can be done by clicking on import and pasting the following cURL commands under the raw text option:

 

1.) [GET]getOrderInfo -

curl -X GET "https://signal.revenyou.io/paper/api/signal/v2/getOrderInfo?signalProvider=MyBot&signalProviderKey=MyKey&extId=UniqueOrdeId"  -H  "accept: application/xml"

 

 

2.)[GET]getBotsAssetsPct -

curl -X 'GET' \

  'https://signal.revenyou.io/paper/api/signal/v2/getBotAssetsPct?signalProvider=MyBot&signalProviderKey=MyKey&exchange=binance&baseAsset=BTC'  \

 -H  'accept: application/xml'

 

Once this is done, you will have to fill in the required parameters. Read along to get a brief understanding of the parameters and order request procedure from TradingView. We can obviously only track orders once an order request has been made. An example of order tracking is shown in the last section.

 

In order to access the API, you need to create a bot name and obtain a key for it. You can do this on the app. Please visit docs.revenyou.io for a more detailed description about the api and it’s different endpoints.

 

 

Step 1 - Create Syntax

The table below shows various components of the syntax that will be used to send orders to BOTS from TradingView. The table also contains a brief description of each component.

 

 

Now that we know the components of the syntax, let us build the syntaxitself to send an order to the BOTS platform:

{

"signalProvider":"Test1349",

"signalProviderKey":"APIKEY",

"extId":"UniqueID",

"exchange":"binance",

"baseAsset":"BTC",

"quoteAsset":"USDT",

"type":"limit",

"limitPrice":"43000",

"qtyPct":"50",

"side":"buy",

"ttlType":"secs",

"ttlSecs":"60",

"responseType":"ACK"

}

 

 

The example above is the syntax for sending a buy order to the Binance exchange.

 

Now, let us link TradingView to BOTS.

 

STEP  2 - Link TradingView to BOTS

 

On your TradingView account, open the corresponding chart and click ‘create alert’ (ALT + A):

 

 

In order to link your TradingView account to BOTS you need to use the Webhook URL option in your TradingView alert box. URLs for both test (paper) and live production bases are noted below:

 

Test mode - https://signal.revenyou.io/paper/api/signal/v2/placeOrder

Live mode - https://signal.revenyou.io/production/api/signal/v2/placeOrder

 

After you have copied the URL, paste this on the TradingView alert-box webhook URL as highlighted in the image above.Next, create the signal syntax by referring to the example used in Step 1 and enter it under the message field of the TradingView alert box.

 

Once this is done, click on ‘Create’.

 

Once your alert is triggered, your position will open on your desired exchange.

 

Remember to provide a unique extId each time an order request is made. This can be automated thanks to the placeholder optionality that TV provides.

 

 

 

 

Tracking the triggered Order

 

As mentioned in the first section, we have to first click on import and paste the cURL command for getOrderInfo endpoint in the Raw text option in order to track the status of the order.

Once the required parameters including the ext id from the placed order request have been filled, you must click on send.An example of the response is shown below.

 

 

 

Download the BOTS app now!
Start trading automatically in just two minutes.