// Copyright (c) 2019-present
//@version=5
strategy("ARCHENS SHARES", overlay=true)
timeframe = input.timeframe(defval = "30", title = "timeframe")
session = input.session(defval="0945-1015", title = "session")
tradein = time(timeframe, session)
half_high = request.security(syminfo.tickerid, "30", high)
half_low = request.security(syminfo.tickerid, "30", low)
HH = ta.valuewhen(tradein, half_high, 0 )
HL = ta.valuewhen(tradein, half_low, 0 )
buy = ta.crossover(close,HH)
sell = ta.crossunder(close,HL)
// Reset strategy at the start of each day
if dayofweek != dayofweek[1]
buy := false
sell := false
plot(HH, style=plot.style_circles, color = color.orange, linewidth = 2)
plot(HL, style=plot.style_circles, color = color.orange, linewidth = 2)
strategy.entry("long", direction = strategy.long, when = buy, comment = "ARCHENS BUY")
strategy.entry("short", direction = strategy.short, when = sell, comment = "ARCHENS SELL")
Expand (29 lines)