DislikedOk FINALLY here it is my multi-timeframe S/R Zone Indicator !
Attachment
How it works
- S/R levels are calculated using Fractals - you can define how many bars are required to make up a fractal via the input parameters FractalBars. Fractals are calculated in 4 timeframes, 15 Min, 60 Min, 240 Min and 1 Day. If the chart is running on a timeframe higher than one or more of the Fractal timeframes, Fractals are not calculated on the chart for that Fractal timeframe, e.g. if you are running the chart on a 1 Hour timeframe then 15 Min Fractals are not calculated.
- Once the S/R levels are calculated separate support and resistance counters are maintained for the level (as a Fractal can be both Support and Resistance).
- The support counter for a Fractal is updated by the value you enter in the Battered input parameter each time it is touched from above and updated by the amount you enter in the Breached parameter each time is it crossed from above. NOTE a Breach occurs when a bar in the chart timeframe crosses the support level.
- Similarly, The Resistance counter for a Fractal is updated by the value you enter in the Battered input parameter each time it is touched from below and updated by the amount you enter in the Breached parameter each time is it crossed from below.
- Once a Support counter reaches the input parameter value BBLimit the Fractal levels ceases to be a valid Support level, similarly once a Resistance counter reaches BBLimit is ceases to be a valid Resistance level. This allows you define how S/R levels breakdown as they are breached and battered over time - as BRV originally said the more a level is hit the less likely it is to hold in the future.
- Often you may have a number of S/R levels from different timeframes clustered together, the input parameter ClusterWidth allows you to define what is 'close', so if you feel 10 pips is close enough to be considered in the same zone set the ClusterWidth and the fractal levels will be grouped together into a single S/R zone.
What is Drawn
On start up, the expert advisor looks back for all previous fractals in the 4 timeframes and calculates the S/R levels, these are shown on the chart. Blue is support, Red is Resistance. Only the immediate Support/Resistance each side of the opening price of a bar are shown since these are of most interest during the life of the bar.
On the first tick of a new bar in the chart timeframe, current S/R levels are updated where they have been Battered and or Breached and they may no longer valid (if the BBLimit has been reached). Then the next S/R levels either side of the opening price of the bar are drawn. This gives you the local S/R levels (zones) in real-time. When you see a big block or Red or Blue this is a zone made up of a number of S/R levels.
The last input parameter DrawFractalLines allows you to draw the underlying S/R levels that are being used to calculated the S/R zones. It can be useful to see them all - certainly as you get used to the look and feel of things.
To Install
Put the code in the Expert Advisor directory and then drag it onto your chart from the navigation area. It takes a minute or two to start up as it has to do a lot of calculation when it starts up ...
All feedback appreciated ... especially that regarding the best parameters to use for given pairs. I am going off to play with an AutoTrader now!
Best
Paul
p.s I have also written anauto trader based on this and it has made over 100 pips today!
AttachmentIgnored
Will let you know how I get on.