OPEN-SOURCE SCRIPT

Discount/Premium OTE Levels

This indicator is created to identify discount/premium areas to provide additional confluence to trades taken. The underlying theory is that the trades taken in discounted areas are likely to have less risk due to a smaller stop loss and a higher reward/risk ratio.

The indicator operates by first identifying a zone between the last major swing high and low. These highs and lows are determined as price points that at the extremes within the number of bars to the left, as defined by the "Swing Sensitivity" setting.

Once a price zone is established, the indicator verifies that the zone meets the minimum size in points as configured via the "Minimum size" setting to be considered tradable. Zones that are too small may not provide a sufficient range even for scalping. The default value is 42 points based on Nasdaq, which means that the distance between inner most OTE levels (0.382 and 0.618) is at least 10 points.

When a valid zone is identified, it is then subdivided into areas of interest based on OTE levels, which can be configured/adjusted via the "Levels to Draw" setting. These levels represent the midpoint (50%), which distinguishes between premium and discount, and the three OTE levels 0.79, 0.705, 0.618, above the 50% for discount and below the 50% for premium.

For example, if a zone is formed initially by a swing low followed by a swing high with the assumption that the draw is higher, the indicator can be used to formulate long positions from below the 50% level starting at 0.38 OTE level, or ideally at 0.295 OTE level using 0 as a stop loss. Alternatively, if the 50% level is not yet tapped, short scalp positions can be made from 0.79-0.618 OTE levels with 50% as a partial or TP target.
See snapshot for long/short example

Typically, the indicator will show only a single zone. However, there may be cases with two zones: one larger parent zone containing a smaller, valid price zone within itself.
The indicator will automatically invalidate and remove the zone once the high/low of the zone is invalidated.

Configuration:
The indicator provides several visualization options for customization, including:
  1. Color settings for OTE levels, with separate settings for edge/50% color, premium, and discount levels.
  2. Settings for line style for OTE levels.
  3. Settings to determine whether to show prices on level labels.
  4. Settings to decide if lines should be extended to the right.

Aviso legal