June 05, 2025
PineJS – 100% Pine Script compatibility in JavaScript

πŸš€ PineJS – 100% Pine Script compatibility in JavaScript (no webhooks, instant execution)

Hey traders, algo builders & Pine Script masters πŸ‘‹

We've just shipped PineJS – a complete Pine Script to JavaScript converter that runs your strategies directly on our infrastructure with zero logic loss. No more webhook chains, no more TradingView β†’ server β†’ broker delays, no more "close enough" conversions.

Why PineJS hits different

  • 100% Pine Script syntax – Your close[0], ta.ema(), strategy.entry() work exactly as expected:
// Your exact Pine Script logic, now in JS
const strategy = async ({ close, ta, strategy, plot, plotshape }) => {
  const fastEMA = ta.ema(close, 9);
  const slowEMA = ta.ema(close, 21);
  
  plot(fastEMA, "Fast EMA", "#00ff00");
  plot(slowEMA, "Slow EMA", "#ff0000");
  
  const buySignal = ta.crossover(fastEMA, slowEMA);
  if (buySignal[0]) {
    await strategy.entry("Long", "long", 1);
  }
};
  • No webhooks, zero lag – Strategies execute directly on our servers. TradingView requires alert β†’ webhook β†’ server β†’ broker with potential drops/delays at each step. We skip all that.

  • Real-time plotting – Full charting with plot(), plotshape(), plotarrow(), plotcandle() – everything renders instantly in our lightweight-charts UI. TradingView keeps plotting behind their paywall.

  • Free backtesting – Run unlimited backtests on any timeframe. No "Deep Backtesting" premium tier, no 5-second timeouts, no bar limits.

  • Live execution ready – Same code runs in backtest and live. Just toggle the switch – we handle broker connections to IBKR, Tradovate, Alpaca, Binance and more.

What makes PineJS special

FeatureTradingView Pine ScriptPineJS

Syntax Compatibility

Native Pine Script v5

100% compatible JS

Execution Speed

Via webhooks (100-500ms lag)

Direct execution (<10ms)

Plotting Functions

All functions available

All functions available

Backtesting

Limited bars, timeouts

Unlimited, instant

Live Trading

Alerts β†’ Webhooks β†’ Broker

Direct broker connection

Debugging

Limited, no breakpoints

Full JS debugging

Variables

var/varip globals

Standard JS variables

Monthly Cost

$24.95-$59.95/mo

Free

The secret sauce: Reversed arrays

Pine Script's close[0] = current bar, close[1] = previous bar. We simply reverse the arrays:

// Magic happens here
const closeReversed = marketData.map(d => d.close).reverse();
// Now close[0] is current, close[1] is previous - exactly like Pine!

No transpilers, no AST parsing, no "close enough" approximations. Just clean JavaScript that matches Pine Script 1:1.

What you can build tonight

  • Momentum scanner – Run your Pine strategies across 100 symbols simultaneously
  • Multi-timeframe system – Combine 1m, 5m, 1h signals without webhook gymnastics
  • Complex position sizing – Full access to account data, not just Pine's limited position info
  • Custom indicators – Import any npm package, use modern JS features
  • Portfolio strategies – Trade multiple symbols with shared risk management

Live in 3 minutes

  1. Copy your Pine Script strategy
  2. Run our converter (or convert manually - it's just JavaScript!)
  3. Hit backtest, see instant results with full charting
  4. Toggle live when ready - direct broker execution, no webhooks

Real example: EMA Cross with Momentum Arrows

// Full strategy with plotting - runs instantly
const strategy = async ({ close, ta, plot, plotshape, plotarrow }) => {
  const fastEMA = ta.ema(close, 9);
  const slowEMA = ta.ema(close, 21);
  
  // Plot EMAs
  plot(fastEMA, 'EMA 9', '#26a69a');
  plot(slowEMA, 'EMA 21', '#ef5350');
  
  // Generate signals
  const bullishCross = ta.crossover(fastEMA, slowEMA);
  const bearishCross = ta.crossunder(fastEMA, slowEMA);
  
  // Plot signals
  plotshape(bullishCross, 'triangleup', 'belowbar', '#26a69a');
  plotshape(bearishCross, 'triangledown', 'abovebar', '#ef5350');
  
  // Calculate momentum with filtering
  const momentum = close.map((c, i) => {
    if (i === 0) return 0;
    const change = c - close[i + 1];
    const percentChange = (change / close[i + 1]) * 100;
    
    // Filter small movements
    if (Math.abs(percentChange) < 0.1) return 0;
    
    return Math.max(-1, Math.min(1, percentChange / 2));
  });
  
  plotarrow(momentum, '#26a69a', '#ef5350');
  
  return { signals: { bullishCross, bearishCross } };
};

The catch? (There isn't one)

  • βœ… All Pine Script functions supported
  • βœ… Complete TA library (200+ indicators)
  • βœ… Full plotting/charting capabilities
  • βœ… Direct broker connections
  • βœ… Real-time execution
  • βœ… Unlimited backtesting
  • βœ… Modern debugging tools
  • βœ… Zero monthly fees

Jump in

  1. Paste your Pine Script at stoqey.com/pinejs
  2. See instant conversion to JavaScript
  3. Run backtest with full charting
  4. Go live when ready - no webhooks needed

We built this because we were tired of webhook delays killing our entries. Now our strategies execute in microseconds, not seconds.

No paywalls, no "premium" indicators, no artificial limits. Just trade faster.

Questions? Roast it, test it, break it. Let's see how fast your strategies can really run. πŸ’¨

Stay sharp & happy coding!

P.S. - Yes, it handles your 500-line Pine monster with nested conditions. Yes, all your custom indicators work. Yes, you can import that npm package you've been wanting to use. This is just JavaScript now.