examples

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pine Script Examples

Pine Script 示例

Browse available example scripts to learn patterns and get inspiration.
浏览可用的示例脚本,学习编程模式并获取灵感。

Instructions

使用说明

When this skill is invoked:
  1. List all examples from the
    examples/
    directory using Glob
  2. Organize by complexity:
    • examples/simple/
      - Basic patterns for beginners
    • examples/intermediate/
      - More advanced techniques
    • examples/advanced/
      - Complex implementations
  3. Show a summary of each example:
    • Filename
    • Brief description (from file header)
    • Key concepts demonstrated
  4. Offer to explain any example in detail
调用此技能时:
  1. 列出所有示例:使用Glob遍历
    examples/
    目录下的所有示例
  2. 按复杂程度分类
    • examples/simple/
      - 面向初学者的基础模式
    • examples/intermediate/
      - 更进阶的技术
    • examples/advanced/
      - 复杂实现方案
  3. 展示每个示例的摘要
    • 文件名
    • 简要描述(来自文件头)
    • 演示的核心概念
  4. 提供详细讲解:可对任意示例进行详细解释

Example Categories

示例分类

Simple Examples

简单示例

  • Basic indicators (MA, RSI)
  • Simple plots and colors
  • Basic alerts
  • 基础指标(MA、RSI)
  • 简单绘图与颜色设置
  • 基础警报

Intermediate Examples

中级示例

  • Multi-timeframe analysis
  • Custom calculations
  • Tables and labels
  • 多时间框架分析
  • 自定义计算
  • 表格与标签

Advanced Examples

高级示例

  • UDT-first architecture
  • Complex drawing management
  • Strategy with full backtesting
  • UDT优先架构
  • 复杂绘图管理
  • 带完整回测的策略

User Interaction

用户交互

After showing examples:
  • "Would you like me to explain any of these in detail?"
  • "Would you like to use one as a starting point for your project?"
  • "Would you like to see a specific category?"
展示示例后:
  • "您需要我详细讲解其中某个示例吗?"
  • "您想要将某个示例作为项目的起点吗?"
  • "您想要查看特定分类的示例吗?"

Using Examples as Templates

将示例用作模板

If user wants to use an example:
  1. Copy to
    projects/
    with new name
  2. Explain the key parts
  3. Help customize for their needs
如果用户想要使用示例:
  1. 复制到
    projects/
    目录并重命名
  2. 讲解核心部分
  3. 帮助根据需求进行定制