Simple Strategy
A TradingView example strategy for firing many alerts to test how automated trading works on TradersPost.
Last updated
Was this helpful?
A TradingView example strategy for firing many alerts to test how automated trading works on TradersPost.
Last updated
Was this helpful?
To showcase how to send JSON messages for a strategy from TradingView, we have created this simple strategy that takes very frequent trades and can be tested on the 1 minute chart. It can also be tested on long only, short only, or both directions. to see the strategy. You can also create an alert from this chart and send the messages to your own webhook URL.
Steps to use it:
on your TradersPost account using the , if you plan to test stocks. Strategies are based on an asset class, so you'll need to make this choice first.
Then subscribe a paper broker to that strategy using a .
There will be default settings when you create the subscription. The settings you'll want to change are:
Auto Submit: On
Sides: Both (Bullish & Bearish)
Entry order type: Market
Exit order type: Market
When the subscription is successfully created, copy the .
Create a new alert on TradingView from the .
Under condition, choose the Simple Strategy (Both)
It will say Both if the strategy settings are allowing long and short.
The Message will say {{strategy.order.alert_message}}
. Leave this alone the messages will be coming from your strategy settings and this placeholder is used to tell the strategy it should use the internal messages.
Click the Notifications tab and check the box for Webhook URL. Paste in the webhook URL you copied.
Hit Create.
Links:
You should now have trades coming in every minute to go long or short or exit those positions. Under your , you can click the Trades button next to your strategy to see the list of trades that are coming in. You can also review the to see the messages we parsed as they came in.
Add this example to your TradingView favorites.
You can find the source code for this .