FAQ

How to write your first, simple backtrader strategy

Pine

How to Enter/Exit Positions on Bar Close in Pine Script Strategies

Order placement commands are quite important to your TradingView strategy. But many people are surprised by the default behavior of PineScript when it executes market orders. Sample Strategy  For an illustration, the Pine Script code below highlights a super simple strategy.  In this strategy, we enter and exit long positions using market orders. We also How to Enter/Exit Positions on Bar Close in Pine Script Strategies Read More →

How to fix “Value with NA type cannot be assigned to a variable that was defined without type keyword.”

You can receive this error by running this simple code: Add to Chart operation failed, reason: line 5: Value with NA type cannot be assigned to a variable that was defined without type keyword The issue is that PineScript doesn’t know what type should this variable be. It can’t guess the type from the NA How to fix “Value with NA type cannot be assigned to a variable that was defined without type keyword.” Read More →

How to fix the `transp` argument will be deprecated soon error?

You may have noticed the following warning message in your PineScript indicator scripts: The `transp` argument will be deprecated soon. We recommend using color.new() or color.rgb() functions to specify the transparency of the plots instead. Below is an example of code that causes this warning. Why does this error occur? This warning message occurs simply How to fix the `transp` argument will be deprecated soon error? Read More →