OPEN-SOURCE SCRIPT

IU Range Trading Strategy

IU Range Trading Strategy

The IU Range Trading Strategy is designed to identify range-bound markets and take trades based on defined price ranges. This strategy uses a combination of price ranges and ATR (Average True Range) to filter entry conditions and incorporates a trailing stop-loss mechanism for better trade management.

User Inputs:
- Range Length: Defines the number of bars to calculate the highest and lowest price range (default: 10).
- ATR Length: Sets the length of the ATR calculation (default: 14).
- ATR Stop-Loss Factor: Determines the multiplier for the ATR-based stop-loss (default: 2.00).

Entry Conditions:
1. A range is identified when the difference between the highest and lowest prices over the selected range is less than or equal to 1.75 times the ATR.
2. Once a valid range is formed:
- A long trade is triggered at the range high.
- A short trade is triggered at the range low.

Exit Conditions:
1. Trailing Stop-Loss:
- The stop-loss adjusts dynamically using ATR targets.
- The strategy locks in profits as the trade moves in your favor.
2. The stop-loss and take-profit levels are visually plotted for transparency and easier decision-making.

Features:
- Automated box creation to visualize the trading range.
- Supports one position at a time, canceling opposite-side entries.
- ATR-based trailing stop-loss for effective risk management.
- Clear visual representation of stop-loss and take-profit levels with colored bands.

This strategy works best in markets with defined ranges and can help traders identify breakout opportunities when the price exits the range.

Declinazione di responsabilità