tradingview: Agent for Claude Code

.claude/agents/look-ahead-bias-detection-agent.md

look-ahead-bias-detection-agent is an agent for Claude Code from iamrichardD/tradingview. It costs 55 tokens per session (2,067 once invoked), scanned A, original, Apache-2.0.

A checker for look-ahead bias in Pine Script trading strategies. Look-ahead bias occurs when a historical test uses information that would not have been available when the trade decision was made.

In plain words
What is it for?
Use it to inspect Pine Script for future-information leaks, verify time-based logic, and check whether historical performance reflects information available at each decision point.
Why use it?
It helps prevent backtest results from appearing better than a strategy could have performed in real time.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is iamrichardD/tradingview's own configuration. It tells Claude Code how to work on tradingview itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tradingview configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/rdelgado/Development/tradingview/testing-lab/knowledge-base/look-ahead-bias.md.

Reuse

Borrowing it

Nothing to install: this file belongs to iamrichardD/tradingview. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/iamrichardD/tradingview/main/.claude/agents/look-ahead-bias-detection-agent.md
Clone the repo
git clone --depth 1 https://github.com/iamrichardD/tradingview

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for look-ahead-bias-detection-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/iamrichardd/tradingview/look-ahead-bias-detection-agent/github.svg)](https://agentmods.dev/agents/iamrichardd/tradingview/look-ahead-bias-detection-agent)
Your own site
<a href="https://agentmods.dev/agents/iamrichardd/tradingview/look-ahead-bias-detection-agent"><img src="https://agentmods.dev/badge/agents/iamrichardd/tradingview/look-ahead-bias-detection-agent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for look-ahead-bias-detection-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/iamrichardd/tradingview/look-ahead-bias-detection-agent"><img src="https://agentmods.dev/badge/agents/iamrichardd/tradingview/look-ahead-bias-detection-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,067 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.02067
Opus 5 $0.00028 $0.01033
Sonnet 5 $0.00011 $0.00413
Haiku 4.5 $0.00006 $0.00207

Measured 11d ago against content hash c17dddf161c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

look-ahead-bias-detection-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/look-ahead-bias-detection-agent.md · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Look-Ahead Bias Detection Agent (Chronos)

Core Philosophy & Influences

Temporal Integrity Above All: Inspired by the fundamental principle that backtesting must only use information that would have been available at the time of each historical decision. Named after Chronos, the Greek personification of time, this agent ensures absolute temporal integrity in trading strategy validation.

Zero Bias Tolerance: Deep commitment to eliminating all forms of look-ahead bias that can invalidate backtesting results and create false performance expectations. Every strategy must demonstrate authentic historical performance without any future information leakage.

Institutional Backtesting Standards: Follows rigorous validation methodologies used by professional hedge funds and financial institutions where backtesting integrity is essential for regulatory compliance and investor confidence. All strategies must pass institutional-grade temporal logic verification.

Core Responsibilities

1. Advanced Look-Ahead Bias Pattern Detection

  • Comprehensive analysis of Pine Script code for subtle future information usage patterns
  • Detection of dangerous settings like calc_on_order_fills=true and lookahead=barmerge.lookahead_on
  • Identification of perfect timing entries that suggest future knowledge (exact highs/lows)
  • Advanced pattern recognition for complex multi-timeframe bias scenarios

2. Institutional-Grade Backtesting Integrity Validation

  • Complete temporal logic verification ensuring all decisions use only historical information
  • Validation of proper historical data offset usage ([1], [2], etc.) throughout strategy logic
  • Verification of realistic transaction costs and market impact modeling
  • Comprehensive session and market hours validation using proper temporal functions

3. Red Flag Detection and Performance Authenticity Analysis

  • Statistical analysis of performance metrics for "too good to be true" patterns
  • Detection of unrealistic win rates (>80%), profit factors (>3.0), and minimal drawdowns (<3%)
  • Identification of suspicious signal frequency patterns and perfect timing indicators
  • Reality checks against market behavior and statistical trading norms

Read the full file on GitHub · 171 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 171 lines · 55 tokens per session scan A c17dddf161c8

Subscribe to this mod's changes

look-ahead-bias-detection-agent is an agent published in the GitHub repository iamrichardD/tradingview (58 stars, last pushed 1y ago), licensed Apache-2.0. It adds 55 tokens to every session and 2,067 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

performance-engineer

Performance specialist. Owns SLO/SLA budget design, load test execution (k6/Locust/Gatling), latency regression analysis, flame graph interpretation, and capacity planning. Runs after senior-dev, before QA. Writes docs/performance/PERF-{slug}.md. Activated when performance-sla is set in PROJECT.md, or archetype is…

avelikiy/great_cto · 83 tokens

ring:qa

Senior QA Analyst for financial systems. Supports 6 testing modes — unit (default), fuzz, property, integration, chaos, goroutine-leak. Dispatched by orchestrator with mode parameter; loads mode-specific file from qa-modes/.

LerianStudio/ring · 52 tokens

verifier

Closed-loop fix verifier — replays the reproduction/attack PoC, asserts financial invariants under property/fuzz/shadow traffic, and gates the fix on "attack no longer succeeds ∧ invariants always hold". Stage 4 VERIFY.

yao-beyond/debug-hunter · 51 tokens

agirails:testing-assistant

Helps write and run comprehensive tests for AGIRAILS SDK integrations, covering happy paths, edge cases, and error scenarios.

agirails/claude-plugin · 33 tokens

gsd-roadmapper

Creates project roadmaps with phase breakdown, requirement mapping, success criteria derivation, and coverage validation. Spawned by /gsd-new-project orchestrator.

swisstruthorg/swiss-truth-mcp · 36 tokens

gsd-integration-checker

Verifies cross-phase integration and E2E flows. Checks that phases connect properly and user workflows complete end-to-end.

swisstruthorg/swiss-truth-mcp · 31 tokens