> ## Documentation Index
> Fetch the complete documentation index at: https://docs.luxalgo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Alerts

## Backtester Alerts

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Buy Alerts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Sell Alerts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://mintcdn.com/luxalgo/0Jdje6xa5PGD9ypH/public/images/backtesters/alerts/long.png?fit=max&auto=format&n=0Jdje6xa5PGD9ypH&q=85&s=af0d0b36b9746106adf9973cf632c6ec" alt="" width="447" height="521" data-path="public/images/backtesters/alerts/long.png" /> | <img src="https://mintcdn.com/luxalgo/0Jdje6xa5PGD9ypH/public/images/backtesters/alerts/short.png?fit=max&auto=format&n=0Jdje6xa5PGD9ypH&q=85&s=400f7d2e763ef48809105e6a7443ca9d" alt="" width="442" height="520" data-path="public/images/backtesters/alerts/short.png" /> |

Users can get alerted for any action executed by a strategy, from opening positions to closing them. The way alerts work is the same across all the Backtester scripts.

The message field in the **Alert Messages** setting section of each Backtester allows for the strategy to send a custom alert message depending on the action taken by the strategy, if no messages are set the strategy will send default messages.

In order for alerts to return custom user set messages the `{{strategy.order.alert_message}}` should be set on the message field of the Tradingview alert menu.

<img src="https://mintcdn.com/luxalgo/0Jdje6xa5PGD9ypH/public/images/backtesters/alerts/alert.png?fit=max&auto=format&n=0Jdje6xa5PGD9ypH&q=85&s=e1cb036f61e9812531a24a6aade3cb9d" alt="" width="706" height="713" data-path="public/images/backtesters/alerts/alert.png" />

<Note>
  Backtester (PAC) does not have Exit Long/Short TP/SL alerts, instead only having Exit Long/Short
</Note>

## Alerts Placeholders

Users can use placeholders in the messages set from the **Alert Messages** setting section to return market data, take profit/stop losses values, chart ticker and timeframe...etc.

|                       Placeholder                      |                                                   Description                                                  |
| :----------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: |
|    <div style={{ textAlign: 'left' }}>`{open}`</div>   |                         <div style={{ textAlign: 'left' }}>Current opening price</div>                         |
|    <div style={{ textAlign: 'left' }}>`{high}`</div>   |                           <div style={{ textAlign: 'left' }}>Current high price</div>                          |
|    <div style={{ textAlign: 'left' }}>`{low}`</div>    |                           <div style={{ textAlign: 'left' }}>Current low price</div>                           |
|   <div style={{ textAlign: 'left' }}>`{close}`</div>   |                         <div style={{ textAlign: 'left' }}>Current closing price</div>                         |
|   <div style={{ textAlign: 'left' }}>`{volume}`</div>  |                             <div style={{ textAlign: 'left' }}>Current volume</div>                            |
|    <div style={{ textAlign: 'left' }}>`{time}`</div>   |    <div style={{ textAlign: 'left' }}>UNIX timestamp (in milliseconds) of the bar <b>opening time</b></div>    |
|  <div style={{ textAlign: 'left' }}>`{timenow}`</div>  |    <div style={{ textAlign: 'left' }}>UNIX timestamp (in milliseconds) of the <b>current bar time</b></div>    |
|   <div style={{ textAlign: 'left' }}>`{ticker}`</div>  |   <div style={{ textAlign: 'left' }}>Chart ticker (e.g: for BINANCE:BTCUSDT the ticker name is BTCUSDT)</div>  |
|   <div style={{ textAlign: 'left' }}>`{prefix}`</div>  | <div style={{ textAlign: 'left' }}>Ticker prefix (e.g: for BINANCE:BTCUSDT the ticker prefix is BINANCE)</div> |
| <div style={{ textAlign: 'left' }}>`{timeframe}`</div> |                            <div style={{ textAlign: 'left' }}>Chart timeframe</div>                            |
|     <div style={{ textAlign: 'left' }}>`{tp}`</div>    |                           <div style={{ textAlign: 'left' }}>Take profit value</div>                           |
|     <div style={{ textAlign: 'left' }}>`{sl}`</div>    |                            <div style={{ textAlign: 'left' }}>Stop loss value</div>                            |

<Warning>
  In order to function properly, `{timenow}` requires the strategy to recalculate on everytick.

  This can be enabled from the strategy settings -> Properties -> RECALCULATE

  If not enabled `{timenow}` will act like `{time}`.
</Warning>

Example:

<Note>
  New long entry generated at `{time}` and price `{close}` on `{ticker}{timeframe}` with take profit `{tp}` and stop loss `{sl}`
</Note>
