multicharts-powerlanguage

A Claude Code plugin for MultiCharts PowerLanguage — gives Claude expert knowledge of PowerLanguage syntax, 947 keywords, 160 functions (150 built-in + 10 custom), and bidirectional code conversion to TradingView Pine Script, Python, Rust, and C++.
947 keywords · 160 functions · 10 auto-activating skills · 4 conversion targets
Install
claude /plugin marketplace add KasperChenGH/multicharts-powerlanguage
claude /plugin install multicharts-powerlanguage@multicharts-powerlanguage-dev
All 10 skills auto-trigger when relevant — no manual invocation needed. Works on Windows, macOS, and Linux.
How to use
After installing, just talk to Claude naturally. The plugin activates automatically when your question involves PowerLanguage, Pine Script, or code conversion — no special commands needed.
Ask about PowerLanguage syntax
You: What's the difference between EntryPrice and OpenEntryPrice in MultiCharts?
You: How do I declare an array in PowerLanguage?
You: What parameters does the Stochastic function take?
Generate PowerLanguage code
You: Write a signal that buys when RSI crosses below 30 and sells when it crosses above 70
You: Create an indicator that plots Bollinger Bands with a 20-period SMA and 2 standard deviations
You: Write a function that calculates the Sharpe ratio
Convert code between languages
You: Convert this PowerLanguage signal to Pine Script:
[paste your code]
You: Translate this Pine Script strategy to Python using pandas-ta:
[paste your code]
You: Port this PowerLanguage indicator to Rust
Ask about Pine Script
You: How does request.security() work in Pine Script?
You: What's the difference between var and varip?
You: Write a Pine Script indicator that shows RSI with overbought/oversold zones
Debug and review
You: Why is this PowerLanguage signal giving me a compile error?
[paste your code]
You: Review this strategy for common PowerLanguage gotchas
Examples
Code generation
Write a MultiCharts signal that enters long when RSI crosses below 30 and exits when it crosses above 70, with a 2% stop loss.
Inputs:
RSI_Length(14),
Oversold(30),
Overbought(70),
StopLossPct(2);
Variables:
MyRSI(0);
MyRSI = RSI(Close, RSI_Length);
If MyRSI Crosses Below Oversold Then
Buy ("RSI Long") Next Bar at Market;
If MyRSI Crosses Above Overbought Then
Sell ("RSI Exit") Next Bar at Market;
SetStopLoss(StopLossPct * 0.01 * EntryPrice);
Code conversion (quick)
Convert this to Python / Rust / C++ / Pine Script
Buy ("Entry") 1 Contract Next Bar at Market;
| Target | Output |
|---|
| Pine Script | strategy.entry("Entry", strategy.long, qty=1) |
| Python | orders.append(Order("Entry", Side.LONG, OrderType.MARKET, 1)) |
| Rust | orders.push(Order { label: "Entry", side: Side::Long, order_type: OrderType::Market, qty: 1 }) |
| C++ | orders.push_back({"Entry", Side::Long, OrderType::Market, 1}); |
PL Next Bar at Market fills at the next bar's open. Pine's strategy.entry does this by default (process_orders_on_close=false); the Python/Rust/C++ scaffolds queue the order on the signal bar and fill it at the next bar's open.
Full conversion example
The following PowerLanguage strategy buys when a fast EMA crosses above a slow EMA, sells on the reverse cross, and uses an ATR-based trailing stop. Below it is the same logic in all four conversion targets.
PowerLanguage (source)
Inputs:
FastLen(9),
SlowLen(21),
ATRLen(14),
TrailMult(2.0);
Variables:
fastMA(0),
slowMA(0),
atrVal(0),
trailStop(0);
fastMA = XAverage(Close, FastLen);
slowMA = XAverage(Close, SlowLen);
atrVal = AvgTrueRange(ATRLen); { SIMPLE average of TrueRange -- not Wilder }
If fastMA Crosses Over slowMA Then
Buy ("EMA Cross") Next Bar at Market;
If fastMA Crosses Under slowMA Then
Sell ("EMA Exit") Next Bar at Market;
If MarketPosition = 1 Then Begin
trailStop = Highest(High, 10) - TrailMult * atrVal;
Sell ("Trail") Next Bar at trailStop Stop;
End;
Pine Script
//@version=5
strategy("EMA Cross + ATR Trail", overlay=true,
initial_capital=10000, default_qty_type=strategy.fixed, default_qty_value=1)
fastLen = input.int(9, "Fast EMA")
slowLen = input.int(21, "Slow EMA")
atrLen = input.int(14, "ATR Length")
trailMult = input.float(2.0, "Trail Multiplier")