Fix ICT indicator drawing-object churn for smoother real-time perf - #73
Draft
keag00 wants to merge 5 commits into
Draft
Fix ICT indicator drawing-object churn for smoother real-time perf#73keag00 wants to merge 5 commits into
keag00 wants to merge 5 commits into
Conversation
… expand CLAUDE.md - New Pine Script indicator (ICT Concepts + Doji Scanner) implementing swing-based trend bias, BOS, liquidity sweeps, FVGs, order blocks, equilibrium zones, and the 8 requested doji pattern variants, with a living spec in ICT_STRATEGY_SPEC.md - Fix pine_push.js/pine_pull.js picking a stale hidden Monaco editor instance instead of the live one, which caused silent "Could not inject" failures - Expand CLAUDE.md with a Development section (test commands, core/tools/cli architecture, known fragility) alongside the existing tool-usage decision tree - Update rules.json to the current 4H EMA-ribbon crypto strategy Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
for j = array.size(x) - 1 to 0 iterates ascending (not descending) when the array is empty, since -1 <= 0 — causing array.get(x, -1) on a size-0 array. Guard each of the 4 mitigation loops with array.size(x) > 0 before entering. Was silently killing all indicator output (bias table, BOS/FVG/OB/doji markers) whenever any of the four box arrays emptied out. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…repaint fix Confirmed swing/BOS/FVG detection is structurally lagged (pivots need swingLen bars of confirmation) or had a latent bug where live intrabar price could fire a one-shot line/box-creation condition more than once per bar, stacking duplicates. Added bar_index one-shot guards and a lag-free live (unconfirmed) swing high/low + live BOS layer that reacts every tick.
Non-repainting previous day/week high-low via request.security with a [1]-lagged D/W series, plus running session highs/lows that freeze and extend right once each session ends until its next occurrence resets them. All toggleable, all on by default per Keagan's "always on chart" ask.
…ormance EQ line/boxes, PDH/PDL/PWH/PWL, and session H/L lines/labels were being deleted and recreated from scratch on every single bar instead of moved in place, causing unnecessary object churn across chart history and on every realtime tick. Switched to set_xy/set_lefttop/set_rightbottom/set_x/ set_y updates, only recreating objects on actual day/week/session rollovers. Also added early break to the Order Block search loops. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
line.delete/box.delete+.new()) its Equilibrium line/premium-discount boxes, PDH/PDL/PWH/PWL lines+labels, and Asia/London/NY session H/L lines+labels on every single bar instead of only when their values actually changed — a classic Pine Script anti-pattern that churns drawing objects across the whole chart history on load and on every realtime tick. This is the most likely cause of any sluggishness/flicker on the indicator.line.set_xy1/xy2,box.set_lefttop/rightbottom,label.set_x/set_y, only actually recreating on real day/week/session rollovers (a handful of times per day instead of every bar).breakas soon as the nearest opposite-colour candle is found instead of scanning the fullobLookbackrange every time, and dropped the now-unnecessaryvar bool obFound*flags.Test plan
tv pine analyze— 0 static-analysis issuestv pine check— server-side compile via TradingView, 0 errors / 0 warningspine_push/pine_pull, documented in CLAUDE.md and noted in the spec doc — not caused by this change)🤖 Generated with Claude Code