TOS script for London & Asian sessions
I had ChatpGPT write a script for me so I can quickly see the London and Asian sessions in ThinkorSwim. It works as is with whatever timezone you have TOS set to. It's helpful to me, so I just thought I'd share. Here you go! (I also included a screenshot of the study I use to auto-draw the daily high/low. # Session Highlighter (ET): Asian & London (very faint colors) # - Asian: 6:00pm ET → 3:00am ET # - London: 3:00am ET → 12:00pm ET input showAsian = yes; input showLondon = yes; # Ultra-light pastel fills DefineGlobalColor("AsianFill", CreateColor(245,235,255)); # ultra-light lavender DefineGlobalColor("LondonFill", CreateColor(230,245,255)); # ultra-light blue def intraday = GetAggregationPeriod() < AggregationPeriod.DAY; # Asian session: 18:00 → 03:00 (spans midnight) def inAsian = intraday and (SecondsFromTime(1800) >= 0 or SecondsTillTime(0300) > 0); # London session: 03:00 → 12:00 (no midnight span) def inLondon = intraday and (SecondsFromTime(0300) >= 0 and SecondsTillTime(1200) > 0); plot aTop = if showAsian and inAsian then Double.POSITIVE_INFINITY else Double.NaN; plot aBot = if showAsian and inAsian then Double.NEGATIVE_INFINITY else Double.NaN; plot lTop = if showLondon and inLondon then Double.POSITIVE_INFINITY else Double.NaN; plot lBot = if showLondon and inLondon then Double.NEGATIVE_INFINITY else Double.NaN; aTop.SetDefaultColor(GlobalColor("AsianFill")); aBot.SetDefaultColor(GlobalColor("AsianFill")); lTop.SetDefaultColor(GlobalColor("LondonFill")); lBot.SetDefaultColor(GlobalColor("LondonFill")); aTop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); aBot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); lTop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); lBot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); AddCloud(aTop, aBot, GlobalColor("AsianFill"), GlobalColor("AsianFill")); AddCloud(lTop, lBot, GlobalColor("LondonFill"), GlobalColor("LondonFill"));