OPEN-SOURCE SCRIPT

UT Bot Alerts – Time Filtered with Exits

933
This indicator combines several technical approaches to generate precise entry and exit signals, while incorporating time filters that ensure signals are sent only during desired time windows and with defined cooldown periods. It is based on the original idea by QuantNomad.

Main Components:

ATR-based Trailing Stop:
Using the Average True Range (ATR) and an adjustable multiplier ("Key Value"), a dynamic trailing stop is calculated that adapts to the current price. This trailing stop forms the basis for the signal generation.

EMA-based Entry Signals:
A very short exponential moving average (EMA, period 1) is used in combination with the trailing stop to identify clear buy (long) and sell (short) signals via crossovers. An additional buffer zone helps reduce false signals.

Persistent Trade State:
The current state (long, short, or neutral) is maintained so that the system remains in the trend until a new signal is generated.

Linear Regression as Reference:
A linear regression line computed over a defined period serves as a reference for determining exit levels.

Exit Signals with Delay:
Exit signals are generated when the price deviates from the linear regression line by a defined percentage (Exit Signal Deviation) and the condition persists for at least a specified number of bars (Exit Signal Delay). Only one exit signal is issued per trade to avoid excessive exits.

Time Filters and Cooldown:

  • Session Filter: A user-defined session (e.g., "2200-0500") can disable signals during specified periods.
  • Cooldown Period: After a signal is triggered, a cooldown phase (in minutes) can be set during which no new signals are sent.


Visual Display and Alerts:

  • Entry Signals: Buy and sell signals are displayed as labels (green for long, red for short).
  • Exit Signals: Exit signals appear as triangles, with the exit long signal text displayed in white.
  • Reference Lines:
  • The upper exit level (Exit Short Level) is drawn as a solid line in turquoise (color.aqua).
  • The lower exit level (Exit Long Level) is drawn as a solid line in yellow.
  • Additionally, the ATR trailing stop and the linear regression line are clearly plotted on the chart.
  • Alerts can be configured for all signal types.


In Summary:
The indicator delivers precise entry signals based on an ATR trailing stop and a short EMA, supplemented by dynamic exit levels determined via linear regression. With integrated time filters (session and cooldown) and a flexible exit mechanism, this indicator offers controlled trade management—ideal for traders who wish to receive signals only during desired time periods.

Original Author: QuantNomad

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.