Some time ago, I was looking for a way to trade cryptocurrency at Binance in a semi-automated fashion, where I could outline my trading strategy in a chart.
At the exchange website and application, I could do my technical analysis with the charts, but I couldn’t say: “Hey, I want to either buy or sell, depending on the market movements.”
Let’s clarify with an example with a scenario:
- The current
BTCprice is at
BTC/USDTpair), and the current
ETHprice is at
- You want to buy the
BTCdip if it drops to
- At the same time, you might want to buy the
ETHdip if it drops further to
- How can you buy either asset without locking
USDTfunds depending on the scenario that comes first?
Enter: Webhook Trader.
What is great about this way of trading is: since the order does not yet exist at the exchange for when it gets set as a chart alert, you do not need to lock the funds.
So the life of an order placed from TradingView this way is the following:
- You place an alert at a specific price in a TradingView chart.
- In the alert options, you set your server’s webhook URL and the JSON of the order you want to execute.
- The alert triggers, TradingView sends the JSON instruction to your server’s webhook URL, and the server with the configured parameters places the order (either a Market Order, Limit Order, or Stop Limit Order).
- You’ll see the order under the Open Orders tab or Order History, depending on the execution time.
For setting up this environment, you’ll need:
- A Binance account which you can set it up here. (affiliate link) In theory, this works with any cryptocurrency exchange that ccxt supports, but in case you run into problems please let me know via the Issue Tracker at GitHub.
- A TradingView Pro or better plan in your account.
- A server in DigitalOcean, which you can set it up here. (affiliate link)
- A FreeDNS account, pointing to your DigitalOcean server. Sign up here.
If you need help setting it up in your server, please drop me a Direct Message on my Twitter account, and we can arrange something for a small fee via web conference meeting outside of business hours.