London session entries
Forge API 1Updated 1 Oct 2026
Strategy
The filter names its hours and its time zone. mode="entries" blocks new entries outside the window and leaves exits alone, so a position opened inside the window can still close after it.
london_session_entries.pypythonOpen in the editor
import forge as fg
from forge import param, ta
FORGE_API = 1
class LondonSessionEntries(fg.Strategy):
bars = fg.bars.Time("H1")
direction = "long"
period = param.Int(50, min=10, max=200, step=10)
def compute(self, d) -> fg.Signals:
average = ta.sma(d.close, self.period)
return fg.Signals(
long_entry=ta.crossover(d.close, average),
long_exit=d.close < average,
filters=[
fg.Filter.session(
windows="07:00-17:00", tz="Europe/London", mode="entries"
)
],
)Test in Forge ↗
Opens oathra.app.
Was this page helpful?