Topics
    How to Use and Setup Webhook Signal Trading on Bybit
    bybit2024-12-10 08:38:15

     

     

    Webhook Signal Trading on Bybit is a powerful tool that allows for automated trading of Perpetual and Futures contracts using signals from TradingView. By leveraging TradingView's webhook functionality, traders can send requests to specific URLs each time an alert is triggered, automating the trading process.


    Before you start using the Webhook Signal Trading, please read through the important notes below:

    — Ensure that you are using a paid subscription of TradingView (Essential/Plus/Premium), to be able to use webhooks.

    — Please DO NOT share your webhook URL with others, as this may allow you to receive false/scam messages or false orders placed from others. 

    — All received TradingView Alerts are sent only on behalf of the user’s settings and Bybit is not responsible for any trading losses arising from it. 

    — Please note that there may be risks of signal loss or delay, as the triggering of signals relies on a third-party platform.

    — This feature is exclusively available for Derivatives trading including USDT Perpetual, USDC Perpetual, Inverse Perpetual, and Inverse Futures on the Bybit official website and requires funds in your Derivatives or Unified Trading Account. 

    In the following sections, we'll guide you through the step-by-step process of setting up and using Webhook Signal Trading on Bybit. Before you start, make sure your account is adequately funded. 

     

     




    Run a Strategy on TradingView

    Step 1: Navigate to the Contract Page

     

    Enter the page of the contract you would like to trade under the Derivatives tab, click on Tools in the order zone, and then select Webhook Signal Trading.  

     

    1.png



     

     

    Step 2: Create a Webhook

    Click on Create Now. Please make sure you understand the overview of this function. For more information about how to run webhook signal trading, consider watching the tutorial video provided and click on I’ve confirmed the above.

     

    2.png

    3.png



     

     

    Step 3: Set Up Your Webhook

    Follow these steps to set up your webhook:

    1. Select Symbol: Choose your desired symbol for Webhook Trading. Please ensure that this note corresponds to the symbol you are using for the strategy on TradingView.

    2. Position Mode: One-Way Mode. Ensure that the position mode for the symbol you are executing the strategy for is set to One-way mode, as automatic trading for the Hedge position mode is not supported.

    3. Signal Name: Enter your signal name for your TradingView strategy.

     

    Then, click on Create Webhook.

     

    4.png

     

    Congratulations! Your Webhook Created Successfully.

     

    Notes:

    — Ensure your strategy script does not rely on the Hedge position mode, as Webhook signal trading is only supported for One-way position mode.

    — Please note that you have to create the Webhook separately for each trading pair. 



     

     

     

    Step 4: Run the Webhook  

     

    After creating your Webhook, follow these steps:

     

    a) Click on the respective contract to run a strategy on TradingView (if required).

     

    5.png

     

    b) On the TradingView Page, click on Strategy Tester to load your strategy. 

     

    Do note that Webhook signal trading is solely designed for executing strategies and does not accommodate indicators. To determine whether an indicator or a strategy is in use on your chart, inspect the initial segment of the Pine Script source code. If it states Strategy, a strategy is being utilized. On the other hand, if it reads Indicator, an indicator is active on your chart.

     

    6.png

     

    c) Open the strategy settings and parameters of your strategy

    • Set the initial capital to your Bybit account balance.

    • Enter your desired quantity per order. The orders will be placed for you with that quantity after receiving the signal.

     

    Notes:

    — Currently, for Inverse Contracts, only the order size in contracts is supported. Entering the order size in USD or as a percentage of equity may result in order placement failure. This is due to the differing logic for calculating contract value between TradingView and Bybit.

    — If you choose to enter the order size by contract, please note that for an Inverse Contract, 1 contract unit equals 1 USD. However, for a USDT Perpetual or USDC Contract, such as BTCUSDT or BTC-PERP, 1 contract equals 1 BTC.

     

    7.png

     

    d) Click on the Alert icon on the strategy tester to create an alert for your strategy and paste the message template and Webhook URL into the Alert pop-up window.

     

    8.png

     

    • Copy the message template from the Bybit page and paste it to the message box in the alert settings tab.

     

    9.png

    10.png

     

     

    • Copy the Webhook URL from the Bybit page and paste it to the URL in the alert notification tab.

     

    11.png

    12.png

     

     

     

     

    Step 5: Click on Run the webhook

     

    13.jpeg

     

     

    You have set up the Signal Trading successfully! You will receive a push notification on your Bybit App or Browser for the signal of your strategy.

     

     

     

     

     

     

     

     

    View Your Signal Details

    To view the specific details of the Webhook Signal, please go to the Tools tab, and then select Webhook. Here, you can view the Signal Name, Triggered / TradeTime, Realized P&L, and Time Created. 

     

    14.jpeg

     

    To view more of your Signal Details, click on the Details button beside and you can review your Webhook URL and Message Template. Also, you will be able to see the executed trade via this strategy.

     

    15.jpeg

     

     

    Please note that the Realized P&L displayed on the Webhook Strategy tab is the realized P&L for the trades executed by the respective Webhook Strategy. Any P&L derived from manual trade done by users will not be reflected here.

    Alternatively, you can go to Tools History → Tools Type select Webhook to view the details.

     

    16.jpeg

     

     

     

     

     

     

     

     

    Terminate Webhook Signal

    Manual Termination or Pause: To manually terminate a webhook signal, navigate to the Tools Tab. Find the signal initiated by the webhook you wish to close and click on Terminate. If you want to temporarily stop the strategy, click on Pause instead. 

     

    17.jpeg

     

    Auto Termination: A webhook signal may be automatically terminated due to several reasons:

    1. If 10 consecutive order failures occur, the strategy will be terminated.

    2. If the contract type selected is not supported on TradingView.

    3. Incomplete set parameters can lead to automatic termination.

    4. If an unsupported position mode (Hedge Mode) is selected.

    5. If the selected Futures contract is nearing its delivery date.

    6. If your account is being upgraded to a Unified Trading Account.

    7. You have reached the maximum number of Webhook Strategy can be created. Each symbol can have 5 Webhook strategies running simultaneously while each UID can have a maximum of 10 webhook strategies running at the same time. 

    8. Your account is restricted.




     

     

     

     

     

    Order Limits

     

    Please note that order placed via Webhook Strategy is subject to all order limits of manual trade on Perpetual & Futures Trading, including the minimum or maximum order size, contract price limit, and more. 

     

    Your order may fail to be placed via Webhook Strategy due to the following reasons:

     

    Error Message

    Explanation


    Order failed due to signal delay.

    The signal transmitted is delayed and it may deviate from your strategy if the order is placed and executed. Hence, the order is canceled.  


    The order failed due to an invalid symbol.

    The trading pair stated in the strategy is not supported or delisted on Bybit.


    The order failed due to missing parameters. Please copy and use the message template again.

    The parameter set is not complete, please rerun a webhook.


    The order failed due to insufficient available balance.

    You have insufficient margin to place the order. Please append additional funds to your Derivatives or Unified Trading Account. 


    The order failed due to the position mode not matching.

    Webhook Signal Trading is only supported for a One-way position mode. The position mode has been changed to hedge mode and the order placed is failed. 


    The order failed due to the risk limit being exceeded.

    The risk limit will exceed the current tier set if the order is placed. You can adjust your risk limit from the trading preference. 


    Only Reduce-Only orders may be placed for contracts that are close to delivery.

    The Futures contract is nearing its delivery date and therefore no open order can be placed. 


    The order failed due to the open interest limit being exceeded.

    The Open Interest limit will exceed if the order is placed. 


    Failed to place an order while upgrading your Unified Trading Account.

    Your account is in the progress of updating to a Unified Trading Account. Order placement will be rejected. 



     

     

     

     

     

     

    Frequently Asked Questions

     

    How can I adjust my leverage or margin mode?

    The leverage or margin mode being used on Webhook Signal Trading will be based on the leverage settings placed on the respective trading page of the symbols. To adjust the leverage, you can go to the order window of the trading pair to change the leverage and margin mode.



    Do I need to fill up all Properties parameters on Trading View?

    In order for Bybit to receive the signal correctly to place an order, currently only the Order Size is a must-filled parameter as it decides the quantity of each order to be placed. The actual total number of orders that can be placed depends on the available balance on your account. While the Initial Capital parameter does not really affect the order placement, we recommend that your initial capital be filled in according to the available balance of your Derivatives or Unified Trading Account, so that the backtest data will be more accurate.

     

    18.png



    What unit is the order size by Contract on TradingView based on?

     

    19.png

     

    For Inverse Contracts, 1 contract is equal to 1 USD. For USDT or USDC Contracts, such as BTCUSDT or BTC-PERP, 1 contract is equal to 1 BTC. Please note that for Inverse Contracts, only order size in Contracts is supported at the moment. Entering order size by USD or % of equity may lead to order placement failure.



    How can I increase or decrease my order size?

    You can adjust your order size from the Settings of your strategy → Properties window → Order Size. Please note that once you change the order size, you must save the changes to your Alert too.

     

    20.png



    How to save the changes in my strategy to my Alert?

    Whenever there are any changes to your strategy settings, including inputs, parameters, or others, you must save the changes to your Alert to make sure the signal sent to Bybit for order placement is updated. 

     

    To update the changes, please go to the Alert located on the right side of your Trading View page, and click on the Settings icon to edit your Alert. Select the most updated changes to your Alert from the Condition Dropdown and click on Save.

     

    21.png

     

    22.png



    Can I change my Webhook Message Template?

    The message template is crucial in order to send the Signal from TradingView to Bybit for successful order placement. Traders are not encouraged to make any modifications to the message template.



    Why am I seeing my Webhook Signal triggered but no trade history displayed? 

     

    23.png

     

    This is most probably because the Properties Settings of your strategy on TradingView are missing or incorrect, such as the order size input does not meet the minimum order size requirement or the message template is not copied correctly. 

     

    To check the details, please go to the Announcements portal at the lower right corner, and click on TradingView Alerts

     

    24.png



    How to check my order status?

    Go to your Signal Details to check your order status. If your order failed, you can move your cursor to the Info icon to view the reason.

     

    25.png



    How can I Add More Margin to my position or enable the Auto Margin Replenishment (AMR)?

    Similar to manual trading, you can add more margin or enable the AMR from your position tab.

     

    26.png



    What order types are supported in Webhook Signal Trading?

    The TradingView Webhook feature is primarily designed for sending alerts and notifications to external systems or services when specific conditions are met on a chart. While it can be used for various purposes, including executing trades, there are limitations to consider when it comes to placing limit orders through TradingView webhooks:

     

    Execution Capability: TradingView webhooks are mainly intended for sending signals or alerts to external systems. They provide a way to trigger actions in response to certain events on a chart, but they do not have built-in capabilities to directly execute trades or place orders on an exchange. Hence when Bybit receives the signal a market order is executed.

    Integration with Bybit: To execute limit orders through TradingView, you would need to integrate TradingView with Bybit via API. This would involve setting up the necessary connections and configurations between TradingView and Bybit.

    Limitations of Webhooks: Webhooks are typically used for one-way communication, where TradingView sends data to an external system. Placing orders requires a two-way communication flow, where the trading platform acknowledges the order placement and provides feedback or status updates. Webhooks alone may not provide this bidirectional communication required for order placement.



     

    I can see my Realized P&L on my Webhook Signal details in profit, why am I getting a negative Closed P&L?

    Please note that the Realized P&L displayed on Webhook Tools details only represents the position P&L realized from the trades executed via the Webhook Strategy. It does not include any Trading Fees and Funding Fees. Any P&L derived from manual trade done by users will not be included too.



    How can I turn on/off the notification of order execution via Webhook Signal Trading?

    On PC, please click on TradingView Alert located on your Trading Chart and enable Notify me when supported orders are placed by webhook.

     

    27.png 27.5.png

     

     

     

    On the App, Go to your notification center settings to enable the TradingView Alerts.

     

    28.png

    Was it helpful?
    yesYesyesNo