The Pro version of TradingView Bot strategy allows you to execute your strategy defined in TradingView Bot using the webhook and choosing the action in each case. Opening and closing positions are realized using market orders, so your strategy must count with that.
How to create bot
- Create your strategy in TradingView that will call the API of ChainTerminal platform.
- Create TradingView bot in ChainTerminal platform
- Select name of your bot
- Select what will be the Quote Asset of futures markets
- Select the quantity (cost) of your position that will be opened when the signal comes. Quantity can be set as one of the:
- Fixed – absolute value
- % – percentage of your available balance (so the absolute value can vary for every signal incoming as your available balance fluctuates)
- Select Action for each combination of your actual position state and signal type:
3. Copy Webhook url that was generated specially for your bot and use it in TradingView
4. In TradingView the call to ChainTerminal API should meet this requirements:
Type: POST
Url: copied url from TradingView bot
Message body type: JSON
Message body structure:
-
- baseAsset: string
- side: BUY / SELL
Example:
{
“baseAsset”: “BTC”,
“side”: “BUY”
}
How Does It Work
ChainTerminal receives a signal and validates it (if bot is running, if market exists, etc.).
Then it checks your position on that market (if is open, if is short/long).
Depending on the signal type and action rules it executes order or ignores the signal.