ICTKillzones - Insurance

stable
By Rob in Insurances Published February 2026 👁 164 views 💬 0 comments

Description

This is a quick Insurance command which willl limit bots entries to ICT killzone hours. While keeping exits always active. The logic behind this is that as crypto is heavily manipulated by liquidity, 10/10 events seldom happen inside peak trading hours. The same is applicable to weekends which are generally low-liquidity. This insurance, which can be used in Visual Studio, makes it easy to backtest and deploy strategies that should only be run during periods of high volume in order to avoid unnecessary losses in low liq periods.
HaasScript
DefineCommand("ICTKillzones", "Returns true when price is inside an active ICT killzone. Use as an Insurance to restrict new entries.")
  -- Toggle individual killzones via input params
  local useAsian       = DefineParameter(BooleanType, "Asian KZ",        "Asian Killzone 00:00-03:00 UTC",       false, true)
  local useLondon      = DefineParameter(BooleanType, "London KZ",       "London Killzone 07:00-10:00 UTC",      false, true)
  local useNewYork     = DefineParameter(BooleanType, "New York KZ",     "New York AM Killzone 12:00-15:00 UTC", false, true)
  local useLondonClose = DefineParameter(BooleanType, "London Close KZ", "London Close KZ 15:00-17:00 UTC",     false, false)
  local allowWeekends  = DefineParameter(BooleanType, "Allow Weekends",  "Allow trading on weekends (Sat/Sun)",  false, false)
  local hour   = CurrentHour()
  local minute = CurrentMinute()
  local t      = hour * 60 + minute  -- minutes since midnight UTC
  local day    = CurrentDay()         -- 1=Sunday, 2=Monday, ..., 7=Saturday (UTC-based)
  local isWeekend = (day == 1 or day == 7)
  local inKillzone = false
  -- Only check killzones if weekends are allowed or it's not a weekend
  if allowWeekends or not isWeekend then
    -- Asian  00:0003:00 UTC  (0180 min)
    if useAsian and t >= 0 and t < 180 then inKillzone = true end
    -- London  07:0010:00 UTC  (420600 min)
    if useLondon and t >= 420 and t < 600 then inKillzone = true end
    -- New York  12:0015:00 UTC  (720900 min)
    if useNewYork and t >= 720 and t < 900 then inKillzone = true end
    -- London Close  15:0017:00 UTC  (9001020 min)
    if useLondonClose and t >= 900 and t < 1020 then inKillzone = true end
  end
  DefineOutput(BooleanType, inKillzone, "True when inside an active ICT killzone")

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!