kotak-logo
Products
Platform
Research
Market
Learn
Partner
Support
IPO
TradingView Simplified Logo Light Mode

Kotak

Stockshaala

Module 7
Pine Script – Build & Backtest
Course Index
Read in
English
हिंदी

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

You can find community-built Pine Script™ indicators and strategies directly on TradingView.

Here’s how:

  1. Open TradingView
  2. Click on the “Indicators” button
  3. Switch to the “Community Scripts” tab
  4. Search for keywords like “EMA crossover,” “RSI strategy,” or “Breakout scanner”
  5. 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.

  • 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
  1. Add the indicator to your chart
  2. Open the Pine Editor tab
  3. Click the dropdown arrow next to the script name
  4. Choose “Make a Copy”
  5. You’ll now have full access to the script in the editor
  6. 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.

  • 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”)

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.

Is this chapter helpful?
Previous
Backtesting Do’s & Don’ts (Bias, Interpretation, Metrics)
Next
Limitations, Workarounds & When to Switch to Algo Tools

Discover our extensive knowledge center

Explore our comprehensive video library that blends expert market insights with Kotak's innovative financial solutions to support your goals.

PreviousCourse IndexNext