Skip to content

PineScript Reference

This section covers the PineScript v6 indicators in the RQF-ML system.

Current Indicators

Indicator Version Status File
STRAT_02: RQF v12.0 Active strategies/pine_v6/STRAT_02.pine
STRAT_01: Session v9.1 Paused strategies/pine_v6/STRAT_01.pine
STRAT_03: Advanced v1.0 Development strategies/pine_v6/STRAT_03.pine

Documentation

  • STRAT_02 Reference


    Complete reference for the RQF Range System

    Reference

  • Non-Repaint Compliance


    Critical patterns for reliable signals

    Compliance

  • Alert Webhooks


    JSON format for automation

    Alerts

  • Pattern Library


    Reusable code snippets

    Patterns

Quick Reference

Standard Declaration

//@version=6
indicator("STRAT_XX: Name", "Short", overlay=true,
    max_lines_count=500, max_labels_count=500, max_boxes_count=500)

Input Groups

grp_core = "Core Settings"
grp_display = "Display"
grp_colors = "Colors"
grp_alerts = "Trade Alerts (Webhook)"

Non-Repaint Pattern

// ALWAYS check barstate.isconfirmed for signals
if barstate.isconfirmed and myCondition
    // Signal logic here

// NEVER use lookahead
htfData = request.security(sym, tf, close, lookahead=barmerge.lookahead_off)

Alert Format

{
  "event": "LONG_ENTRY",
  "strategy": "STRAT_02",
  "symbol": "{{ticker}}",
  "timeframe": "{{interval}}",
  "price": {{close}},
  "time": "{{time}}"
}

Development Workflow

graph LR
    A[Spec] --> B[Generate]
    B --> C[Analyze]
    C --> D[Debug]
    D --> E[Test]
    E --> F[Deploy]

    B -.-> G[/pine-generate]
    C -.-> H[/pine-analyze]
    D -.-> I[/pine-debug]
  1. Spec: Define requirements in a spec file
  2. Generate: Use /pine-generate to create initial code
  3. Analyze: Use /pine-analyze to check quality
  4. Debug: Use /pine-debug to fix errors
  5. Test: Run on TradingView with bar replay
  6. Deploy: Add to chart for live trading

Skills for PineScript

Skill Purpose
/pine-generate Create indicator from spec
/pine-analyze Quality and compliance check
/pine-debug Fix errors
/pine-patterns Get code snippets
/pine-learn Interactive learning
/pine-to-python Convert for backtesting