GUIDE · PINE SCRIPT · UPDATED NOVEMBER 2026

Pine Script generator: build TradingView strategies from blocks.

Until 20 November 2026, SignalForge had an AI Script Builder that wrote Pine Script from a description. We retired it. In its place is SFBuilder, the strategy builder: you put the strategy together from blocks, backtest it on real candles in your browser and copy Pine Script v6 that already carries the SignalForge alert message for MetaTrader 5.

BBenjamin SF · Founder Read 7 min Level Beginner Updated 20 Nov 2026
You pick
Entry: EMA 9 crosses above EMA 21
Filter: 08:00 to 17:00, Monday to Friday
Exit: stop at 1.5 × ATR, target at 2 × the stop, close after 48 bars
Size: risk 1% of the balance per trade
THE BUILDER WRITES → PINE v6 WITH THE ALERTS IN
The builder writes (excerpt)
//@version=6
strategy("EMA cross", overlay=true, initial_capital=10000, ...)

lotSize = input.float(0.1, "Lot size (MT5)", minval=0.01, step=0.01)
fast = ta.ema(close, 9)
slow = ta.ema(close, 21)

if ta.crossover(fast, slow) and strategy.position_size == 0
    strategy.entry("Long", strategy.long,
      alert_message='{"action":"buy","symbol":"XAUUSD","lot":"' + str.tostring(lotSize) + '","strategy":"ema_cross"}')

What a Pine Script generator does.

A Pine Script generator turns a trading idea into Pine Script, the language TradingView runs, so you do not have to learn its syntax. There are two kinds. An AI generator reads a description in plain English and writes the code. A block builder lets you pick the rules from lists and writes the code from them.

SignalForge ran the first kind until 20 November 2026 and now runs the second: SFBuilder, the strategy builder at builder.signalforge-ai.com. The script does what you wired, and the backtest runs in the same window before you copy a line. It is written for the SignalForge TradingView to MT5 bridge, so its alerts become orders on MetaTrader 5.

Where to find it

Anyone can open it at builder.signalforge-ai.com, no account needed. If you have a SignalForge plan, open it from your dashboard at dashboard.signalforge-ai.com/builder so copying is unlocked.

What you can build with the blocks.

EVERY BLOCK BECOMES PINE SCRIPT V6

49 indicators

Moving averages, Bollinger and Keltner channels, Supertrend, RSI, MACD, stochastic, ATR, OBV and more. Blocks with several lines give you each line on its own.

Higher timeframe

The close, high, low, EMA or RSI of a bigger candle, inside a strategy that runs on a smaller one.

Session and day filters

Trade only between the hours you set and on the days of the week you choose.

Stop and target

Stop loss and take profit as a percent or in multiples of the ATR, or the target as a multiple of the stop.

Trailing, break-even, time exit

Let the stop follow the price, move it to the entry once the trade is in profit, or close after a set number of bars.

Risk sizing

In the backtest, each trade is sized so that hitting the stop loses the percent of the balance you set.

Backtest it before you copy it.

BACKTEST → OUT OF SAMPLE → MONTE CARLO

01
Backtest

The script runs on real candles in your browser. You see the trades on the chart, the balance curve, the net result, profit factor, win rate and drawdown.

02
Out of sample

Hide the last 30% of the history, tune the strategy on the first 70%, then uncover the rest and see whether it still holds.

03
Monte Carlo

1,000 runs drawn at random from the backtest's trades show how much of the result could be luck.

A backtest is hypothetical. It shows what would have happened on past candles, not what will happen, and a good curve built on a handful of trades proves little.

The alert message is already in the script.

Every order the script places carries the JSON that SignalForge needs: the action, the symbol, the strategy name and, on entries, the lot. A buy from the example at the top sends this:

buy alert from the exampleJSON
{"action":"buy","symbol":"XAUUSD","lot":"0.1","strategy":"ema_cross"}

Closes send closebuy or closesell. In TradingView you create one alert on the strategy with {{strategy.order.alert_message}} as the message, and each order sends its own. More payloads by use case are in the payload library.

How it connects to MetaTrader 5.

The strategy builder writes the strategy and the SignalForge bridge executes it. When an alert fires on TradingView, the webhook reaches SignalForge, which routes the order to your MetaTrader 5 terminal. The rules you set in the bridge still apply on top of the script:

Prop Firm Shield

Auto-pause on daily loss limit breaches for FTMO, FundedNext and similar evaluations.

News filter

Pause trading around high-impact releases: NFP, CPI, FOMC.

Trailing stop & sizing

Trailing stop, trading-hours filter and dynamic lot sizing, configured in the EA, independent of the script.

The bridge decides the lot. SignalForge trades the lot in the alert only when the account takes its size from the signal; with a fixed lot or a percent of risk set in SignalForge, that size is the one traded. New to the bridge? Start with connecting TradingView to MT5.

Writing Pine by hand vs SFBuilder.

Writing Pine by hand
SFBuilder
Learning curve
Days to weeks of Pine Script docs
Pick blocks from a list
Pine Script v6 syntax
You track every version change
Written for you in v6
MT5 alert message
Write and format it by hand
Already on every order
Testing
TradingView Strategy Tester
Backtest, out of sample and Monte Carlo in the browser
Flexibility
Anything Pine can do
What the blocks cover
Cost
Free
Build and backtest free; copying needs a plan or the trial

What it costs.

BUILDING AND TESTING ARE FREE

No account
Freebuild and backtest
  • Every indicator, filter, exit and sizing option
  • Backtest on real candles, out-of-sample split and Monte Carlo
With your plan
Copythe script and the alert
  • Copy or download the Pine Script v6 and its alert message
  • Starter, Trader, Pro or Elite, or the 14-day free trial

SFCloud-only accounts do not include copying. Subscribers open the builder from dashboard.signalforge-ai.com/builder. Plan prices are on the pricing page.

FOUR THINGS THAT GO WRONG

Common mistakes and tips.

01

Trusting a handful of trades

A backtest with few trades proves little, however good the curve looks. The builder warns you when there are fewer than 30.

02

Tuning until the curve looks perfect

Every setting you tweak to fit the past makes the result less reliable. Tune on the first 70% of the history and check the hidden 30% before you trust it.

03

Going live without a demo

Run the strategy on a demo MT5 account first: check the symbol mapping, the lot size and that stops and targets land where you expect.

04

The wrong alert message

In TradingView the alert message has to be {{strategy.order.alert_message}}. With any other text, buys and closes all send the same message.

FAQ

Quick questions.

Is there still an AI Pine Script generator in SignalForge?

+
No. The AI Script Builder was retired on 20 November 2026. The strategy builder replaced it: you build the strategy from blocks and no AI writes the code.

Is the strategy builder free?

+
Building and backtesting are free and need no account. Copying or downloading the Pine Script and the alert message need a SignalForge plan (Starter, Trader, Pro or Elite) or the 14-day free trial.

Does the script work with MetaTrader 5?

+
Yes. Every order in the script carries the SignalForge alert message. Create a TradingView alert with {{strategy.order.alert_message}} as the message and your SignalForge webhook URL, and the bridge places the order on MT5.

Will a good backtest make money live?

+
Not necessarily. A backtest is hypothetical: it shows what would have happened on past candles. Check it out of sample, then run it on a demo account before you risk real money.

Conclusion: test the idea before you trade it.

You do not need to learn Pine Script to trade a Pine Script strategy. Build it from blocks, look at the backtest, the out-of-sample split and the Monte Carlo run, and copy the script once it holds up. The SignalForge bridge then executes it on MetaTrader 5 with your Prop Firm Shield and risk rules on top. Open the strategy builder, or start the 14-day free trial to copy the script.

B
Benjamin SF · Founder of SignalForge
FOUNDER · SIGNALFORGE AI · ALICANTE

Benjamin is the founder of SignalForge. With extensive experience in algorithmic trading and MetaTrader 5 infrastructure, he designs high-performance tools that bridge analytical platforms with precise execution environments. He built the strategy builder so a trader can turn an idea into a tested, MT5-ready TradingView strategy without writing code.

Build your first strategy from blocks

Build and backtest free, no account needed. Copy the Pine Script with your SignalForge plan or the 14-day free trial.

Backtest results are hypothetical and do not guarantee future results. Test on a demo account before going live. SignalForge AI is an order-execution tool and does not provide investment advice. Trading involves risk of loss.

SFBuilder: build and backtest free · copy with your planOpen →