OPEN-SOURCE SCRIPT

BarRange Strategy

Hello,

This is a long-only, volatility-based strategy that analyzes the range of the previous bar (high - low).

If the most recent bar’s range exceeds a threshold based on the last X bars, a trade is initiated.

You can customize the lookback period, threshold value, and exit type.

For exits, you can choose to exit after X bars or when the close price exceeds the previous bar’s high.

The strategy is designed for instruments with a long-term upward-sloping curves, such as ES1! or NQ1!. It may not perform well on other instruments.

Commissions are set to $2.50 per side ($5.00 per round trip).

Recommended timeframes are 1h and higher. With adjustments to the lookback period and threshold, it could potentially achieve similar results on lower timeframes as well.
statisticsVolatility

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian