//@version=6 // ============================================================================= // TMU TIME CYCLE LEVELS // Liquidity H/L (sessions + prev day/week/month) + Opening Lines + Opening Gaps // Everything on NY time via "America/New_York" -> summer/winter time (DST) auto. // ----------------------------------------------------------------------------- // A) LIQUIDITY H/L // · Sessions (current trading day, reset 18:00) + Prev Week/Month (mitigation). // · Prev. Day: adjustable number of MOST RECENT highs/lows back in time. // By default only unmitigated; toggle to keep mitigated ones. // · Mitigation: line stops at the mitigation point; label is placed at that // END (high above, low below) so you can see it on long lines. // · Styling: unmitigated = 1 colour + solid, mitigated = 1 colour + dotted. // MERGE + TF-PRIORITY: all levels in 1 pool, grouped by price. // · Same price -> 1 line + merged label; other price -> separate lines. // · Within day/week/month family the HIGHEST TF wins (lower ones dropped). // Sessions + opens always merge in. A group with an opening line keeps // running and takes its style (an open does not mitigate). // B) OPENING LINES — 09:30 . W.O. (Sunday 18:00) . M.O. . C.O. (current 90M). // C) OPENING GAPS — NWOG (Fri-close -> Sun-open, whole week) + NDOG (18:00->18:00). // D) CYCLES — red (manipulation) cycles always keep the red colour; the other // 90M windows are hidden, greyed out (own colour) or drawn in the original // AMD rotation, selectable via "Non-red 90M windows". // ----------------------------------------------------------------------------- // FIXES 2026-08-14 — levels/inputs unchanged, only wrong values corrected // 1 Prev. Day is now a CALENDAR day. The old `dow != sunday` guard blocked the // seal on the Sunday 18:00 bar, so Friday + Sunday evening became one level. // 2 C.O. ran on a SECOND 90M grid anchored at 01:00 that kept ticking overnight // (17:30 / 19:00 / 20:30 / 22:00 / 23:30 / 01:00). Now one raster, cyc90k, // shared with the boxes: 02:30-15:59, empty outside it. // 3 09:30 was captured on window OVERLAP, so on a 1H chart it drew the 09:00 // open. Now the bar-open itself is tested. // 4 WITHDRAWN. I claimed the box trim was a bug ("the last candle hangs // outside its own box"). It is not: with xloc.bar_time a timestamp sits on // the CENTRE of its candle, so the original edges were already centred on // the first and last candle of the cycle, with one candle of air before the // next box. Two attempted fixes made it worse and were both reverted. The // box code is back to its original form - see the note in f_cycleBox. // 5 "ALL red 3.33M" claimed to work on 1-min; 200 s boundaries cannot land on // 60 s bars. Every cycle level is now gated on the grid it actually needs. // 6 EQ lines were never deleted and ate the shared 500-line budget. Capped. // Timings are unchanged and were already right: 90M 02:30-15:59 in 9 cycles // closing on xx:29/xx:59, sessions 18:00-02:29 / 02:30-06:59 / 07:00-11:29 / // 11:30-15:59, LON02 04:00-05:29 . AM02 08:30-09:59 . PM02 13:00-14:29. // ----------------------------------------------------------------------------- // REVISION 2026-08-18 — one real bug (7), the rest is structure. No level // moves, no input is removed, one input is added (12, default = old behaviour). // 7 BUG. The C2 windows (LON02/AM02/PM02) were a SECOND hard-coded 90M raster // (240-329 / 510-599 / 780-869 min) sitting next to cyc90k -- exactly the // duplication fix 2 had just removed for C.O. -- AND they had no alignment // gate. On a 1H chart the 05:00 bar satisfies `mnts <= 329` but runs to // 05:59, so half an hour of London-3 data was folded into the LON02 high/ // low. Same at 09:00 for AM02 and 14:00 for PM02. The windows are now // derived from cyc90k (the red keys 3/6/9) and gated on ali30, like every // other cycle-based level. Consequence, deliberate and silent as elsewhere: // on a TF that is not a divisor of 30 min there are no C2 levels at all. // 8 STRUCTURE. The parallel-array pattern is gone. Eight arrays held together // by comma-chained pushes (the render pool), six for the prev-day history, // five for C2, four for the C2 accumulator and seven for the session state // were one forgotten push away from a silent index shift -- a class of bug // that never shows up in the compiler, only on the chart, and only if you // happen to look. All of it is now four user-defined types: Sess, Lvl, Acc // and PLvl. Same data, same order, same output; one object per level. // 9 The session-state arrays had a dead slot 4 (a leftover from when prev-day // lived in the same array). Week/month are now index 4/5 of a 6-slot array. // 10 key32 and key3all were the same 200-second arithmetic twice with a // different filter. Folded into f_key200(gate, redOnly). // 11 The "single source of truth" claim only held for the 90M raster; the // session/AM1/second-window boundaries were still magic numbers spread over // the file, with the header table as the only place they were written down. // Collected in one constants block, so the code IS the table. // 12 A mitigated liquidity level that merges with an opening line loses every // visual trace of being mitigated: the group keeps running in the open's // style, so "Prev. Day H + 09:30" reads as a live level while the Prev. Day // side is already taken out. That is by design (an open does not mitigate), // but it is worth being able to see. New toggle marks such a member "(m)". // Default OFF = identical to the old label. // REVISION 2026-08-18b — prev day / prev week lows could sit on candles from // the CURRENT trading period (highs too, but overnight sessions set the low // far more often, so you see it on lows first): // 13 The week sealed on weekofyear(). Whether that number flips on Sunday or // on Monday is a TradingView convention; with the Monday convention "prev // week" runs Mon 00:00 - Sun 23:59 NY and swallows the Sunday-evening // session of the NEW trading week -- the week-scale twin of fix 1. After a // Sunday gap-down the Prev. Week L then sat on a candle from THIS week. // wkid also misbehaved around New Year (week 1 vs 53 jump). The week now // seals on the trading-week event itself: the Sunday 18:00 open, the same // bar that captures W.O. Prev week = Sun 18:00 -> Fri 17:00 by // construction, no calendar convention involved. Edge case, accepted: if a // Sunday open is ever missing, that week seals on the next Sunday and // covers two weeks. // 14 Prev. Day definition is now an input. "Calendar" (00:00-23:59, default, // the original spec, unchanged behaviour) includes 18:00-23:59 -- which is // the ASIA OPEN OF THE NEXT TRADING DAY. On Tuesday the "Prev. Day L" can // therefore be Monday-evening's Asia low, i.e. the low of the CURRENT // trading day, merged into one line with "Asia L". Not a code bug, but on // the chart it reads like one. New option "Trading day (18:00-17:00)" // seals on the 18:00 open instead; in that mode the 6-hour Sunday-evening // stub day does not exist (Sun 18:00 opens MONDAY's trading day), so the // "skip Sunday evening" toggle only applies to Calendar mode. // 15 Not a bug, but it read like one: "Show prev. days = 3" means the 3 most // recent UNMITIGATED prev-days, so after a stretch where every recent low // got swept, the render walks back until it finds intact ones -- and a // "Prev. Day L" from 10 days ago shows up with a label that reads as // yesterday. Two additions: the prev-day label can carry the date of the // candle that made the level (default ON), and a max-age input caps how // far back the walk may go (0 = unlimited, the old behaviour). If you want // "always the last N days, swept ones included", that already exists: turn // on "also keep mitigated prev-days". // NOT CHANGED, on purpose -- both are known and now written down instead: // · Session H/L uses time()-windows on the BAR-OPEN, so on a TF that is not // 30-min aligned the boundary candle smears into the neighbouring session // (1H: the 02:00 candle counts as Asia but contains 02:30-03:00). Gating it // on ali30 like the cycles would delete session levels entirely on 45m/1H // and up, which is a bigger loss than a one-candle smear. See f_updSession. // · f_render rebuilds the whole pool on every realtime tick and the merge is // O(n^2). At the input maxima n ~ 116, so ~13k comparisons per tick. Fine // today, but it is the most expensive path in the script -- see the note // above f_render before hanging another level family off the pool. // ============================================================================= indicator("TMU Time Cycle Levels", "TMU Cycles", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 800) tz = "America/New_York" f_style(s) => s == "Dashed" ? line.style_dashed : s == "Dotted" ? line.style_dotted : line.style_solid f_size(s) => s == "Tiny" ? size.tiny : s == "Small" ? size.small : s == "Large" ? size.large : size.normal // --------------------------------------------------------------------------- // TIME CONSTANTS (minutes / seconds since NY midnight) // This block replaces the timings table that used to live only in the header. // Header and code could drift apart; now there is one place. // Asia 18:00-02:29 (wraps midnight -> tested with OR, not AND) // London 02:30-06:59 . NY AM 07:00-11:29 . NY PM 11:30-15:59 // 90M raster + all lower cycles live inside 02:30-15:59. // AM1 = the 07:00-08:29 accumulation window before the NY AM manipulation. // --------------------------------------------------------------------------- M_ASIA_A = 1080 // 18:00 M_ASIA_B = 149 // 02:29 M_LON_A = 150 // 02:30 — also the anchor of the 90M/30M/10M raster M_LON_B = 419 // 06:59 M_AM_A = 420 // 07:00 M_AM_B = 689 // 11:29 M_PM_A = 690 // 11:30 M_PM_B = 959 // 15:59 — also the last minute of the 90M raster M_AM1_A = 420 // 07:00 M_AM1_B = 509 // 08:29 S_CYC_A = 9000 // 02:30:00 in seconds S_CYC_B = 57599 // 15:59:59 in seconds SEC_32 = 200 // one 3.33M cycle TRIM_32 = 190 // last 10 s of a 3.33M cycle -> gap between boxes // --------------------------------------------------------------------------- // TYPES (see fix 8) // Sess = one liquidity source with its own reset rule (4 sessions + week + month) // Lvl = one sealed high or low kept in history (prev-day, C2) // Acc = the running high/low of a C2 window that has not sealed yet // PLvl = one entry in the render pool, before merging // --------------------------------------------------------------------------- type Sess float hp = na int ht = na float lp = na int lt = na int mitH = na // na = not yet mitigated int mitL = na bool has = false type Lvl float price = na int t = na // time of the extreme itself int mit = na // na = not yet mitigated int ty = 0 // 0 = high, 1 = low int win = 0 // C2 window: 0 LON02, 1 AM02, 2 PM02 (unused for prev-day) type Acc float h = na int ht = na float l = na int lt = na type PLvl float price = na int start = na int mit = na string name = "" int ty = 0 // 0 = high, 1 = low int rank = 0 // 0 open . 1 session/C2 . 2 day . 3 week . 4 month int style = -1 // index into the opening-line style arrays, -1 = none int sort = 0 // label order within a merged group // --------------------------------------------------------------------------- // 1 GENERAL // --------------------------------------------------------------------------- gGen = "1 General" extendBars = input.int(30, "Extend line (bars beyond live candle)", minval = 0, group = gGen) // --------------------------------------------------------------------------- // 2 LIQUIDITY H/L // --------------------------------------------------------------------------- gLiq = "2 Liquidity H/L" liqAsia = input.bool(true, "Asia", inline="lq1", group=gLiq) liqLon = input.bool(true, "London", inline="lq1", group=gLiq) liqNYAM = input.bool(true, "NY AM", inline="lq2", group=gLiq) liqNYPM = input.bool(true, "NY PM", inline="lq2", group=gLiq) liqPD = input.bool(true, "Prev Day", inline="lq3", group=gLiq) liqPW = input.bool(true, "Prev Week", inline="lq3", group=gLiq) liqPM = input.bool(true, "Prev Month", inline="lq4", group=gLiq) prevDayCount = input.int(3, "Show prev. days", minval=1, maxval=20, group=gLiq, tooltip="How many of the most recent prev-day highs/lows you want to see back in time.") pdDef = input.string("Calendar (00:00-23:59)", " └ prev. day definition", options=["Calendar (00:00-23:59)","Trading day (18:00-17:00)"], group=gLiq, tooltip="Calendar = the original definition; note that a calendar day INCLUDES its own 18:00-23:59 evening, which is the Asia open of the NEXT trading day -- so Prev. Day H/L can land on last night's Asia session. Trading day = 18:00 -> 17:00 NY; the day seals on the 18:00 open, Sunday evening simply belongs to Monday's trading day.") showMitPrevDay = input.bool(false, " └ also keep mitigated prev-days", group=gLiq, tooltip="Off = only still-unmitigated. On = the N most recent prev-days regardless of mitigation (mitigated ones stop dotted at their mitigation point).") pdDateOn = input.bool(true, " └ date in prev-day label", group=gLiq, tooltip="Adds dd/mm to the prev-day label, e.g. 'Prev. Day L · 08/08'. With unmitigated-only display a prev-day level can be many days old (every low in between got swept); without the date it reads as yesterday's. The date is that of the CANDLE that made the level -- in Trading-day mode a low made Sunday evening therefore shows Sunday's date even though it belongs to Monday's trading day.") pdMaxAge = input.int(0, " └ max. prev-day age (days, 0 = off)", minval=0, maxval=90, group=gLiq, tooltip="Stops the backward walk after this many sealed prev-days, even if fewer than 'Show prev. days' unmitigated levels were found. 0 = walk the whole history (old behaviour). Counts sealed days, so with 'skip Sunday evening' on, skipped Sundays do not count.") skipSunEve = input.bool(false, " └ skip Sunday evening (Calendar mode)", group=gLiq, tooltip="Only relevant when prev. day definition = Calendar: there Sunday 18:00-24:00 is a 6-hour day and gives a short level. On = leave that day out of the history. In Trading-day mode this stub day does not exist and the toggle does nothing. Friday is closed correctly on the Sunday 18:00 bar either way.") pdCal = pdDef == "Calendar (00:00-23:59)" liqUnmitC = input.color(color.new(#B0BEC5, 0), "Unmitigated", inline="lqU", group=gLiq), liqUnmitW = input.int(1,"",minval=1,maxval=5,inline="lqU",group=gLiq), liqUnmitS = input.string("Solid","",options=["Solid","Dashed","Dotted"],inline="lqU",group=gLiq) liqMitC = input.color(color.new(#607D8B, 0), "Mitigated", inline="lqM", group=gLiq), liqMitW = input.int(1,"",minval=1,maxval=5,inline="lqM",group=gLiq), liqMitS = input.string("Dotted","",options=["Solid","Dashed","Dotted"],inline="lqM",group=gLiq) liqTsz = input.string("Small", "Text size", options=["Tiny","Small","Normal","Large"], group=gLiq) liqMerge = input.int(0, "Merge tolerance (ticks)", minval=0, group=gLiq, tooltip="Levels within this distance are placed on 1 line. Also applies between liquidity and opening lines. 0 = exactly equal.") liqPrice = input.bool(false, "Price in label", group=gLiq) // Fix 12. Only has an effect on a group that contains an opening line: that // group keeps running (an open does not mitigate) and therefore shows no // dotted style, so a mitigated liquidity member inside it is invisible. liqMarkMit = input.bool(false, "Mark mitigated level merged with an open", group=gLiq, tooltip="A liquidity level that sits at the same price as an opening line keeps the open's style and keeps running, so you cannot see that the liquidity side is already taken. On = that member gets '(m)' in the label, e.g. 'Prev. Day H (m) + 09:30'. Off = the old label.") c2On = input.bool(true, "90M cycle levels (2nd/Manip.: LON02/AM02/PM02)", group=gLiq, tooltip="High/low of the 2nd 90M cycle of each session (London 04:00, NY AM 08:30, NY PM 13:00). Unmitigated extended; mitigated stops with label in the MIDDLE of the line. Needs a 30-min aligned TF (see fix 7).") c2Count = input.int(2, " └ count per window (H/L)", minval=1, maxval=10, group=gLiq) // --------------------------------------------------------------------------- // 3 OPENING LINES (on . colour . width . style) // --------------------------------------------------------------------------- gOpen = "3 Opening lines" o930On = input.bool(true, "09:30", inline="o1", group=gOpen), o930C = input.color(#EF5350, "", inline="o1", group=gOpen), o930W = input.int(1,"",minval=1,maxval=5,inline="o1",group=gOpen), o930S = input.string("Dotted","",options=["Solid","Dashed","Dotted"],inline="o1",group=gOpen) woOn = input.bool(true, "W.O.", inline="o2", group=gOpen), woC = input.color(#FFA726, "", inline="o2", group=gOpen), woW = input.int(1,"",minval=1,maxval=5,inline="o2",group=gOpen), woS = input.string("Dotted","",options=["Solid","Dashed","Dotted"],inline="o2",group=gOpen) moOn = input.bool(true, "M.O.", inline="o3", group=gOpen), moC = input.color(#AB47BC, "", inline="o3", group=gOpen), moW = input.int(1,"",minval=1,maxval=5,inline="o3",group=gOpen), moS = input.string("Dotted","",options=["Solid","Dashed","Dotted"],inline="o3",group=gOpen) coOn = input.bool(true, "C.O. (90M)", inline="o4", group=gOpen), coC = input.color(#42A5F5, "", inline="o4", group=gOpen), coW = input.int(1,"",minval=1,maxval=5,inline="o4",group=gOpen), coS = input.string("Dotted","",options=["Solid","Dashed","Dotted"],inline="o4",group=gOpen) openTsz = input.string("Small", "Text size", options=["Tiny","Small","Normal","Large"], group=gOpen) // --------------------------------------------------------------------------- // 4 OPENING GAPS (box + CE line) // --------------------------------------------------------------------------- gGap = "4 Opening gaps" nwogOn = input.bool(true, "NWOG", inline="g1", group=gGap), nwogBoxC = input.color(color.new(#26A69A, 85), "Box", inline="g1", group=gGap), nwogCEC = input.color(#26A69A, "CE", inline="g1", group=gGap) nwogHist = input.int(2, "NWOG history", minval=1, maxval=20, group=gGap) ndogOn = input.bool(true, "NDOG", inline="g2", group=gGap), ndogBoxC = input.color(color.new(#FFA726, 85), "Box", inline="g2", group=gGap), ndogCEC = input.color(#FFA726, "CE", inline="g2", group=gGap) ndogHist = input.int(5, "NDOG history", minval=1, maxval=20, group=gGap) // --------------------------------------------------------------------------- // 5 CYCLES (AMD boxes) — A/M/D rotation from 02:30 NY (blue/red/green) // London 02:30/04:00/05:30 · NY AM 07:00/08:30/10:00 · NY PM 11:30/13:00/14:30 // --------------------------------------------------------------------------- gCyc = "5 Cycles (AMD boxes)" cyc90 = input.bool(true, "90M", inline="cz", group=gCyc) cyc30 = input.bool(true, "30M", inline="cz", group=gCyc) cyc10 = input.bool(true, "10M", inline="cz", group=gCyc) cyc32 = input.bool(true, "3.33M (10s TF)", inline="cz", group=gCyc, tooltip="200-second cycles (27 per 90M). Previously labelled 3.2M, which it never was. Only draws on a TF that divides 200 s: 10s / 20s / 40s / 50s.") amdBlue = input.color(#2962ff, "A", inline="amdc", group=gCyc) amdRed = input.color(#f23645, "M", inline="amdc", group=gCyc) amdGreen = input.color(#089981, "D", inline="amdc", group=gCyc) mode90 = input.string("Grey", "Non-red 90M windows", options=["Hide","Grey","AMD colours"], group=gCyc, tooltip="Hide = only the red (manipulation) 90M windows (LO2/AM2/PM2: 04:00, 08:30, 13:00 NY). Grey = all 90M windows, the non-red ones in the colour below. AMD colours = original blue/red/green rotation. The red windows always keep the M colour.") c90OtherC = input.color(color.new(#B0BEC5, 0), " └ colour non-red 90M", group=gCyc) lowInRed = input.bool(true, "30/10/3.2M only inside RED 90M", group=gCyc, tooltip="Off = the lower cycles run across the whole day instead of only inside the red 90M windows.") focusRedLo = input.bool(true, "Focus: only RED 30/10/3.2M", group=gCyc, tooltip="Of the 30/10/3.2M only the red (2nd/Manipulation) boxes.") focusPreRed = input.bool(false, " └ (Hide mode) also 90M window before the red", group=gCyc, tooltip="Only relevant when 'Non-red 90M windows' = Hide. Then it also shows the Accumulation window (LO1/AM1/PM1) before each red window.") am1On = input.bool(false, " └ 90M 07:00-08:29 (AM1)", inline="am1", group=gCyc, tooltip="Draws the 07:00-08:29 accumulation window before the NY AM manipulation in its own colour, in every 90M mode.") am1C = input.color(#26A69A, "", inline="am1", group=gCyc) allRed10 = input.bool(false, "Show ALL red 10M cycles", inline="allcyc", group=gCyc, tooltip="Every red (Manipulation) 10M cycle across the day (02:30-16:00 NY), independent of the 90M red windows. Standalone toggle.") all3M = input.bool(false, "Show ALL red 3.33M cycles", inline="allcyc", group=gCyc, tooltip="Every RED (Manipulation) 3.33M cycle across the day, independent of the 90M red windows. Needs a TF that divides 200 s (10s / 20s / 40s / 50s) - NOT 1-min: there the boundaries fall mid-candle and the boxes came out 3 and 4 minutes wide alternating.") cycTrans = input.int(85, "Box transparency", minval=0, maxval=100, group=gCyc) cycBordStr = input.string("Dotted", "Border", options=["Solid","Dashed","Dotted"], inline="cb", group=gCyc) cycBordC = input.color(color.gray, "", inline="cb", group=gCyc) cycEQon = input.bool(true, "EQ line (90M + sessions)", inline="ceq", group=gCyc) cycEQred = input.bool(false, " └ only in RED 90M", group=gCyc, tooltip="Keeps the chart calm when all 90M windows are visible: the EQ line is then only drawn in the red windows (sessions keep theirs).") cycEQstr = input.string("Dashed", "", options=["Solid","Dashed","Dotted"], inline="ceq", group=gCyc) cycEQC = input.color(color.gray, "", inline="ceq", group=gCyc) // --------------------------------------------------------------------------- // 6 SESSION BOXES // --------------------------------------------------------------------------- gSbox = "6 Session boxes" sbAsia = input.bool(true, "Asia", inline="sb1", group=gSbox), sbAsiaC = input.color(color.gray, "", inline="sb1", group=gSbox) sbLon = input.bool(false, "London", inline="sb2", group=gSbox), sbLonC = input.color(#2962ff, "", inline="sb2", group=gSbox) sbNYAM = input.bool(false, "NY AM", inline="sb3", group=gSbox), sbNYAMC = input.color(#f23645, "", inline="sb3", group=gSbox) sbNYPM = input.bool(false, "NY PM", inline="sb4", group=gSbox), sbNYPMC = input.color(#089981, "", inline="sb4", group=gSbox) sbLblC = input.color(color.black, "Label", inline="sbl", group=gSbox) sbLblSz = input.string("Small", "", options=["Tiny","Small","Normal","Large"], inline="sbl", group=gSbox) // --------------------------------------------------------------------------- // 7 SESSION RANGE -> 15:59 // Box from the session's highest to lowest candle, projected to 15:59 NY. // Finalised when the session ends (so it shows the COMPLETED range as a zone). // On a 1-min chart the high/low is exactly the highest/lowest 1-min candle; // on a higher TF it is the chart-TF extreme of that session. // --------------------------------------------------------------------------- gSR = "7 Session range -> 15:59" srOn = input.bool(false, "Show session range zones (-> 15:59)", group=gSR, tooltip="Off by default. Draws each session's high-to-low range as a box, projected to 15:59 NY of the trading day.") srAsia = input.bool(true, "Asia", inline="sr1", group=gSR), srAsiaC = input.color(color.gray, "", inline="sr1", group=gSR) srLon = input.bool(true, "London", inline="sr2", group=gSR), srLonC = input.color(#2962ff, "", inline="sr2", group=gSR) srAM = input.bool(true, "NY AM", inline="sr3", group=gSR), srAMC = input.color(#f23645, "", inline="sr3", group=gSR) srPM = input.bool(false,"NY PM", inline="sr4", group=gSR), srPMC = input.color(#089981, "", inline="sr4", group=gSR) srFrom = input.string("Session end (projection)", "Box starts at", options=["Session end (projection)","Session start (full)"], group=gSR, tooltip="Session end = clean forward zone from the session's close to 15:59 (your idea). Session start = the box also covers the session itself.") srHist = input.int(1, "Days kept", minval=1, maxval=5, group=gSR, tooltip="How many trading days of session-range zones to keep on the chart.") srTrans= input.int(88, "Fill transparency", minval=0, maxval=100, group=gSR) srBord = input.bool(true, "Border", group=gSR) srLbl = input.bool(true, "Session label", group=gSR) srFromEnd = srFrom == "Session end (projection)" amd_col(int idx) => int m = idx % 3 m == 0 ? amdBlue : m == 1 ? amdRed : amdGreen // --------------------------------------------------------------------------- // STATE // sessSt: 0 Asia . 1 London . 2 NY AM . 3 NY PM . 4 Prev Week . 5 Prev Month // (fix 9: the old 7-slot layout had a dead index 4 left over from when the // prev-day lived in the same array. Week/month moved down one slot.) // --------------------------------------------------------------------------- var array sessSt = array.from(Sess.new(), Sess.new(), Sess.new(), Sess.new(), Sess.new(), Sess.new()) var float cdH=na, var int cdHt=na, var float cdL=na, var int cdLt=na var float cwH=na, var int cwHt=na, var float cwL=na, var int cwLt=na var float cmH=na, var int cmHt=na, var float cmL=na, var int cmLt=na // Prev-day history. One Lvl per sealed high/low; .mit holds the mitigation time. var array pdHi = array.new() var array pdLo = array.new() // 2nd-90M-cycle windows (0=LON02 04:00, 1=AM02 08:30, 2=PM02 13:00) var array c2acc = array.from(Acc.new(), Acc.new(), Acc.new()) var array c2Lv = array.new() // Opening lines state var float o0930p=na, var int o0930t=na var float woP=na, var int woT=na var float moP=na, var int moT=na var float coP=na, var int coT=na var array gLines = array.new() var array