Skip to content
All library documents

Positive-Bar Percentage Strategy with Reversal and Risk Controls

Article TradingView scripts

Summary

The strategy counts how many candles closed above their opens during a user-defined lookback and converts that count into a percentage. A high reading triggers a long entry and a low reading triggers a short entry; settings can reverse that mapping, restrict trade direction, and allow either direct position reversal or entries only while flat. The document notes that reversing the logic may behave better on some timeframes, but provides no supporting test results.

Trade protection can be based on recent swing highs and lows or ATR, with take-profit levels set using a risk-reward multiple. The script also includes a strategy-stop option, though its displayed stop and target variables are not defined with price levels in the supplied code. There are no asset-specific backtests, performance statistics, or robustness checks. The bar-count signal is a simple measure of recent candle direction and does not account for move size, costs beyond the configured commission, or market regime.

Key ideas

  • The signal measures the share of up-closing candles over a configurable lookback window.
  • High and low percentage thresholds trigger directional entries, with an option to reverse their interpretation.
  • Users can enable direct position reversal or require the strategy to be flat before entering.
  • ATR or recent swing levels can define stops, while profit targets use a risk-reward multiple.
  • The supplied document gives no performance evidence, and its strategy-stop option is not fully specified in the shown code.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.