Edgoro
Compile error · Old code in v6 (v4 and v5 to v6)

Pine Script v6: no argument named transp (fix)

Pine Script v6 removed the transp argument from plot(), bgcolor(), fill() and plotshape(). Set the transparency with color.new() instead.

Pine Editor console · line 3
The "bgcolor" function does not have an argument with the name "transp"

Cause

transp set the transparency of plots in v4. Pine Script v5 deprecated it, and v6 removed it from bgcolor(), fill(), plot(), plotarrow(), plotchar() and plotshape().

Broken code

TradingView reports the error on line 3.

Pine Script v6
//@version=6
indicator("Candle background", overlay = true)
bgcolor(close > open ? color.green : color.red, transp = 85)

Fixed code

The same script, corrected for Pine Script v6. Paste it into the Pine Editor and save.

Pine Script v6
//@version=6
indicator("Candle background", overlay = true)
bgcolor(close > open ? color.new(color.green, 85) : color.new(color.red, 85))

Why it works

Transparency is now part of the color itself. color.new(color, transp) returns the same color with a transparency from 0 (opaque) to 100 (invisible), and it works everywhere a color is accepted, including labels, lines, boxes and tables. For a custom color, color.rgb(red, green, blue, transp) does the same.

Other plot functions

The message names the function you called: The "plot" function does not have an argument with the name "transp" for plot(), and so on. The fix is the same everywhere: remove transp and wrap the color in color.new().

Questions

How do I make a plot transparent in Pine Script v6?

Pass a color created with color.new(), for example plot(close, color = color.new(color.blue, 70)). 0 is opaque and 100 is fully transparent.

Why did transp work in my v5 script?

v5 still accepted it as a hidden, deprecated argument. v6 removed it completely. The Pine Editor's v5-to-v6 converter deletes transp arguments, so check the colors after converting.

The scripts on this page are minimal examples written to show the error and its fix, not trading systems. Trading involves substantial risk of loss and is not suitable for every investor. Edgoro is a software tool, not a broker or financial adviser: nothing it produces is investment advice, and past or backtested performance does not guarantee future results.

Still getting an error?

Paste your script and the message into the free Pine Script error fixer: it explains what went wrong and returns a corrected v6 version. Or describe the indicator in plain English and let Edgoro write the code.