Professional Documents
Culture Documents
Time Range Breakout Indicator
Time Range Breakout Indicator
0
at https://mozilla.org/MPL/2.0/
// © sumeetchothe
//@version=5
strategy("Time Range Breakout Indicator", overlay = true)
buy = high[1] < fHigh and high[2] < fHigh and high[3] < fHigh
and low[1] > fLow and low[2] > fLow and low[3] > fLow
and ta.crossover(close, fHigh)
short =high[1] < fHigh and high[2] < fHigh and high[3] < fHigh
and low[1] > fLow and low[2] > fLow and low[3] > fLow
and ta.crossunder(close, fLow)
if short
strategy.entry("short", strategy.short, comment = "SHORT")
fLow := na
if tradeout
strategy.close("long", when = sell, comment = "L_exit")
strategy.close("short", when = cover, comment = "S_Exit")
fHigh := na
fLow := na