Webhook Trading on Pi42
What is a webhook?
A webhook is a method that allows TradingView to communicate real-time data directly to Pi42. Essentially, it lets specific conditions set on TradingView immediately trigger trading orders on Pi42.
How does this integration work?
TradingView premium users can create alerts or execute trading strategies via webhook. When these alerts or strategies are triggered, a webhook message, containing trade specifics, such as the trading symbol, side, and quantity, will be dispatched to Pi42. Upon receiving these, Pi42 will automate the trade execution.
Follow these steps to create a webhook
1. Visit the Trade Terminal and Click on Webhook Signal Trading
2. Click on Create New Webhook, it will open up a modal. Choose a signal name. For example, “Testing” and click create signal.
3. Once signal is created, it will open up a drawer on the right side of the screen
You will see a Webhook URL and messages for different actions like Place order, or cancel open order or close position.
4. Copy the webhook url and chosen action message using the copy button.
5. Open TradingView in a new tab and open the chart showing the symbol you want to trade (lets say, BTCUSDT). You can add the strategy you want to trade from Indicators > Technical > on this chart. Strategies as shown in the screenshot
6. Once you have applied the chosen strategy to the chart, you will be able to see its results on the strategy tester panel.
7. The next step is to configure the order sizing parameters. Click the Settings Button to configure your strategy.
8. Go to the Properties page and configure your order size.
9. Copy the message from the popup on Pi42, it would look something like this:
For Placing a new order:
{
side : <BUY_or_SELL>,
type : <MARKET_or_LIMIT_or_STOP_MARKET_or_STOP_LIMIT>,
uuid : b8e1926acffba29cacb4a9821e438bfbfe11308930fbe1049a82eb8de1c9fa55,
price : <PRICE>,
// Only applicable for limit or stop-limit orders
action : NEW_ORDER,
symbol : <SYMBOL>,
quantity : <QUANTITY>,
stopPrice : <STOP_PRICE>,
// Only applicable for stop-market or stop-limit orders
marginAsset : INR,
stopLossPrice : <SL_PRICE>,
// Optional
takeProfitPrice : <TP_PRICE>,
// Optional
}
10.Click on the add alert button and paste the message in the message box.
11. Move to the Notifications tab and paste your webhook URL
12. Click on Create Button and you are all set! Wait for the strategy to trigger a trade and it will be executed on your Pi42 account! You can check Alerts tab to see the triggered alerts.
You can start trading via Webhook with no additional costs.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article