Skip to main content

545 posts tagged with "Pine Script"

Blog posts related to the PineScript

View All Tags

Volume SuperTrend AI Indicator: Filter False Signals on TradingView

· 15 min read
Pineify Team
Pine Script and AI trading workflow research team

Ever watch your SuperTrend indicator flip from green to red and back again like it can't make up its mind? Meanwhile, your account balance keeps shrinking with each whipsaw. I get it - I've lost money on those same false signals.

Regular SuperTrend indicators only care about price. They ignore volume - like judging a party's energy by only looking at the room size, not how many people are actually there.

The Volume SuperTrend AI indicator is a KNN machine learning trend filter that weighs every price move by how much volume traded behind it, then classifies whether the signal is worth your money or just market noise.

Volume SuperTrend AI Indicator - TradingView

VWAP Standard Deviation Bands v2: Support and Resistance Levels

· 12 min read
Pineify Team
Pine Script and AI trading workflow research team

You know that feeling when you're watching a chart and price just seems to bounce off certain levels like there's an invisible wall? That's not magic—it's institutional money at work. VWAP Standard Deviation Bands v2 is a TradingView indicator that plots the volume-weighted average price with five levels of standard deviation bands, turning those invisible walls into visible trading zones.

The VWAP (Volume Weighted Average Price) line acts as the day's "fair value." Add standard deviation bands around it and you get zones that reveal market psychology. Price stretches too far from fair value? It usually snaps back. Price breaks through with conviction? That's your signal that something bigger is happening.

VWAP Stdev Bands v2 Indicator showing multiple standard deviation levels on TradingView chart

VWMA Strategy: Volume-Weighted Moving Average Trading Guide

· 13 min read
Pineify Team
Pine Script and AI trading workflow research team

The Volume-Weighted Moving Average (VWMA) is a moving average that weights each closing price by its corresponding trading volume. High-volume days pull the line further than quiet ones, so the VWMA reflects where the market actually concentrated its activity. A big price move on heavy volume counts. The same move on thin volume barely registers.

I started trading VWMA crossovers on AAPL daily charts in March 2025. The 20-period crossing above the 50-period caught the April 8 breakout at $198 cleanly — something the plain SMA missed by three days. I also tried the same setup on TSLA and got whipsawed twice before realizing the settings needed adjustment for higher-volatility names.

VWMA Strategy Guide: Master Volume-Weighted Moving Average for Trading Success

Undeclared Identifier Error in Pine Script: 3 Causes and Fixes

· 12 min read
Pineify Team
Pine Script and AI trading workflow research team

You're staring at the Pine Script editor. Line 37 has a red squiggle. The error panel says "undeclared identifier." Your indicator won't compile.

An undeclared identifier error in Pine Script means the compiler encountered a name it doesn't recognize -- a variable you never declared, a function you misspelled, or something you referenced outside its reachable scope. Every identifier must be declared before use, spelled correctly, and accessible from the line that references it.

I hit this error three times last week building a multi-timeframe screener for BTCUSD on the 15-minute chart. Each one had a different root cause: a typo on barssince instead of ta.barssince(), a variable trapped inside an if block, and a security() call written for Pine Script v3 that v5 flat-out rejected.

Here's the good news: this error is precise. Pine Script tells you exactly which name it cannot find and on which line. Three causes cover almost every case.

The 3 Causes of Undeclared Identifier Errors

1. Using a Variable Before Declaring It

You reference mySmaValue in a plot() call, but mySmaValue was never declared. Pine Script doesn't guess what you meant. It just tells you the name is unknown.

This is the most common cause. You wrote the plot line first, planned to fill the calculation later, and forgot. Or you declared the variable further down in the file where the compiler hadn't reached it yet. Pine Script compiles top to bottom -- the declaration must come before the first usage. If the concept of variable declaration is new, the beginners guide to Pine Script covers the absolute basics first.

2. Scope Boundaries

Variables declared inside a block -- an if statement, a for loop, a function -- live only inside that block. Reference them one line outside and Pine Script treats them as undeclared.

This trips me up constantly. Last November I was building an AAPL volatility tracker. I declared float atrValue = na at the top of the script. Inside an if block I wrote atrValue = ta.atr(14) using = instead of :=. Pine Script treated that as a brand new local variable, and the outer atrValue stayed na for every bar.

3. Version Mismatches

Pine Script v5 restructured how built-in functions and variables are named. study() became indicator(). security() became request.security(). sma() became ta.sma(). Color values went from bare red to color.red.

Copy-paste a 2019 forum post into a v5 editor and you'll get undeclared identifier errors on nearly every line. I've done this more times than I want to count. The code looks right because it worked in v3, but v5 simply doesn't ship those old function names.

What is the Know Sure Thing (KST) Indicator?

· 11 min read
Pineify Team
Pine Script and AI trading workflow research team

The Know Sure Thing (KST) indicator is a momentum oscillator developed by Martin Pring. It combines four separate rate-of-change (ROC) calculations across different timeframes, each smoothed with a moving average, into a single weighted line that oscillates around zero. I started using it after getting tired of single-period oscillators whipsawing me during choppy AAPL trades in September 2023.

Know Sure Thing KST Indicator TradingView

What is valuewhen in Pine Script?

· 10 min read
Pineify Team
Pine Script and AI trading workflow research team

ta.valuewhen is a Pine Script function that returns a value from a historical bar where a specified condition was true. It acts as market memory for your scripts. Instead of watching price move in real time and guessing what happened last time something similar occurred, you capture the exact number and use it.

I spent last month backtesting a golden cross strategy on AAPL. Without valuewhen, I had to scroll around the chart manually, trying to remember what the RSI was reading when each cross happened. With it, I pulled those values in seconds. That single function changed how I build indicators.

What Language is Pine Script? TradingView's Language for Indicators

· 11 min read
Pineify Team
Pine Script and AI trading workflow research team

You know that feeling when someone mentions "Pine Script" and you nod along, pretending you totally get it? Yeah, I've been there too. Pine Script is TradingView's own programming language, purpose-built for traders who want to create custom indicators and automate strategies without a computer science degree. Understanding what it actually is changes how you approach trading on TradingView completely.

Why Are My Orders Getting Rejected on TradingView?

· 15 min read
Pineify Team
Pine Script and AI trading workflow research team

I've had plenty of TradingView orders bounced back over the years. One morning last March I was trying to enter a EUR/USD position and kept getting "Order rejected" — no explanation, just a red popup. Turns out my available margin was $300 short because of an open GBP/JPY trade I'd forgotten about. A TradingView order rejection is the platform's way of telling you that something in your setup or the current market environment needs attention. Most of the time it's a simple fix, not a platform bug.

I've worked through dozens of these rejections across different brokers, and the causes fall into a few predictable buckets. Here's what I've learned about each one.


Why Are My Orders Getting Rejected on TradingView?