I am looking to have a custom indicator created that marks my customizable orderblock/FVG zones on the chart and can then detect price re-enters and exits the unmitigated portion of this zone and will change color to show this. After a portion of the zone is mitigated or filled, the zone is redrawn to only the unmitigated zone. Zones are also no longer projected further along the chart after price passed through the orderblock or fills the entire FVG. A binary on/off indicator signal on a bottom window is also generated whenever price enters a fvg/orderblock zone and the signal is deactivated when price definitively exits the zone on a lower time frame.
The attached files show illustrations to all of the point below. There is also a word document and pdf file that are identical and will be used for the specification of this order
This indicator should be made separately from the EA. Eventually I will try to upload this indicator into StrategyQuantX as a java snippet. If you have experience with this and are interested in that work or have advice on it please mention it.
This indicator should then be combined with an EA that enters a position based upon lower timeframe price action signals such as reversal candlesticks and rsi divergence that occur within the fvg/orderblock zone.
The fair value gap and orderblock concepts are common price action concepts that can be found in many trading communities. This specification document will not explain these concepts as they are easily found on the internet.
The indicator should do the following:
Step 1 Zone Specification and Drawing
1. The indicator should work for both bullish and bearish orderblock/fvg zones. There should be two parameters to select only bullish zones or only bearish zones or both.
2. The indicator should be able to differentiate between the FVG zone that we expect to be filled and the orderblock zone as well as join them for display of the zone on the chart.
3. The indicator should create a separate zone for each Orderblock/FVG. Fair value gaps can only be joined into a single zone if they do not have an opposite closing orderblock candle within the range of bars set by the "orderblock bars back" parameter and they are in consecutive order.
***3B. A zone should only be drawn when a FVG is confirmed by a candle close. In the event of consecutive FVG candle closes the zone should be redrawn to account for the new fvg as it is confirmed. As FVG's are conventionally specified as a 3 bar pattern where the first bar has no gap, the second bar contains the gap and the third bar confirms the FVG on its close as it does not overlap with the range of the first bar in the pattern at all. When a fvg/orderblock zone is redrawn the old fvg/orderblock zone is deleted so that there are never any overlapping fvg/orderblock zones on the chart.
4. Only draw zones for fair value gaps that are equal to or greater than the % the bar range specified by the "minimum FVG %" parameter.
5. Have the zone be customizable by a variable parameter or how deep a percentage of retracement into the FVG where the zone will begin. Always start the zone at the % retracement into the FVG specified by the parameter known as "FVG Retracement %", even if the start of the orderblock is at a lower retracement percentage.
6. Group price gaps into the FVG/orderblock zone. Include the price gap in the FVG zone that when filled/mitigated leads to eventual deactivation and end of projection of the zone.
7. Have the zone customizable by a variable parameter know as "orderblock bars back" of how many bars to look back behind the FVG and group into the orderblock. The end of this zone should be marked at the tip of the orderblock group. For bullish zones this would be the low of the lowest red candle in the amount of bars behind the FVG specified by the "orderblock bars back" parameter.
***7B. When the "Use Swing Hi/Lo" Parameter is set to true the end of the zone will be set to the swing high or low that is within the range of bars specified by the "Oderblock bars back parameter". For bullish examples this may not be the low of a red candle but instead a green candle, like shown in the illustration.
8. If there is no orderblock to the left of a FVG within the amount of bars specified by the "orderblock bars back" threshold and the "use swing hi/low" parameter is set to false, mark only the zone starting at the "FVG retracement %" parameter to the end (low or high) of the bar that contains the FVG. If two or more FVG's are joined without an orderblock within the range of the "orderblock bars back" parameter, the end of the low of the zone should be the low of the lowest candle in the chain of FVG candles for bullish examples and the opposite for bearish. If the "Use swing high/low" parameter is set to true then we use the lowest low of the lowest candle within the range of the "orderblock bars back" parameter for bullish examples as normal.
9. Have the zone be customizable by a variable parameter of how many bars this zone stays on the chart. This parameter will be known as "zone is valid for bars"
10. Draw the orderblock/FVG zone on the chart that projects into current prices. All the way over to the righthand edge of the chart.
Step 2 Lower time frame binary signal generation to be known as "Inside POI Zone"
11.Calculate zones based on the close of every bar of the lower time frame specified in the parameter to be known as "lower timeframe signal".
12.Detect when any portion of the current price bar of the timeframe specified by the parameter to be known as "lower timeframe signal" enters or is currently inside of a fvg/orderblock zone.
13. This will cause that specific zone to change color and for the indicator to generate a signal to be known as "Inside POI Zone"
14. The zone resting color and color that it will change to upon price's entry into the zone will be parameters to be known as "zone color" and "zone color change" respectively. These colors will be selectable through these parameters.
15. After an amount of bars specified by the parameter "bars on zone exit" has their bar range after close of the bars completely exit the fvg/orderblock zone, the fvg/orderblock zone will be reduced to it's unmitigated/unfilled portion and change color back to it's original state, if they is no fvg left to fill then the zone will stop being projected into the right hand edge of the chart. This will also deactivate the indicator signal to be known as "Inside POI Zone".
16. Old or deactivated zones with no FVG left to fill or mitigate will remain on the chart for as long as the parameter to be known as "zone is valid for bars" specifies.
17. The indicator signal to be named "Inside POI Zone" can be displayed in a bottom window of the chart as a binary signal where the top of the window is marked as 1 and the bottom is marked as 0. A horizontal line inside this window will move back and forth between the bottom and top of the window whenever the indicator signal is active or not. Note that for the purposes of this binary indicator signal the terms "active, 1, on, engaged, and true" are synonymous and mean the same thing just as the terms " inactive, deactivated, 0, off, disengaged, and false" are synonymous and mean the same thing.
Step 3 Zone reduction and deactivation
18. After price exits a zone completely for the amount of bars specified by the parameter to be known as "bars on zone exit" on the time frame specified by the parameter to be known as "lower timeframe signal" the zone that price left will then be reduced by the amount that price traveled into and filled/mitigated the FVG of the fvg/orderblock zone. The zone will also change back to it's original color before an indicator signal was generated.
19. If there is no amount of FVG in the fvg/orderblock zone left to fill/mitigate then the zone should be stop being projected to the right edge of the chart and that fvg/orderblock zone can no longer generate the indicator signal. Other fvg/orderblock zones on the chart will still maintain the ability to generate the indicator signal.
20. If at any time price crosses completely through a fvg/orderblock zone. That zone should be deactivated and stop being projected to the right edge of the chart and not be able to generate indicator signals. As previusly specified the end of the fvg/orderblock zone is determined by the "orderblock bars back" parameter and the "use swing high/low" parameter.
Indicator Parameters explained.
1.Bars behind FVG to group into orderblock. We should call this "Orderblock bars back"
2. Use swing low/high instead of orderblock. This sets the end of the zone to the swing high or low instead of the orderblock. Occasionally the swing high/low is further than the edge of the orderblock, so this can be useful to extend the zone a bit further. This will still be within the range of bars specified the "orderblock bars back" parameter.
3. % retracement into FVG to start zone. 0-100%. We should call this "FVG Retracement %"
4. Bars that the Zone stays valid for and remains on the chart. We can call this "Zone is valid for bars"
5. Lower timeframe to use for triggering the signal condition. When a bar of this specified timeframe has any portion of it inside the zone. for example 5M candles inside of 1H orderblock/FVG zone. We can call this "Lower time frame bar signal".
6. Zone color. We can call this "zone color" this determines what color the fvg/orderblock zones are in their original resting state.
7. Zone color change. We can call this "zone color change". When price is printing bars on the selectable lower time frame with any portion of their range inside the zone and the "bars on zone exit" parameter has not been satisfied. The fvg/orderblock zone should change color to this selectable color.
8. Bars on Zone Exit. Named as "Bars on Zone Exit" Determines how many bars need to close with their entire bar range outside of the zone for it to change color back to the original condition and color selected in the parameter "Zone color" and then redraw or deactivate the fvg/orderblock zone.
9.Minimum FVG %. Named as "minimum fvg %". The minimum FVG size as a percentage of the bar range that is required in order to draw a zone. Too small a FVG and it should not be valid and not draw the fvg/orderblock zone.
10. Mark Bearish Zones. A true or false selector that when true the indicator will mark and generate signals for bearish fvg/orderblock zones.
11. Mark Bullish Zones. a true or false selector that when true the indicator will mark and generate signals for bullish orderblock zones.
Indicator Parameter List
1. Orderblock Bars Back - number
2. Use Swing Hi/Lo - true or false
3. FVG Retracement % - % expressed as a number 0-100
4. Zone is Valid for Bars - number
5. Lower Timeframe Bar Signal - Slide down bar with selection of the range of time frames used in MT5 from 1 Minute to 4 Hour.
6.Zone Color - Selection of colors
7. Zone Color Change - Selection of colors.
8. Bars on Zone Exit - number
9. Minimum FVG % - % expressed as a number 0-100
10. Mark Bearish Zones - true or false
11. Mark Bullish Zones - true or false
Expert Advisor
21. The Expert Advisor will contain all the same parameters as the indicator but also have additional parameters and functions to facilitate a lower timeframe entry when inside a fvg/orderblock zone. The lower timeframe entry signal will occur on the timeframe designated by the "Lower Timeframe Bar Signal" Parameter.
The primary entry signals will be 4 different bullish candlestick patterns and 4 mirroring bearish candlestick patterns and they are:
Inverted Hammer
Inverted Shooting Star - Bearish version - opposite to Inverted Hammer
Bullish Engulf
Bearish Engulf
Hammer Break
Shooting Star Break - Bearish Version of Hammer Break
Star Engulf
Hammer Engulf: Bearish Version of Star Engulf
22. Each of these candlestick patterns will have an associated paramater that determines whether to use the pattern as an entry signal or not. Note that only Bullish Candlestick Patterns can be used as entry signals in bullish FVG/orderblock zones and only bearish candlestick patterns can be used in bearish fvg/orderblock zones.
The parameters will be as shown below:
Use Inverted Hammer - True or False
Use Inverted Shooting Star - True or False
Use Bullish Engulf - True or False
Use Bearish Engulf - True or False
Use Hammer Break - True or False
Use Shooting Star Break - True or False
Use Shooting Star Engulf - True or False
Use Hammer Engulf - True or False
23. In addtion there will also be several more parameters that are used to require the Expert Advisor to wait for additional confirmation before entering a trade, and they are:
Second Reversal Candle Required - True or False
Third Reversal Candle Required - True or False
Consecutive Reversal Candle Must be Deeper - True or False
Bullish Divergence Required - True or False
Bearish Divergence Required- True or False
RSI Period - Number - Default 14 - Step 1
Swing Low Stop Loss - True or False
Stop Loss Additional Gap - Number in Pips - Default 0 Step 1
Take Profit 1 % - Number default 100 step 1
Take Profit 1 RR - Number default 1 step 0.1
Take Profit 1 ATR - Number default 1 step 0.1
Move Stop loss to BE after TP1 - True or False
Take Profit 2 % - Number default 100 step 1
Take Profit 2 RR - Number default 1 step 0.1
Take Profit 2 ATR - Number default 1 step 0.1
Take Profit ATR Period - Number default 14 step 1
Take Profit 2 Traiing Stop - Please design decent trailing stop parameters.
24. Second and third reversal candle required explanation:
When these parameters are set to true it will require that the EA wait for a second or third reversal candle pattern before entering a trade. These additional reversal candles must still occur while the "bars on zone exit" parameter has not been satisfied. So price is still either inside of a fvg/orderblock zone or is just exiting as the parameter will rarely be set to more than 3, otherwise price will be too far from the fvg/orderblock zone that we are treating as our point of interest for entry.
This parameter does not reset upon partial mitigation and redrawing of a fvg/orderblock zone. For example if it is required to wait for 2 reversal candles in a fvg/orderblock zone before entering a trade and after the first reversal candle it bounces out of the fvg/orderblock zone and it is partially mitigated and redrawn, when price enters this same zone again it will only require one reversal candle to enter a trade and not two reversal candles.
25. Consecutive reversal candle must be deeper explanation:
When this paramater is set to true it will require that the EA wait for a second or third reversal candle signal that is further into the fvg/orderblock zone than the previous one. This will be measured by the low of each reversal candle for bullish setups and the high for bearish setups.
26. Bullish/Bearish Divergence required explanation:
When this parameter is set to true it will require that the EA wait for RSI divergence to occur inside of the fvg/orderblock zone before entering a trade. RSI divergence is a common trading pattern where for a bullish example price makes a lower low while the RSI indicator does not, which in theory indicates a slowing of momentum and a possible impending reversal.
27. RSI period explained:
This is of course the parameter that changes what period to use for the RSI indicator.
28. Swing Low Stop Loss explanation:
When this parameter is set to true and the EA enters a trade it will set its stop loss at the absolute swing low inside the range of candles specified by the "ordeblock bars back" parameter. This level at certain times can be different than the orderblock like in the illustration for this point.
29. Stop loss addition gap explanation:
This parameter adds on additional distance in pips to the stop loss whether it is at the orderblock or swing low.
30. Take profit parameters explained:
RR will be risk reward so it will be a multiple of the stop loss distance, if the stop loss is 80 pips and The "take profit 1 RR" parameter is 1 then the take profit will also be 80 pips or if the "take profit parameter 1 RR" is 2 then the take profit will be 160 pips.
If the "Take profit ATR" parameter is not 0 then it will override the "Take Profit RR" parameter.
A trailing stop loss for TP2 and break even after take profit 1 should be added as well.