PAT Automation: Automating Trading Strategy
.png%3Falt%3Dmedia&w=3840&q=75)
The PAT Automation allows users to create, backtest, and automate strategies using features from the Price Action Toolkit. This article teaches step-by-step how to automate a Price Action trading strategy using the PAT Automation tool.
Platform For Strategy Automation
After you've built and backtested a strategy on TradingView, you can use webhooks to automate the strategy on your preferred brokerage. TradingView does not allow users to automate strategies directly through the platform. Thus, you must use a 3rd party website to connect with a brokerage and automate your custom strategy. In this article, we will be using TradersPost. However, you can also use other platforms and follow similar steps to automate your strategy.
Below are platforms that provide services to automate your custom PAT Automation strategy:
Step 1) Connect a Brokerage
Once you've chosen a platform, connect the brokerage account you use for trading. To connect a brokerage on TradersPost, click the "Brokers" tab on your user dashboard and then select a brokerage to connect to.
.png%3Falt%3Dmedia&w=3840&q=75)
Step 2) Create a Strategy
Strategy Step One
Go to the "Strategies" section on the TradersPost user dashboard and click "+ New Strategy".
.png%3Falt%3Dmedia&w=3840&q=75)
Strategy Step Two
Create a strategy by inputting a name, creating a description, choosing an asset class, and allowing any ticker.
You can choose from the following asset classes:
Stocks
Options
Futures
Crypto
After you've filled out all the necessary details for your strategy, click "Save".

Step 3) Create a Subscription
Once you've created a strategy, you must create a subscription.
Subscription Step One
Go to the "Subscriptions" section on the TradersPost user dashboard and click "+ New Subscription".
.png%3Falt%3Dmedia&w=3840&q=75)
Subscription Step Two
After creating a new subscription, select the strategy you've created from Step 2, then select the brokerage you connected in Step 1, and click "Create".
.png%3Falt%3Dmedia&w=3840&q=75)
.png%3Falt%3Dmedia&w=3840&q=75)

Subscription Step Three
Configure the subscription details with the following:
Enter a name for your subscription
Enable "Auto Submit". This will allow your broker to automatically execute your orders from your strategy. If this is disabled, you will need to manually approve or reject each order.
Change the "Sides" setting to "Both (Bullish & Bearish)"
Enable "Allow any ticker"
Afterward, click "Save" and "Enable". No additional adjustments are needed within the subscription settings. Your strategy— including position sizing, entries, and exits—is fully managed within the strategy you've built on TradingView using the PAT Automation.

Step 4) Setup Webhook
After you've created a subscription on TradersPost, you must set up your webhook.
Webhook Step One
Go to the "Webhooks" section on the TradersPost user dashboard, click the 3 dots next to the webhook with your strategy name, and click view.

Webhook Step Two
Click "Webhook" in the top right and then click "Copy". This will copy your webhook URL.
PLEASE NOTE: For security reasons, DO NOT share your webhook URL with anyone. Your webhook URL is a private key that allows automated trading executions. Sharing it can lead to unauthorized access, potentially compromising your trading account and funds.

Step 5) TradingView Setup
TradingView Step One
Go to TradingView and create an alert on the ticker you want to automate trades using your custom strategy from the PAT Automation tool.

TradingView Step Two
Set up the alert with the following criteria:
Condition: Flux Charts - PAT Automation
Expiration: Choose when you would like this alert to expire. Your strategy will stop being automated once the alert expires.
Alert Name: This is optional to fill, but it makes it easier to keep track of your alerts/strategies if you create several.
Message: You must input the JSON code snippet from below (Copy & Paste). Otherwise, the strategy automation will not work through TradersPost.
{
"ticker": "{{ticker}}",
"action": "{{strategy.order.action}}",
"sentiment": "{{strategy.market_position}}",
"quantity": "{{strategy.order.contracts}}",
"price": "{{close}}",
"time": "{{timenow}}"
}
PLEASE NOTE: If you're using another platform to automate trades instead of TradersPost this message may differ!

TradingView Step Three
Go to the "Notifications" tab within your alert and enable the "Webhook URL". Paste your webhook URL from Step 4 here and then click "Create"
Please Note: You need to have 2FA enabled on your TradingView account to use webhooks.

After clicking create, your strategy will be automated through the brokerage you connected from the earlier steps.