OPEN-SOURCE SCRIPT
Diupdate 3/4-Bar GRG / RGR Pattern (Conditional 4th Candle)

This indicator can be used to identify the Green-Red-Green or Red-Green-Red pattern.
It is a price action indicator where a price action which identifies the defeat of buyers and sellers.
If the buyers comprehensively defeat the sellers then the price moves up and if the sellers defeat the buyers then the price moves down.
In my trading experience this is what defines the price movement.
It is a 3 or 4 candle pattern, beyond that i.e, 5 or more candles could mean a very sideways market and unnecessary signal generation.
How does it work?
Upside/Green signal
Downside/Red signal
Important Settings
Pointers
It is a price action indicator where a price action which identifies the defeat of buyers and sellers.
If the buyers comprehensively defeat the sellers then the price moves up and if the sellers defeat the buyers then the price moves down.
In my trading experience this is what defines the price movement.
It is a 3 or 4 candle pattern, beyond that i.e, 5 or more candles could mean a very sideways market and unnecessary signal generation.
How does it work?
Upside/Green signal
- Say candle 1 is Green, which means buyers stepped in, then candle 2 is Red or a Doji, that means sellers brought the price down. Then if candle 3 is forming to be Green and breaks the closing of the 1st candle and opening of the 2nd candle, then a green arrow will appear and that is the place where you want to take your trade.
- Here the buyers defeated the sellers.
- Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
- Important - We need to enter the trade as soon as the price moves above the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close. Ignore wicks.
- I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
- I call it the +-+ or GRG pattern.
- Stop loss can be candle 2's mid for safe traders (that includes me) or candle 2's body low for risky traders.
- Back testing suggests that body low will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
Downside/Red signal
- Say candle 1 is Red, which means sellers stepped in, then candle 2 is Green or a Doji, that means buyers took the price up. Then if candle 3 is forming to be Red and breaks the closing of the 1st candle and opening of the 2nd candle then a Red arrow will appear and that is the place where you want to take your trade.
- Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
- We need to enter the trade as soon as the price moves below the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close.
- I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
- I call it the -+- or RGR pattern.
- Stop loss can be candle 2's mid for safe traders ( that includes me) or candle 2's body high for risky traders.
- Back testing suggests that body high will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
Important Settings
- You can enable or disable the 4th candle signal to avoid the noise, but at times I have noticed that the 4th candle gives a very strong signal or I can say that the strong signal falls on the 4th candle. This is mostly a coincidence.
- You can also configure how many previous bars should the signal be generated for. 10 to 30 is good enough. To backtest increase it to 2000 or 5000 for example.
- Rest are self explanatory.
Pointers
- If after taking the trade, the next candle moves in your direction and closes strong bullish or bearish, then move SL to break even and after that you can trail it.
- If a upside trade hits SL and immediately a down side trade signal is generated on the next candle then take it. Vice versa is true.
- Trades need to be taken on previous 2 candle's body high or low combined and not the wicks.
- The most losses a trader takes is on a sideways day and because in our strategy the stop loss is so small that even on a sideways day we'll get out with a little profit or worst break even.
- Hold targets for longer targets and don't panic.
- If last 3-4 days have been sideways then there is a good probability that day will be trending so we can hold our trade for longer targets. Target to hold the trade for whole day and not exit till the day closes.
- In general avoid trading in the middle of the day for index and stocks. Divide the day into 3 parts and avoid the middle.
- Use Support/Resistance, 10, 20, 50, 200 EMA/SMA, Gaps, Whole/Round numbers(very imp) for identifying targets.
- Trail your SL.
- For indexes I would use 5 min and 15 min timeframe.
- For commodities and crypto we can use higher timeframe as well. Look for signals during volatile time durations and avoid trading the whole day. Signal usually gives good targets on those times.
- If a GRG or RGR pattern appears on a daily timeframe then this is our time to go big.
- Minimum Risk to Reward should be 1:2 and for longer targets can be 1:4 to 1:10.
- Trade with small lot size. Money management will happen automatically.
- With small lot size and correct Risk-Re ward we can be very profitable. Don't trade with big lot size.
- Stay in the market for longer and collect points not money.
- Very imp - Watch market and learn to generate a market view.
- Very imp - Only 4 candles are needed in trading - strong bullish, strong bearish, hammer, inverse hammer and doji.
- Go big on bearish days for option traders. Puts are better bought and Calls are better sold.
- Cluster of green signals can lead to bigger move on the upside and vice versa for red signals.
- Most of this is what I learned from successful traders (from the top 2%) only the indicator is mine.
Catatan Rilis
This indicator can be used to identify the Green-Red-Green or Red-Green-Red pattern.It is a price action indicator where a price action which identifies the defeat of buyers and sellers.
If the buyers comprehensively defeat the sellers then the price moves up and if the sellers defeat the buyers then the price moves down.
In my trading experience this is what defines the price movement.
It is a 3 or 4 candle pattern, beyond that i.e, 5 or more candles could mean a very sideways market and unnecessary signal generation.
How does it work?
Upside/Green signal
1. Say candle 1 is Green, which means buyers stepped in, then candle 2 is Red or a Doji, that means sellers brought the price down. Then if candle 3 is forming to be Green and breaks the closing of the 1st candle and opening of the 2nd candle, then a green arrow will appear and that is the place where you want to take your trade.
2. Here the buyers defeated the sellers.
3. Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
4. Important - We need to enter the trade as soon as the price moves above the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close. Ignore wicks.
5. But for a more optimised entry I have added an option to use candle’s highs and lows instead of open and close. This reduces lot of noise and provides us with more precise entry. This setting is turned on by default.
6. I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
7. I call it the +-+ or GRG pattern or Green-Red-Green or Buyer-Seller-Buyer or Seller defeated or just Buyer pattern.
8. Stop loss can be candle 2's mid for safe traders (that includes me) or candle 2's body low for risky traders.
9. Back testing suggests that body low will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
Downside/Red signal
1. Say candle 1 is Red, which means sellers stepped in, then candle 2 is Green or a Doji, that means buyers took the price up. Then if candle 3 is forming to be Red and breaks the closing of the 1st candle and opening of the 2nd candle then a Red arrow will appear and that is the place where you want to take your trade.
2. Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
3. We need to enter the trade as soon as the price moves below the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close.
4. But for a more optimised entry I have added an option to use candle’s highs and lows instead of open and close. This reduces lot of noise and provides us with more precise entry. This setting is turned on by default.
5. I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
6. I call it the -+- or RGR pattern or Red-Green-Red or Seller-Buyer-Seller or Buyer defeated or just Seller pattern.
7. Stop loss can be candle 2's mid for safe traders ( that includes me) or candle 2's body high for risky traders.
8. Back testing suggests that body high will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
Important Settings
1. Include 4th Candle Confirmation - You can enable or disable the 4th candle signal to avoid the noise, but at times I have noticed that the 4th candle gives a very strong signal or I can say that the strong signal falls on the 4th candle. This is mostly a coincidence.
2. Bars to check (default 10) - You can also configure how many previous bars should the signal be generated for. 10 to 30 is good enough. To backtest increase it to 2000 or 5000 for example.
3. Use Candle High/Low for confirmation instead of Candle Open/Close - More optimized entry and noise reduction. This option is now defaulted to true.
4. Show Green-Red-Green (bull) signals - Show only bull entries. Useful when I have a predefined view i.e, I know market is going to go up today.
5. Show Red-Green-Red (bear) signals - Show only bear entries. Useful when I have a predefined view i.e, I know market is going to go down today.
Pointers
1. If after taking the trade, the next candle moves in your direction and closes strong bullish or bearish, then move SL to break even and after that you can trail it.
2. If a upside trade hits SL and immediately a down side trade signal is generated on the next candle then take it. Vice versa is true.
3. Trades need to be taken on previous 2 candle's body high or low combined and not the wicks.
4. The most losses a trader takes is on a sideways day and because in our strategy the stop loss is so small that even on a sideways day we'll get out with a little profit or worst break even.
5. Hold trades for longer targets and don't panic.
6. If last 3-4 days have been sideways then there is a good probability that today will be trending so we can hold our trade for longer targets. Target to hold the trade for whole day and not exit till the day closes.
7. In general avoid trading in the middle of the day for index and stocks. Divide the day into 3 parts and avoid the middle.
8. Use Support/Resistance, 10, 20, 50, 200 EMA/SMA, Gaps, Whole/Round numbers(very imp) for identifying targets.
9. Trail your SL.
10. For indexes I would use 5 min and 15 min timeframe.
11. For commodities and crypto we can use higher timeframe as well. Look for signals during volatile time durations and avoid trading the whole day. Signal usually gives good targets on those times.
12. If a GRG or RGR pattern appears on a daily timeframe then this is our time to go big.
13. Minimum Risk to Reward should be 1:2 and for longer targets can be 1:4 to 1:10.
14. Trade with small lot size. Money management will happen automatically.
15. With small lot size and correct Risk-Re ward we can be very profitable. Don't trade with big lot size.
16. Stay in the market for longer and collect points not money.
17. Very imp - Watch market and learn to generate a market view.
18. Very imp - Only 4 candles are needed in trading - strong bullish, strong bearish, hammer, inverse hammer and doji.
19. Go big on bearish days for option traders. Puts are better bought and Calls are better sold.
20. Cluster of green signals can lead to bigger move on the upside and vice versa for red signals.
21. Most of this is what I learned from successful traders (from the top 2%) only the indicator is mine.
Catatan Rilis
Updates1. New setting added - "3rd candle should be a Strong candle before considering 4th candle" - This will enforce additional logic in 4 candle setup that the 3rd candle is the candle in our direction of breakout. This means something like GRGG is mandatory, which is still the default behaviour. If disabled, the 3rd candle can be any candle and 4th candle will act as our breakout candle. This behaviour has led to breakouts and breakdowns as times, hence I added this as a separate feature. Vice-versa for a RGGR.
For a 4 candle setup till now we were expecting GRGG or RGRR but we can let the system ignore the 3rd candle completely if needed.
This will result in additional signals.
2. Usage of high/low instead of open/close is now disabled by default.
3. Three intraday ranges added for index and stock traders - 1 min, 5 min and 15 min ranges will be displayed. These are disabled by default except 15 min. These are very important ranges and in sideways days the price will usually move within the 15 min. A breakout of this range and a positive signal can be a very powerful setup.
Safe traders can avoid taking a trade in this range as it can lead to fakeouts,
The line style, width, color and opacity are configurable.
Catatan Rilis
1. 1 Hr intraday range added 2. Optimisation added where breakout/breakdown should not happen with a Doji candle.
3. Code optimised. It is faster and avoids unnecessary calculations. It is more clean and readable.
Catatan Rilis
Intraday Range issue fixed for XAUUSD, USOIL and similar scripts.Intraday Ranges are not visible on Daily, Weekly, Monthly timeframe.
Minor config changes and code refactoring.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.