Tokyo open gap
Tokyo open gap is an alert that checks every 1 minute and can fire every time its condition is met.
state
alert "Tokyo open gap"check: every 1mrepeat: every timestate tokyo_open_price: price = naon session open "tokyo":tokyo_open_price = opennotify "Tokyo session opened at {open:0.000} on {market.symbol}"when tokyo_open_price > 0 and abs(close - tokyo_open_price) > atr(14) * 3:notify "Price moved more than 3 ATR from the Tokyo open"Sample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.
Replay of this script on 150 sample bars: 10 alerts sent.
Tokyo open gap is an alert that checks every 1 minute and can fire every time its condition is met.
It remembers tokyo_open_price from one bar to the next.
When the Tokyo session opens, it sets tokyo_open_price to the open and sends the notification "Tokyo session opened at {open:0.000} on {market.symbol}".
When tokyo_open_price is above 0 and the absolute value of the close minus tokyo_open_price is above 3 × the 14-bar ATR, it sends the notification "Price moved more than 3 ATR from the Tokyo open".