Token导航 LogoToken导航TokenDH.com
前端设计权限需确认github未标认证来源可访问clear审计通过

pine-optimizer松树优化器

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

4,257

周安装

181

GitHub Stars

83

下载量

1,491
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pine-optimizer(松树优化器)
来源仓库:https://github.com/traderspost/pinescript-agents
仓库路径:skills/pine-optimizer
安装命令:
npx skills add https://github.com/traderspost/pinescript-agents --skill pine-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/traderspost/pinescript-agents --skill pine-optimizer

简介

用于辅助安全审计、权限检查和常见漏洞排查。

  • 适合梳理敏感配置、分析鉴权逻辑或生成安全复核清单。
  • 不能将工具输出直接当作最终结论,需确认最小权限和操作边界。
  • 安装命令:npx skills add https://github.com/traderspost/pinescript-agents --skill pine-optimizer
  • 建议先脱敏再处理密钥、令牌等敏感信息

SKILL.md

Pine Script Optimizer

Specialized in enhancing script performance, user experience, and visual presentation on TradingView.

Core Optimization Areas

Performance Optimization

  • Reduce calculation complexity
  • Minimize security() calls
  • Optimize array operations
  • Cache repeated calculations
  • Reduce compilation size

User Experience Enhancement

  • Intuitive input organization
  • Helpful tooltips and descriptions
  • Smart default values
  • Conditional input visibility
  • User-friendly alerts

Visual Optimization

  • Professional color schemes
  • Adaptive text sizes
  • Clean plot styles
  • Responsive layouts
  • Mobile-friendly displays

Code Efficiency

  • Remove redundant calculations
  • Optimize conditional logic
  • Reduce memory usage
  • Streamline data structures

Performance Optimization Techniques

1. Calculation Caching

// BEFORE - Inefficient
plot(ta.sma(close, 20) > ta.sma(close, 50) ? high : low)
plot(ta.sma(close, 20) > ta.sma(close, 50) ? 1 : 0)

// AFTER - Optimized with caching
sma20 = ta.sma(close, 20)
sma50 = ta.sma(close, 50)
condition = sma20 > sma50
plot(condition ? high : low)
plot(condition ? 1 : 0)

2. Security Call Optimization

// BEFORE - Multiple security calls
htfClose = request.security(syminfo.tickerid, "D", close)
htfHigh = request.security(syminfo.tickerid, "D", high)
htfLow = request.security(syminfo.tickerid, "D", low)

// AFTER - Single security call with tuple
[htfClose, htfHigh, htfLow] = request.security(syminfo.tickerid, "D", [close, high, low])

3. Array Operation Optimization

// BEFORE - Inefficient array operations
var array<float> values = array.new<float>()
for i = 0 to 100
    array.push(values, close[i])

// AFTER - Optimized with built-in functions
var array<float> values = array.new<float>(100)
if barstate.isconfirmed
    array.push(values, close)
    if array.size(values) > 100
        array.shift(values)

4. Conditional Logic Optimization

// BEFORE - Multiple condition checks
signal = close > open and close > close[1] and volume > volume[1] and rsi > 50

// AFTER - Short-circuit evaluation
signal = close > open
signal := signal and close > close[1]
signal := signal and volume > volume[1]
signal := signal and rsi > 50

User Experience Enhancements

1. Organized Input Groups

// Organized inputs with groups and tooltips
// ============================================================================
// INPUTS
// ============================================================================

// Moving Average Settings
maLength = input.int(20, "MA Length", minval=1, maxval=500, group="Moving Average",
                     tooltip="Length of the moving average. Lower values are more responsive.")
maType = input.string("EMA", "MA Type", options=["SMA", "EMA", "WMA", "VWMA"],
                      group="Moving Average",
                      tooltip="Type of moving average to use")

// Signal Settings
signalMode = input.string("Conservative", "Signal Mode",
                          options=["Conservative", "Normal", "Aggressive"],
                          group="Signal Settings",
                          tooltip="Conservative: Fewer, higher quality signals\nNormal: Balanced\nAggressive: More frequent signals")

// Visual Settings
showMA = input.bool(true, "Show MA", group="Visual Settings")
showSignals = input.bool(true, "Show Signals", group="Visual Settings")
showTable = input.bool(true, "Show Info Table", group="Visual Settings")

// Color Settings
bullishColor = input.color(color.green, "Bullish Color", group="Colors")
bearishColor = input.color(color.red, "Bearish Color", group="Colors")
neutralColor = input.color(color.gray, "Neutral Color", group="Colors")

2. Adaptive Color Schemes

// Professional color scheme with transparency
var color BULL_COLOR = color.new(#26a69a, 0)
var color BEAR_COLOR = color.new(#ef5350, 0)
var color BULL_LIGHT = color.new(#26a69a, 80)
var color BEAR_LIGHT = color.new(#ef5350, 80)

// Gradient colors for trends
trendStrength = (close - ta.sma(close, 50)) / ta.sma(close, 50) * 100
gradientColor = color.from_gradient(trendStrength, -2, 2, BEAR_COLOR, BULL_COLOR)

// Dark mode friendly colors
bgColor = color.new(color.black, 95)
textColor = color.new(color.white, 0)

3. Responsive Table Layout

// Auto-sizing table based on content
var table infoTable = table.new(position.top_right, 2, 1, bgcolor=color.new(color.black, 85))

// Dynamic row management
rowCount = 0
if showPrice
    rowCount += 1
if showMA
    rowCount += 1
if showRSI
    rowCount += 1

// Resize table if needed
if rowCount != table.rows(infoTable)
    table.delete(infoTable)
    infoTable := table.new(position.top_right, 2, rowCount, bgcolor=color.new(color.black, 85))

4. Smart Alert Messages

// Detailed alert messages with context
alertMessage = "🔔 " + syminfo.ticker + " Alert\n" + "Price: $" + str.tostring(close, "#,###.##") + "\n" + "Signal: " + (buySignal ? "BUY" : sellSignal ? "SELL" : "NEUTRAL") + "\n" + "Strength: " + str.tostring(signalStrength, "#.#") + "/10\n" + "Volume: " + (volume > ta.sma(volume, 20) ? "Above" : "Below") + " average\n" + "Time: " + str.format_time(time, "yyyy-MM-dd HH:mm")

alertcondition(buySignal or sellSignal, "Trade Signal", alertMessage)

Visual Optimization

1. Professional Plot Styling

// Clean, professional plotting
ma = ta.ema(close, maLength)

// Main plot with gradient fill
maPlot = plot(ma, "MA", color=trendColor, linewidth=2)
fillColor = close > ma ? BULL_LIGHT : BEAR_LIGHT
fill(plot(close, display=display.none), maPlot, fillColor, "MA Fill")

// Signal markers with proper sizing
plotshape(buySignal, "Buy Signal", shape.triangleup, location.belowbar, BULL_COLOR, size=size.small)
plotshape(sellSignal, "Sell Signal", shape.triangledown, location.abovebar, BEAR_COLOR, size=size.small)

2. Adaptive Text Sizing

// Dynamic label sizing based on timeframe
labelSize = timeframe.period == "1" ? size.tiny : timeframe.period == "5" ? size.small : timeframe.period == "15" ? size.small : timeframe.period == "60" ? size.normal : timeframe.period == "D" ? size.large : size.normal

if showLabels and buySignal
    label.new(bar_index, low, "BUY", style=label.style_label_up, color=BULL_COLOR, textcolor=color.white, size=labelSize)

3. Mobile-Friendly Display

// Compact display for mobile devices
compactMode = input.bool(false, "Compact Mode (Mobile)", group="Display",
                         tooltip="Enable for better mobile viewing")

// Adjust plot widths
plotWidth = compactMode ? 1 : 2

// Conditional table display
if not compactMode
    // Show full table
    table.cell(infoTable, 0, 0, "Full Info", text_color=color.white)
else
    // Show essential info only
    table.cell(infoTable, 0, 0, "Signal: " + (buySignal ? "↑" : sellSignal ? "↓" : "−"))

Code Quality Improvements

1. Memory Optimization

// Use var for persistent values
var float prevHigh = na
var int barsSinceSignal = 0
var array<float> prices = array.new<float>(100)

// Clear unused arrays
if array.size(prices) > 100
    array.clear(prices)

2. Error Prevention

// Robust error handling
safeDiv(num, den) => den != 0 ? num / den : 0
safeLookback(src, bars) => bars < bar_index ? src[bars] : src[bar_index]

// NA handling
getValue(src) => na(src) ? 0 : src

3. Compilation Size Reduction

// Use functions to reduce code duplication
plotSignal(cond, loc, col, txt) =>
    if cond
        label.new(bar_index, loc, txt, color=col, textcolor=color.white)

// Reuse styling variables
var commonStyle = label.style_label_center
var commonSize = size.normal

Optimization Checklist

  • Cached all repeated calculations
  • Minimized security() calls
  • Optimized array operations
  • Organized inputs with groups
  • Added helpful tooltips
  • Implemented professional color scheme
  • Optimized plot styles
  • Added mobile-friendly options
  • Reduced memory usage
  • Improved loading time
  • Enhanced visual appeal
  • Simplified user interactions

Balance optimization with readability. Don't over-optimize at the expense of maintainability.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.2%
按下载量换算406

Antigravity

24.33%
按下载量换算363

Gemini CLI

16.48%
按下载量换算246

OpenCode

13.22%
按下载量换算197

Codex

7.39%
按下载量换算110

trae

3.65%
按下载量换算54

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills