OPEN-SOURCE SCRIPT

Strategy: Range Breakout

Güncellendi
What?

In the price action, levels have a significant role to play. Based on the price moving above/below the levels - the underlying instrument shows some price-action in the direction of breakout/breakdown.

There are plenty of ways level can be determined. Levels are the decision point to take a trade or not. But if we make the level derivation complex, then the execution may get hamper.

This strategy script, developed in PineScript v5, is our attempt at solving this problem at the core by providing this simple, yet elegant solution to this problem.

It's essentially an attempt to Trade Simple by drawing logical (horizontal) lines in the chart and take actions, after multiple associated parameters confirmation, on the breakout / breakdown of the levels.



How?

Let us explain how we are drawing the levels.

We are depending on some of the parameters as described below:

  • Open Range: During intraday movement, often if prices move beyond a particular level, it exibits more movement in the same swing in same direction. We found out, through our back testing for Indian Indices like NIFTY, BANKNIFTY or CNXFINANCE the first 15m (i.e 09:15 AM to 09:30 AM, IST) is one of such range. For Indian stocks, it is 9:15 to 9:45. And for MCX CRUDEOIL1! it's 5:00 pm to 6:00 pm. There are our first levels.
  • PDHCL: Previous Day High, Close, Low. This is our next level
  • VWAP: The rolling VWAP (volume weighted average price)


In the breakout/breakdown of the Open Range and Previous Day High/Low, we are taking the trade decisions as follows using CEST principle:

Conditions:
* If current bar's (say you are in 5m timeframe) closing is broken out the Open Range High or Previous Day High, taken a Buy/Long decision (let's say buying a Call Option CE or selling a Put Option PE or buying the future or cash).
* If current bar's (say you are in 5m timeframe) closing is broken down the Open Range Low or Previous Day Low, taken a Sell/Short decision (let's say buying a Put Option CE or selling a Call Option PE or selling the future or cash).
* Additionally, and optionally (default ON, one can turn off): we are checking various other associated multiple confirmations as follows:
1. Momentum: Checking 14-period RSI value is more than 50 or less than 50 (all parameters like period, OB, OS ranges are configurable through settings)
2. Current bar's volume is more than the last 20 bars volume average. How much more - that multiplier is also configurable. (default is 1)
3. The breakout candle is bullish (green) or bearish (red).

Entry:
* All of these happens only on the closing of the candle. Means: Non Repainting!.
* Clearly in the chart we are showing as green up arrow BO (breakout for buy) and red down arrow BD (breakdown for sell) to take your decision process smooth.
* So, on the closing of the decision BO/BD candle we are entering the trade (with a thumping heart and nail biting ...)

Stop Loss:
* We are relying on the time tasted (last 40 years) mechanism of Average True Range (ATR) of default 14 period. This default period is also configurable.
* So for Long trades: the 14 period ATR low band is the SL.
* For Short trades: the 14 period ATR high band is the SL.

Target:
* We are depending on the thump rule of 1:2 Risk Reward. It's simple and effective. No fancy thing. We are closing the trade on double the favorable price movement compared to the SL placed. Of course, this RR ratio is confiurable from the settings, as usual.



What's Unqiue in it?

The utter simplicity of this trading mechanism. No fancy things like complex chart pattern, OI data, multiple candlestick patterns, Order flow analysis etc.

* Simple level determination,
* Marking clearly in the chart.
* Making each parameter configurable in Settings and showing tooltip adjacent to the parameter to make you understand it better for your customization,
* Wait for the candle close, thus eliminating the chances of repainting menace (as much as possible)
* Additional momentum and volume check to trade entry confirmation.
* Works with normal candlestick (nothing special ones like HA ...)
* Showing everything as a Summary Table (which, again can be turned off optionally) overlaying at the bottom-right corner of the chart,
* Optionally the Summary Table can be configured to alert you back (say you get it notified in your email or SMS).

That way, a single, simple, effective trade setup will ease your journey as smooth sail as possible.


Mentions
* There are plenty of friends from whom time to time we borrowed some of the ideas while working closely together over last one year.
* From tradingview community, we took the spirit of zzzcrypto123 awesome work done long back (in 2020) as the indicator "ORB - Opening Range Breakout". (We tried to reach him for his explicit consent, unable to catch hold of him).
* Some other publicly available materials we have consulted to get the additional checks (like RSI, volume).


Lat word

Use it please and thank you for your constant patronage in following us in this awesome platform. Let's keep growing together.


Disclaimer:

This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
Sürüm Notları
As there are quite a few lines for different ranges, so added a tiny label at the right most of the plot to denote what plot is this.
As the labels are tiny so added a tooltip (in case if you are seeing it in mobile). Just hover over the label, the bigger tooltip will be shown.
Average True Range (ATR)backtestingBands and ChannelsBANKNIFTYeducationalfinniftyindianstockmarketNIFTYpdhlrangebreakoutsimpletradingstrategy

Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının yazarı komut dosyasını açık kaynak olarak yayınlamıştır, böylece yatırımcılar betiği anlayabilir ve doğrulayabilir. Yazar çok yaşa! Ücretsiz olarak kullanabilirsiniz, ancak bu kodun yayında yeniden kullanımı Ev kurallarına tabidir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?


Aynı zamanda::

Feragatname