一键导入
tradingview-script
Generate TradingView Pine Script indicators and strategies from natural language descriptions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate TradingView Pine Script indicators and strategies from natural language descriptions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Complete market analysis for Crypto, Forex, and Stocks with RSI, MACD, trends, and trading recommendations.
Binary Options trading via BinaryFaster. Execute CALL/PUT trades, manage positions, track results.
Regulatory compliance across jurisdictions. KYC status, tax reporting, trading restrictions, and legal guidelines.
Social trading - copy the best traders automatically. Track whales, influencers, and top performers.
DeFi yield hunting across protocols. Find the best APY, auto-compound, manage LP positions, and optimize gas.
Derivatives trading - options, futures, and perpetuals. Advanced strategies for hedging and leverage.
| name | tradingview-script |
| description | Generate TradingView Pine Script indicators and strategies from natural language descriptions |
| metadata | {"openclaw":{"emoji":"📜","requires":{"bins":["python3"],"pip":["jinja2"]}}} |
Generate professional Pine Script v5 code for TradingView indicators and strategies from simple descriptions.
Generate custom indicators from descriptions:
Create complete trading strategies with:
Auto-generate TradingView alerts for:
// Auto-generated by K.I.T. TradingView Script Generator
//@version=5
strategy("RSI Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Inputs
rsiLength = input.int(14, "RSI Length")
rsiOverbought = input.int(70, "Overbought Level")
rsiOversold = input.int(30, "Oversold Level")
// Calculations
rsiValue = ta.rsi(close, rsiLength)
// Entry Conditions
longCondition = ta.crossover(rsiValue, rsiOversold)
shortCondition = ta.crossunder(rsiValue, rsiOverbought)
// Execute
if longCondition
strategy.entry("Long", strategy.long)
if shortCondition
strategy.close("Long")
// Alerts
alertcondition(longCondition, "RSI Buy Signal", "RSI crossed above oversold")
alertcondition(shortCondition, "RSI Sell Signal", "RSI crossed below overbought")
//@version=5
strategy("MA Crossover Strategy", overlay=true)
// Inputs
fastLength = input.int(9, "Fast MA Length")
slowLength = input.int(21, "Slow MA Length")
maType = input.string("EMA", "MA Type", options=["SMA", "EMA", "WMA"])
// MA Function
getMA(src, length, type) =>
switch type
"SMA" => ta.sma(src, length)
"EMA" => ta.ema(src, length)
"WMA" => ta.wma(src, length)
// Calculations
fastMA = getMA(close, fastLength, maType)
slowMA = getMA(close, slowLength, maType)
// Plot
plot(fastMA, "Fast MA", color.green)
plot(slowMA, "Slow MA", color.red)
// Signals
longSignal = ta.crossover(fastMA, slowMA)
shortSignal = ta.crossunder(fastMA, slowMA)
// Execute
if longSignal
strategy.entry("Long", strategy.long)
if shortSignal
strategy.entry("Short", strategy.short)
// Alerts for K.I.T. Webhook
alertcondition(longSignal, "Long Signal", '{"action":"buy","symbol":"{{ticker}}","price":"{{close}}"}')
alertcondition(shortSignal, "Short Signal", '{"action":"sell","symbol":"{{ticker}}","price":"{{close}}"}')
//@version=5
strategy("BB + RSI Strategy", overlay=true)
// Bollinger Bands
bbLength = input.int(20, "BB Length")
bbMult = input.float(2.0, "BB Multiplier")
[bbMiddle, bbUpper, bbLower] = ta.bb(close, bbLength, bbMult)
// RSI
rsiLength = input.int(14, "RSI Length")
rsiValue = ta.rsi(close, rsiLength)
// Plot BB
plot(bbUpper, "Upper Band", color.red)
plot(bbMiddle, "Middle Band", color.gray)
plot(bbLower, "Lower Band", color.green)
// Entry: Price at lower band + RSI oversold
longCondition = close <= bbLower and rsiValue < 30
shortCondition = close >= bbUpper and rsiValue > 70
// Execute
if longCondition
strategy.entry("Long", strategy.long)
if shortCondition
strategy.close("Long")
// Alert with full signal data
alertcondition(longCondition, "BB+RSI Buy",
'{"signal":"buy","ticker":"{{ticker}}","price":"{{close}}","rsi":"' + str.tostring(rsiValue, "#.##") + '","bb_lower":"' + str.tostring(bbLower, "#.##") + '"}')
python3 pine_generator.py indicator \
--name "My RSI" \
--type rsi \
--length 14 \
--overbought 70 \
--oversold 30
python3 pine_generator.py strategy \
--name "MA Cross Strategy" \
--indicators "ema:9,ema:21" \
--entry "cross_above(ema_9, ema_21)" \
--exit "cross_below(ema_9, ema_21)" \
--sl-pct 2 \
--tp-pct 4
python3 pine_generator.py describe \
--prompt "Create a strategy that buys when RSI is below 30 and price is at the lower Bollinger Band, sells when RSI goes above 70"
All generated scripts include webhook-ready alerts:
// K.I.T. Webhook Alert Format
alertcondition(signal, "K.I.T. Signal",
'{"action":"{{strategy.order.action}}","ticker":"{{ticker}}","price":"{{close}}","time":"{{time}}"}')
TradingView Alert
│
▼
K.I.T. Webhook Receiver (skills/tradingview-webhook)
│
▼
Signal Validation & Risk Check
│
▼
Execute on Exchange (Binance/MT5/etc.)
User: Create a Pine Script that shows buy signals when price is 2 ATRs below the 50 EMA
K.I.T.: 📜 Generated Pine Script:
//@version=5
indicator("ATR Below EMA Signal", overlay=true)
emaLength = input.int(50, "EMA Length")
atrLength = input.int(14, "ATR Length")
atrMult = input.float(2.0, "ATR Multiplier")
emaValue = ta.ema(close, emaLength)
atrValue = ta.atr(atrLength)
threshold = emaValue - (atrValue * atrMult)
plot(emaValue, "EMA 50", color.blue)
plot(threshold, "Buy Zone", color.green, style=plot.style_stepline)
buySignal = ta.crossover(close, threshold)
plotshape(buySignal, "Buy", shape.triangleup, location.belowbar, color.green)
alertcondition(buySignal, "Buy Signal", '{"action":"buy","symbol":"{{ticker}}"}')
pine_generator.py - Main script generatortemplates/ - Pine Script templates
indicator_base.pine - Base indicator templatestrategy_base.pine - Base strategy templatealert_webhook.pine - Webhook alert snippetsexamples/ - Example generated scripts