Tradingview to Anywhere tool has made it possible to automate TradinView alerts and TradingView strategy to ByBit USDT Perpetual . 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
For a strategy that generates long, and short commands only, use {{strategy.order.action}} which will return the string “buy” or “sell” for the executed order.
For a strategy with long, short, and exit commands, use {{strategy.market_position}} - which returns the current position of the strategy in string form: “long”, “flat”, or “short”.
Specify the exchange, quantity, and account using the TradingView to Anywhere commands.
For Example:
-
A strategy with a long and short command only:
Close BTCUSDT
{{strategy.order.action}} BTCUSDT q=0.002 L=5 tp=10% sl=5% - this will only work if the position mode settings is on one way position mode.
or,
Close BTCUSDT
{{strategy.order.action}} BTCUSDT q=0.002 L=5 tp=10% sl=5% hedge - this will only work if the position mode settings is in hedge mode. -
A strategy with a long, short, and exit 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.
or,
{{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/close to avoid repainting issues, and input the applicable buy/sell command in the message field.
For example:
- Buy Alert
Close BTCUSDT
Buy BTCUSDT Q=0.002 L=10 tp=10% sl=5% - Sell Alert
Close BTCUSDT
Sell BTCUSDT Q=0.002 L=20 tp=10% sl=5%
In the above example, the alert will close any BTCUSDT open positions before going long/short 0.002 BTC, place the take profit, and stop loss accordingly on your ByBit USDT Perpetual account.
Please note that Q as a percentage of your balance is now supported.
Automate your TradingView script to Binance today