

Kotak
Stockshaala
Chapter 6 | 3 min read
Tweaking & Using Public Pine Scripts
You don’t have to build everything from scratch.
Thousands of Pine Script™ indicators and strategies are already shared publicly on TradingView. Many of them are open-source, which means you can read, edit, and reuse the code for personal learning or experimentation.
However, any public distribution or monetization of reused content must comply with the open-source license included by the script’s original author.
In this chapter, you’ll learn how to:
- Find public scripts
- Understand and tweak them
- Use them in your charts or strategies
Where to Find Public Pine Scripts™
You can find community-built Pine Script™ indicators and strategies directly on TradingView.
Here’s how:
- Open TradingView
- Click on the “Indicators” button
- Switch to the “Community Scripts” tab
- Search for keywords like “EMA crossover,” “RSI strategy,” or “Breakout scanner”
- You’ll see a list of indicators and strategies created by other users
? Pro Tip:
You can also find community scripts using the search bar at the top of TradingView’s homepage. Just type your keyword (like “RSI strategy”) and navigate to the Scripts section in the results.
How to Preview & Add to Chart
- Click on any script → You’ll see a brief description and chart preview
- If it looks useful, click “Add to Chart”
- If it has an open-source icon (</>), it means the code is visible and editable
How to View and Edit a Public Script
- Add the indicator to your chart
- Open the Pine Editor tab
- Click the dropdown arrow next to the script name
- Choose “Make a Copy”
- You’ll now have full access to the script in the editor
- Rename it and tweak the logic freely
You can now:
- Change indicator settings
- Add/remove alerts
- Modify logic (e.g., change RSI period from 14 to 21)
- Add your own signals, plots, or conditions
Example: Tweaking an EMA Crossover Script
Let’s say a public script has this logic:
fastEMA = ta.ema(close, 9)
slowEMA = ta.ema(close, 21)
buy = ta.crossover(fastEMA, slowEMA)
You can change it to:
fastPeriod = input.int(10, title="Fast EMA")
slowPeriod = input.int(30, title="Slow EMA")
fastEMA = ta.ema(close, fastPeriod)
slowEMA = ta.ema(close, slowPeriod)
buy = ta.crossover(fastEMA, slowEMA)
Now that it’s more flexible, you can adjust periods directly from the UI.
What to Watch Out For
Too complex to understand | Start with simpler, shorter scripts |
Strategy with repainting | Avoid scripts that rely on high, low, close of the future bar |
Non-editable scripts | These can be used, but not modified |
Attribution required | Respect original creators if re-sharing modified versions |
Smart Tips
- Start with indicators, then explore strategies
- Look for scripts with high likes or comments—they’re often well-tested
- Always test modified scripts using Strategy Tester before using them
- Save your tweaked version under a new name (e.g., “EMA Cross v2 – YourName”)
To Sum Up
Using public Pine Scripts™ gives you a huge head start. You can learn by reverse-engineering, test what works, and tweak things to match your style without reinventing the wheel.
Once you’re confident editing scripts, you’re no longer just a user of TradingView…
You’re building your own trading toolkit.
Note: Pine Script™ is a trademark of TradingView Inc.
Recommended Courses for you
Beyond Stockshaala
Discover our extensive knowledge center
Learn, Invest, and Grow with Kotak Videos
Explore our comprehensive video library that blends expert market insights with Kotak's innovative financial solutions to support your goals.














