The plotchar() function in TradingView's Pine Script is a handy tool that lets you place little symbols and characters right on your chart. Think of it like leaving yourself sticky notes on specific price bars to highlight when something important happens.
It's perfect for those moments when you want to quickly spot a buy or sell signal, double-check that your trading strategy is working as expected, or even just debug your script by seeing exactly where a condition becomes true.
What makes plotchar() special is its flexibility. While other functions might limit you to basic shapes like circles or crosses, this one lets you use almost any character you can think of—letters, numbers, or even fun symbols. The default is a simple star (★), but you can easily swap it for something else like a heart (❤), an arrow (⬆), a flag (⚑), or a snowflake (❄).
Here's a quick look at how it compares to a similar function:
| Feature | plotchar() | plotshape() |
|---|
| What it plots | ASCII/Unicode characters | Predefined shapes (arrows, circles, etc.) |
| Customization | Very high - use any supported character | Limited to the available shapes |
| Best for | Detailed notes, unique markers, debugging | Quick, simple visual cues |
The real power of plotchar() comes from its ability to mark a chart with pinpoint accuracy. You tell it what condition to look for and which character to use, and it takes care of the rest, making your technical analysis and strategy building that much clearer.