Indicator · Pine Script v6 · On the chart

NO.1 Perfect Buy/Sell

by vedkanani123

A price-chart indicator that stays always in one direction after the first confirmed mark: a buy exits shorts and holds long until the next sell, and the reverse.

View on GitHub

Repaints

GitHub stars1on the repository
Pine versionv6current
Lines of code663
Settings17inputs
LicenceNone stated
Last update2 months ago23 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

NO.1 Perfect Buy/Sell uses a causal trail, trend, range and shock regime detection, a score threshold and an optional completed higher-timeframe Supertrend filter. It draws the trail and cloud, stop and 1R, 2R and 3R boxes, labels, bar colours, regime shading and a dashboard. Settings auto-tune to the chart timeframe.

Details

Published by

vedkanani123 on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Reads higher-timeframe data with lookahead on, so the history can show signals that were not there in real time

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Auto-adapt to chart timeframebooltrueuseAuto
Require completed HTF SupertrendbooltrueuseHtf
Auto-select HTFbooltrueautoHtf
Manual HTFtimeframe60manualHtf
HTF Supertrend factorfloat3.10htfFactor
Only 07:00–17:00 UTC (optional)boolfalseuseSession
Allow high-quality RANGE-edge flips (off on M1)booltrueallowRangeFlip
Trail x ATR (0 = auto)float0.0trailIn
Min score (0 = auto)int0scoreIn
Use volume when the symbol has itboolfalseuseVolume
Causal trailbooltrueshowTrail
Trail cloudbooltrueshowCloud
Show all 17 settings
SettingTypeDefaultVariable
SL / 1R / 2R / 3R boxesbooltrueshowBoxes
BUY / SELL labelsbooltrueshowLabs
Color bars by statebooltruecolorBars
Shade RANGE / SHOCKbooltrueshowBg
DashboardbooltrueshowDash
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

92 stars

This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It

Indicator v5 Volatility & bandsTrend
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Regime & Trap
46 stars

This indicator uses a Hidden Markov Model (HMM) framework combined with an adaptive dual moving average engine and Directional Movement Index (DMI) features to identify market regimes (bullish, bearish, or ranging/chop). It calculates regime probabilities on e

Indicator v5 AI / machine learningTrend
Updated 7 weeks ago · None stated GitHub repository of HMM Enhanced: Regime Probability
43 stars

This indicator calculates standardized trend strength and historical volatility to estimate position sizes. It computes the differences between three user-defined EMAs standardized by price using MACD logic, while historical volatility is derived from the stan

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility v2

This overlay indicator plots a SuperTrend-style band on the price chart using ATR length, a selectable source, and a base factor. Optional settings enable an adaptive factor driven by rate of change, a volatility filter, K-means clustering, and an LSTM layer w

Indicator v6 TrendVolatility & bands
Updated 4 months ago · MIT GitHub repository of ML SuperTrend (Ultimate) - Auto-Optimized AI with LSTM

Adaptive Fair Value Cloud calculates a volatility-adaptive fair value channel around a selectable centerline, such as KAMA, EMA, linear regression, or VWMA. It blends ATR and mean deviation with volatility percentiles and trend sensors, including ADX, Efficien

Indicator v6 Volatility & bandsTrend
Updated 2 days ago · MIT GitHub repository of Adaptive Fair Value Cloud [WavesUnchained]

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers