create

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Quick Pine Script Creation

快速创建Pine Script

Creating new Pine Script from your description: $ARGUMENTS
根据你的描述创建新的Pine Script:$ARGUMENTS

Implementation Steps

实施步骤

  1. Analyze the request to determine:
    • Type: Indicator or Strategy?
    • Complexity: Simple, Medium, or Complex?
    • Key components needed
  2. Check for relevant templates in:
    • templates/indicators/
      - For indicator patterns
    • templates/strategies/
      - For strategy patterns
    • templates/utilities/
      - For helper functions
  3. Create the file at
    projects/[descriptive-name].pine
  4. Implement with best practices:
    • //@version=6
      declaration
    • //@strategy_alert_message
      for strategies (after the
      strategy()
      call)
    • Proper input groups and tooltips
    • NA value handling
    • No repainting issues
  5. Add basic debugging if helpful
  1. 分析需求以确定:
    • 类型:Indicator(指标)还是Strategy(策略)?
    • 复杂度:简单、中等还是复杂?
    • 所需的关键组件
  2. 检查相关模板
    • templates/indicators/
      - 指标模板
    • templates/strategies/
      - 策略模板
    • templates/utilities/
      - 辅助函数模板
  3. 创建文件,路径为
    projects/[descriptive-name].pine
  4. 遵循最佳实践实现
    • 声明
      //@version=6
    • 策略需添加
      //@strategy_alert_message
      (在
      strategy()
      调用之后)
    • 合理的输入分组与提示信息
    • NA值处理
    • 无重绘问题
  5. 按需添加基础调试功能

Quick Implementation Patterns

快速实现模板

For Indicators:
pinescript
//@version=6
indicator("Title", overlay=true)
// Implementation
For Strategies:
pinescript
//@version=6
strategy("Title", overlay=true)
//@strategy_alert_message {{strategy.order.alert_message}}
// Implementation
指标模板
pinescript
//@version=6
indicator("Title", overlay=true)
// Implementation
策略模板
pinescript
//@version=6
strategy("Title", overlay=true)
//@strategy_alert_message {{strategy.order.alert_message}}
// Implementation

Quality Checklist

质量检查清单

Before delivering:
  • Compiles without errors
  • Handles NA values
  • Uses cached loop boundaries
  • Ternary operators on single lines
  • Inputs have tooltips
交付前需确认:
  • 编译无错误
  • 正确处理NA值
  • 使用缓存循环边界
  • 三元运算符单行书写
  • 输入项带有提示信息