How To Automate TradingView Alerts to ByBit USDT Perpetual

ttaasshh

Trader
Sep 20, 2021
19
0
12
32
Tradingview to Anywhere 2 tool has made it possible to automate TradinView alerts and TradingView strategy to ByBit USDT Perpetual 2 . The bot uses human-like commands that can be combined with TradingView’s dynamic alert messages. Once you have set up your TradingView to ByBit Webhook, proceed to set up alerts on TradingView as explained below:

Automating TradingView Strategy to ByBit USDT Perpertual
Use either {{strategy.order.action}} - which returns the string “buy” or “sell” for the executed order or {{strategy.market_position}} - which returns the current position of the strategy in string form: “long”, “flat”, or “short” (This is recommended for a strategy that generates close commands). Specify the exchange, quantity, and account using the TradingView to Anywhere commands. For Example:
{{strategy.order.action}} BTCUSDT q=0.002 tp=10% sl=5% - this will only work if the position mode settings is on one way position mode.
{{strategy.order.action}} BTCUSDT q=0.002 tp=10% sl=5% hedge - this will only work if the position mode settings is in hedge mode.

Strategy with a Close Command:
{{strategy.market_position}} BTCUSDT q=0.002 tp=10% sl=5%
- this will only work if the position mode settings is on one way position mode.
{{strategy.market_position}} BTCUSDT q=0.002 tp=10% sl=5% hedge - this will only work if the position mode settings is in hedge mode.

You can add more parameters such as p= to convert positions into pending orders.

Automating TradingView Indicator to ByBit USDT Perpetual
To automate an indicator, select the indicator as to the condition, choose long or short condition, select once per bar to avoid repainting issues, and input the applicable buy/sell command in the message field. For example:
Buy BTCUSDT q=0.002 tp=10% sl=5% - this will only work if the position mode settings are one-way position mode.
Buy BTCUSDT q=0.002 tp=10% sl=5% hedge - this will only work if the position mode settings are in hedge mode.

In the above example for a long, this will buy 0.002 BTC and place the take profit and stop loss accordingly on your ByBit USDT Perpetual account. A short condition will follow the same process but this time it would be Sell.

You can also use multi commands in a single alert when sending TradingView alerts to ByBit as shown below:
CLOSE ETHUSDT
BUY BTCUSDT Q=0.002

The above command first closes any open positions of ETHUSDT before executing the second command.

That’s all, it is that simple!