• Products
  • Community
  • Markets
  • Brokers
  • More
Get started
  • Community
  • /Indicators and strategies
  • /Longtermsetup

Longtermsetup

Fetch Buy And Hold StrategyThis script was created as an experiment using ChatGPT. I actually woudn't recommend using the ai program to help you with your Pinescripts, as it makes a fair amount of mistakes. It was a fun experiment however. The script is a simple buy and hold tool. Here's what it does: - Everytime the rsi enters below the set treshold, a counter increases. - The second increase of the counter happens when the price goes above the treshold, and then dips below the treshold again. - The program would fire off a buy signal when the counter hits the number 3. - After the buy. the counter will reset. Lets take a look at the following example where the rsi treshold is 30: - So the rsi dips below 30 and the initial counter is set from 0 to 1. - The price rises which brings the rsi back to 40. - Then another dip happens and the rsi is now 25, increasing the counter from 1 two. - Rsi now dips to 23 and nothing happens. - Rsi goes back up to 31, and dips back to 28 which puts the counter at 3. A buy singal is now fired and the counter is set to 0.
Pine Script® indicator
by FetchTeam
22

Select market data provided by ICE Data services. Select reference data provided by FactSet. Copyright © 2025 FactSet Research Systems Inc.© 2025 TradingView, Inc.

More than a product
  • Supercharts
Screeners
  • Stocks
  • ETFs
  • Bonds
  • Crypto coins
  • CEX pairs
  • DEX pairs
  • Pine
Heatmaps
  • Stocks
  • ETFs
  • Crypto
Calendars
  • Economic
  • Earnings
  • Dividends
More products
  • Yield curves
  • Options
  • News Flow
  • Pine Script®
Apps
  • Mobile
  • Desktop
Community
  • Social network
  • Wall of Love
  • Refer a friend
  • House Rules
  • Moderators
Ideas
  • Trading
  • Education
  • Editors' picks
Pine Script
  • Indicators & strategies
  • Wizards
  • Freelancers
Tools & subscriptions
  • Features
  • Pricing
  • Market data
Trading
  • Overview
  • Brokers
Special offers
  • CME Group futures
  • Eurex futures
  • US stocks bundle
About company
  • Who we are
  • Manifesto
  • Athletes
  • Blog
  • Careers
  • Media kit
Merch
  • TradingView store
  • Tarot cards for traders
  • The C63 TradeTime
Policies & security
  • Terms of Use
  • Disclaimer
  • Privacy Policy
  • Cookies Policy
  • Accessibility Statement
  • Security vulnerability
  • Status page
Business solutions
  • Widgets
  • Charting libraries
  • Lightweight Charts™
  • Advanced Charts
  • Trading Platform
Growth opportunities
  • Advertising
  • Brokerage integration
  • Partner program
  • Education program
Community
  • Social network
  • Wall of Love
  • Refer a friend
  • House Rules
  • Moderators
Ideas
  • Trading
  • Education
  • Editors' picks
Pine Script
  • Indicators & strategies
  • Wizards
  • Freelancers
Business solutions
  • Widgets
  • Charting libraries
  • Lightweight Charts™
  • Advanced Charts
  • Trading Platform
Growth opportunities
  • Advertising
  • Brokerage integration
  • Partner program
  • Education program
Look FirstLook First