Tokyo open gap
Tokyo open gap is an alert that checks every 1 minute and can fire every time its condition is met.
state
1
alert "Tokyo open gap"2
check: every 1m3
repeat: every time4
5
state tokyo_open_price: price = na6
7
on session open "tokyo":8
tokyo_open_price = open9
notify "Tokyo session opened at {open:0.000} on {market.symbol}"10
11
when tokyo_open_price > 0 and abs(close - tokyo_open_price) > atr(14) * 3:12
notify "Price moved more than 3 ATR from the Tokyo open"What this script says
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".