Mode 1: Level = (low of 1 day prior to + high of 1 day after ) / 2.0
Mode 2: Level = ( hl2 of 1 day prior to + hl2 of 1 day after + close from day) / 3.0
Chart above shows "Mode 1". Mode can be changed via options page.
This indicator was requested by user @mika2k1ff. I learnt more about this idea from @DanV and @TimWest (Thanks guys :)). BTW, TimWest has an indicators package, "Key Hidden Levels", that has this and more.
Do let me know how you use this, I am very intrigued by the potential this idea shows. Thanks.
For a complete list of my indicators:
- GDoc: https://docs.google.com/document/d/15AGC...
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
// // @author LazyBear // List of all my indicators: https://www.tradingview.com/v/4IneGo8h/ // study("Earnings S/R Levels [LazyBear]", shorttitle="ELVLS_LB", overlay=true) mode=input(1, "S/R mode", minval=1, maxval=2) earnings = security("ESD:"+ticker+"_EARNINGS", "D", close, true) ehl2_mode1=(nz(earnings) ? avg(low,high) : nz(ehl2_mode1)) // AVG2(low of 1 day pri, high of 1 day after) ehl2_mode2=(nz(earnings) ? (hl2+hl2+close)/3 : nz(ehl2_mode2)) // AVG3(HL2 of 1 day pri, HL2 of 1 day after, close of earnings day) ehl2=mode==1?ehl2_mode1:mode==2?ehl2_mode2:ehl2_mode1 // default: mode1 plot(ehl2, linewidth=2, style=circles)