Trading Direction from Selected-Period High and Low Levels
Summary
This script retrieves the high and low from a chosen chart period, such as a day, week, or month, with a lookback setting to select the current or an earlier period. It assigns a long state when the close is above the selected low and a short state when the close is below the selected high, then submits entries in that direction. A reverse option swaps the resulting long and short signals. The script also colors bars according to the current state.
The source describes itself as educational and exposes period, lookback, and direction-reversal inputs. It provides no market-specific settings, backtest results, risk controls, or evidence that the signals are profitable. As written, the long condition is checked first: a close above the selected low becomes long even if it is also above the high, while the short state occurs when the close is at or below the selected low. This ordering affects how the levels should be interpreted and tested. The script is best read as a simple level-based directional rule rather than a validated strategy.
Key ideas
- The selected timeframe and lookback determine which period's high and low are used.
- The script sets direction by comparing the close with those levels.
- The optional reverse setting exchanges the long and short states.
- Because the long condition is evaluated first, a close above the selected low takes precedence over the short condition.
- The document supplies no performance evidence or risk management rules.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.