# ArcTan Oscillator

An oscillator that squashes its output through an arctangent sigmoid, emphasizing trend direction by sign while compressing noise toward the rails. An adjustable pre-gain controls how hard the squeeze is, and a correlation-driven gradient turns red when a reversal may be forming. A clean trend and divergence read for oscillator traders.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Oct 8, 2020.
- Access: free.
- Concepts: [Sigmoid/softmax Transforms](https://www.luxalgo.com/library/concept/sigmoid-softmax-transforms/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn07ur000fvhsgfjqq3tar
- Page: https://www.luxalgo.com/library/indicator/arctan-oscillator/

**ArcTan Oscillator** passes a normalized oscillator through an arctangent squash, a [sigmoid transform](https://www.luxalgo.com/library/concept/sigmoid-softmax-transforms/) that compresses swings toward the rails so the reading concentrates on direction rather than magnitude. A pre-gain control sets how aggressive that "squarification" is, and a correlation-based gradient shades the plot red when a reversal may be brewing.

## How to Trade the ArcTan Oscillator?

- **Oscillator above zero**: the trend reads up; below zero it reads down. The sign is the primary signal, and the transform exists to make it easy to follow.
- **High pre-gain**: pushes values against the bounds so the sign dominates. A setting of 5 makes the trend read almost binary.
- **Red gradient**: the correlation between oscillator and price is deteriorating, hinting at divergence; paired with a negative oscillator it suggests a possible move up, and the reverse for positive readings.

Pre-gain spans -10 to 10. Negative values reduce amplitude ahead of the transform, preserving the small swings divergence hunters need, while positive values simplify the picture for pure trend following. The reversal gradient is unaffected by pre-gain either way, so both reads coexist.

## ArcTan Oscillator Settings

- **Length**: the oscillator's period, governing its sensitivity.
- **Pre-Gain**: amplitude adjustment applied before the ArcTan step, from -10 to 10.
- **Source (Src)**: the input series feeding the calculation.

## Frequently Asked Questions

### When should I run a negative pre-gain?

When you care about shape, not just sign. Heavy squarification erases the small fluctuations that divergences live in, so pulling amplitude down keeps that detail visible while the gradient still watches for reversals.

### Is there a related oscillator worth comparing?

For another take on bounded, transform-shaped momentum, look at the [Elegant Oscillator](https://www.luxalgo.com/library/indicator/elegant-oscillator/). Contrasting the two shows how much the squashing function itself changes what you see.

### How do I add the ArcTan Oscillator to my charts?

It is free via the LuxAlgo Library. This page can also launch it in Quant, our coding agent, if you want to experiment with pre-gain values before charting it. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Sigmoid Transition Trailing Stop](https://www.luxalgo.com/library/indicator/sigmoid-transition-trailing-stop/) (Sigmoid/softmax Transforms): markdown at https://www.luxalgo.com/library/indicator/sigmoid-transition-trailing-stop.md
- [Reversal Probability Zone & Levels](https://www.luxalgo.com/library/indicator/reversal-probability-zone-levels/) (Percentile Rank): markdown at https://www.luxalgo.com/library/indicator/reversal-probability-zone-levels.md
- [Consecutive Candle Streak Analysis](https://www.luxalgo.com/library/indicator/consecutive-candle-streak-analysis/) (Distribution-of-returns Profiling): markdown at https://www.luxalgo.com/library/indicator/consecutive-candle-streak-analysis.md
- [Probability Grid](https://www.luxalgo.com/library/indicator/probability-grid/) (Distribution-of-returns Profiling): markdown at https://www.luxalgo.com/library/indicator/probability-grid.md
- [Change-Point Detection (CUSUM)](https://www.luxalgo.com/library/indicator/change-point-detection-cusum/) (Outlier Detection): markdown at https://www.luxalgo.com/library/indicator/change-point-detection-cusum.md
- [Standardized Cumulative Deltas](https://www.luxalgo.com/library/indicator/standardized-cumulative-deltas/) (Z-score): markdown at https://www.luxalgo.com/library/indicator/standardized-cumulative-deltas.md
- [ATR Exceedance Probability Model](https://www.luxalgo.com/library/indicator/atr-exceedance-probability-model/) (Distribution-of-returns Profiling): markdown at https://www.luxalgo.com/library/indicator/atr-exceedance-probability-model.md
- [Percentile Nearest Rank Using Arrays](https://www.luxalgo.com/library/indicator/percentile-nearest-rank-using-arrays/) (Percentile Rank): markdown at https://www.luxalgo.com/library/indicator/percentile-nearest-rank-using-arrays.md

---

Source: https://www.luxalgo.com/library/indicator/arctan-oscillator/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
