Directional alert messages
An third message structure which can be used is directional alerts. Here you set an alert for each direction namely enter long, exit long, enter short and exit short
This requires a little bit more of your strategy or indicator, and might not be supported. If not, you can always use the standard alert message structure.
Directional alerts overview
Here are the fundamental 4 types of actions your strategy can take. In this example, the strategy is trading EURUSD with a fixed quantity size of 1000 contracts (equal to 0.01 lot size):
Enter long alert message
{
"ticker": "EURUSD",
"action": "buy",
"prev_position" : "flat",
"quantity": "1000",
"pointer" : "m1k3y"
}
Exit long alert message
{
"ticker": "EURUSD",
"action": "sell",
"prev_position" : "long",
"quantity": "1000",
"pointer" : "m1k3y"
}
Enter short alert message
{
"ticker": "EURUSD",
"action": "sell",
"prev_position" : "flat",
"quantity": "1000",
"pointer" : "m1k3y"
}
Exit short alert message
{
"ticker": "EURUSD",
"action": "buy",
"prev_position" : "short",
"quantity": "1000",
"pointer" : "m1k3y"
}
Directional alerts for indicators
Automating strategies requires a little bit more of the TradingView script, as it is up to the programmer to set what conditions can trigger an alert that Tickerly can use to automate trading.
Most commonly, the indicator script can send alerts at long or short entries, where you can then set a fixed value alert then that condition is met.
You can overwrite every component of an alert manually.
Directional alerts for strategies
You can configure the alert messages inside the strategy, if your strategy has input boxes for entering custom messages on enter long, exit long, enter short and exit short respectively.
This requires that your strategy is able to replace some placeholder values with the values generated by the strategy for a trade. It typically takes the form of, for instance, #quantity# which will be replaced by the size of the order price. If your strategy supports this, then use the below alert structures for your enter long and enter short full trade alerts.
All of the placeholders can be replaced by manually set fixed values, if needed, for e.g. replacing the “#symbol#” value with “BTCUSDTPERP”, or replacing “#quantity#” with e.g. “0.1”
Enter long directional alert message
{
"ticker": "#symbol#",
"action": "buy",
"prev_position" : "flat",
"quantity": "#quantity#",
"pointer" : "replace with pointer for your exchange here"
}
Exit long directional alert message
{
"ticker": "#symbol#",
"action": "sell",
"prev_position" : "long",
"quantity": "#quantity#",
"pointer" : "replace with pointer for your exchange here"
}
Enter short directional alert message
{
"ticker": "#symbol#",
"action": "sell",
"prev_position" : "flat",
"quantity": "#quantity#",
"pointer" : "replace with pointer for your exchange here"
}
Exit short directional alert message
{
"ticker": "#symbol#",
"action": "buy",
"prev_position" : "short",
"quantity": "#quantity#",
"pointer" : "replace with pointer for your exchange here"
}
All above elements are mandatory and the order will not be placed correctly, if one element is missing.
Alert messages when using strategy inputs
Note that when settings alerts when using strategy input fields, you use a simpler message in the alert message box. In most cases is will be:
{{strategy.order.alert_message}}
That will make your strategy alerts message look like this:
But there are also some strategies which use
{{strategy.order.comment}}
Refer to the details of your strategy and test which works for your strategy.