OPEN-SOURCE SCRIPT
GRG/RGR Signal, MA, Ranges and Pivots

This indicator is a combination of several indicators.
It is a combination of two of my indicators which I solely use for trading
1. EMA 10-20-50-200, Pivots and Previous Day/Week/Month range
2. 3/4-Bar GRG / RGR Pattern (Conditional 4th Candle)
You can use them individually if you already have some of them or just use this one. Belive me when I say, this is all you need, along with market structure knowlege and even if you don’t have that, this indicator has been doing wonders for me. This is all I use. I do not use anything else.
**Note - Do checkout the indicators individually as I have added valuable information in the comment section.
It contains the following,
1. 10 EMA/SMA - configurable
2. 20 EMA/SMA - configurable
3. 50 EMA/SMA - configurable
4. 200 EMA/SMA - configurable
5. Previous Day's Range
6. Previous Week's Range
7. Previous Month's Range
8. Pivots
9. Buy Sell Signal
The Moving Averages
It is a very important combination and using it correctly with price action will strengthen your entries and exits.
The ema's or sma's added are the most powerful ones and they do definitely act as support and resistance.
The Daily/Weekly/Monthly Ranges
The Daily/Weekly/Monthly ranges are extremely important for any trader and should be used for targets and reversals.
Pivots
Pivots can provide support and resistance level. R5 and S5 can be used to check for over stretched conditions. You can customise them however you like. It is a full pivot indicator.
It is defaulted to show R5 and S5 only to reduce noise in the chart but it can be customised.
The 3/4 RGR or GRG Signal Generator
Combined with a 3/4 RGR or GRG setup can be all a trader needs.
You don't need complex strategies and SMC concepts to trade. Simple EMAs, ranges and RGR/GRG setup is the most winning combination.
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 false.
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.
6. 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.
7. 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.
Pointers/Golden Rules
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. Inverse is true when the market has been trending for 2-3 days then volatility followed by sideways is coming (DOW theory). 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 and at times 10 mins.
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-Reward 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 3 type of candles are needed in trading -
Strong Bullish (Big Green candle), Strong Bearish (Big Red candle),
Hammer (it is Strong Bullish), Inverse Hammer (it is Strong Bearish)
and Doji (indecision or confusion).
If on daily timeframe I see Strong Bullish candle previous day then I am biased to the upside the next day, if I see Strong Bearish candle the previous day then I am biased to the downside the next day, if I see Doji on the previous day then I am cautious the next day, if there are back to back Dojis forming in daily or weekly then I am preparing for big move so time to go big once I get the signal.
19. Most Important Candlestick pattern - Bullish and Bearish Engulfing
20. The only Chart patterns I need -
a) Falling Wedge Bullish Pattern Uptrend or Bull Flag - Buying - Forming over a couple days for intraday and forming over a couple of weeks for swing
b) Falling Wedge Bullish Pattern Downtrend or Falling Channel - Buying
c) Rising Wedge Bearish Pattern Uptrend or Rising Channel - Selling
d) Rising Wedge Bearish Pattern Downtrend or Bear flag - Selling
e) M and W pattern - Reversal Patterns - They form within the above 4 patterns, usually resulting in the break of trend line
21. How Gaps work -
a) Small Gap up in Uptrend - Market can fill the gap and reverse. The perception is that people are buying. If previous day candle was Strong Bullish then market view is up.
b) Big Gap up in Uptrend - Not news driven - Profit booking will come but may not fill the entire gap
c) Big Gap up in Uptrend - News driven, war related, tax, interest rate - Market can keep going up without stopping.
c) Flat opening in Uptrend - Big chance of market going up. If previous day candle was Strong Bullish then view is upwards, if it was Doji then still upwards.
d) Gap down in Uptrend - Market is surprised. After going down initially it can go up
e) Small Gap down in Downtrend - Market can fill the gap and keep moving down. If previous day candle was Strong Bearish then view is still down.
f) Flat opening in Downtrend - View is down, short today.
g) Big Gap down in Downtrend - Profit booking and foolish buying will come but market view is still down.
h) Gap down with News - Volatility, sideways then down.
22. Go big on bearish days for option traders. Puts are better bought and Calls are better sold.
23. Cluster of green signals can lead to bigger move on the upside and vice versa for red signals.
24. Most of this is what I learned from successful traders (from the top 2%) only the indicator is mine.
It is a combination of two of my indicators which I solely use for trading
1. EMA 10-20-50-200, Pivots and Previous Day/Week/Month range
2. 3/4-Bar GRG / RGR Pattern (Conditional 4th Candle)
You can use them individually if you already have some of them or just use this one. Belive me when I say, this is all you need, along with market structure knowlege and even if you don’t have that, this indicator has been doing wonders for me. This is all I use. I do not use anything else.
**Note - Do checkout the indicators individually as I have added valuable information in the comment section.
It contains the following,
1. 10 EMA/SMA - configurable
2. 20 EMA/SMA - configurable
3. 50 EMA/SMA - configurable
4. 200 EMA/SMA - configurable
5. Previous Day's Range
6. Previous Week's Range
7. Previous Month's Range
8. Pivots
9. Buy Sell Signal
The Moving Averages
It is a very important combination and using it correctly with price action will strengthen your entries and exits.
The ema's or sma's added are the most powerful ones and they do definitely act as support and resistance.
The Daily/Weekly/Monthly Ranges
The Daily/Weekly/Monthly ranges are extremely important for any trader and should be used for targets and reversals.
Pivots
Pivots can provide support and resistance level. R5 and S5 can be used to check for over stretched conditions. You can customise them however you like. It is a full pivot indicator.
It is defaulted to show R5 and S5 only to reduce noise in the chart but it can be customised.
The 3/4 RGR or GRG Signal Generator
Combined with a 3/4 RGR or GRG setup can be all a trader needs.
You don't need complex strategies and SMC concepts to trade. Simple EMAs, ranges and RGR/GRG setup is the most winning combination.
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 false.
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.
6. 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.
7. 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.
Pointers/Golden Rules
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. Inverse is true when the market has been trending for 2-3 days then volatility followed by sideways is coming (DOW theory). 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 and at times 10 mins.
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-Reward 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 3 type of candles are needed in trading -
Strong Bullish (Big Green candle), Strong Bearish (Big Red candle),
Hammer (it is Strong Bullish), Inverse Hammer (it is Strong Bearish)
and Doji (indecision or confusion).
If on daily timeframe I see Strong Bullish candle previous day then I am biased to the upside the next day, if I see Strong Bearish candle the previous day then I am biased to the downside the next day, if I see Doji on the previous day then I am cautious the next day, if there are back to back Dojis forming in daily or weekly then I am preparing for big move so time to go big once I get the signal.
19. Most Important Candlestick pattern - Bullish and Bearish Engulfing
20. The only Chart patterns I need -
a) Falling Wedge Bullish Pattern Uptrend or Bull Flag - Buying - Forming over a couple days for intraday and forming over a couple of weeks for swing
b) Falling Wedge Bullish Pattern Downtrend or Falling Channel - Buying
c) Rising Wedge Bearish Pattern Uptrend or Rising Channel - Selling
d) Rising Wedge Bearish Pattern Downtrend or Bear flag - Selling
e) M and W pattern - Reversal Patterns - They form within the above 4 patterns, usually resulting in the break of trend line
21. How Gaps work -
a) Small Gap up in Uptrend - Market can fill the gap and reverse. The perception is that people are buying. If previous day candle was Strong Bullish then market view is up.
b) Big Gap up in Uptrend - Not news driven - Profit booking will come but may not fill the entire gap
c) Big Gap up in Uptrend - News driven, war related, tax, interest rate - Market can keep going up without stopping.
c) Flat opening in Uptrend - Big chance of market going up. If previous day candle was Strong Bullish then view is upwards, if it was Doji then still upwards.
d) Gap down in Uptrend - Market is surprised. After going down initially it can go up
e) Small Gap down in Downtrend - Market can fill the gap and keep moving down. If previous day candle was Strong Bearish then view is still down.
f) Flat opening in Downtrend - View is down, short today.
g) Big Gap down in Downtrend - Profit booking and foolish buying will come but market view is still down.
h) Gap down with News - Volatility, sideways then down.
22. Go big on bearish days for option traders. Puts are better bought and Calls are better sold.
23. Cluster of green signals can lead to bigger move on the upside and vice versa for red signals.
24. Most of this is what I learned from successful traders (from the top 2%) only the indicator is mine.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.