Differences from Pine Script

Use this page when a script does not do what you expected. The side-by-side examples are on BullScript™ and Pine Script.

What stops#

study() is not a function. A script that starts with it does not run. Use indicator() or strategy().

A library import runs only when that library's source is given to the engine. A chart script and a connected app do not supply one, so import User/Lib/1 stops with the message that the library is not available. A script you write cannot import another member's library from the chart.

What you can write#

var keeps a value from one bar to the next.

bullscript-run
1//@version=6
2indicator("Var", overlay=true)
3var x = 0
4x := x + 1
5plot(x)

On a chart that has one value per bar, varip also steps once per bar. That run does not show a separate update for each tick of the bar that is still forming.

A user-defined type, a method, and switch run.

bullscript-run
1//@version=6
2indicator("Type and method", overlay=true)
3type point
4 float x
5 float y
6method plus(float a, float b) => a + b
7p = point.new(1.5, 2.5)
8plot(p.x.plus(1))

enum runs. max_bars_back(close, 500) runs. for v in array.from(1, 2, 3) runs. A tuple from ta.macd runs.

nz(na, 3) is 3.

The first bars of a moving average can be empty, until there are enough bars to calculate it.

Another market#

request.security without the other market's bars stops and says no data for symbol. Pass ignore_invalid_symbol = true when you want na instead. On Charts, alerts, backtests, and a connected app, Bullmania loads those bars for you. The limit is 40 symbol and timeframe combinations. The wording, and how lookahead and gaps work, is in the reference a connected app reads.

request.dividends and request.financial are empty on a chart that only has prices. These pages do not describe a source that would fill them in.

Extras you can use here#

log.info, log.warning, and log.error write lines the run returns. runtime.error("message") stops the script with your own message. Future bars and full-height zones are on Future dates.

Strategy#

The Pine Script v6 strategy functions, variables, and constants each run on this engine. All of them ran. Each name has a page under strategy, and the editor lists those names. A name that is not one of them, such as a made-up member, stops at that line.

Library import is still refused. See What stops above. You still cannot import a library.

Strategy names that did not run#

None.

Volume#

When a script reads volume and the chart has none, you see: "This script uses volume, but this chart has no volume data."

Bullmania is not affiliated with, endorsed or sponsored by TradingView. Pine Script and TradingView are trademarks of TradingView, Inc.