A Perfectly Simple Risk CalculatorA Perfectly Simple Risk Calculator
I use bad risk.
I learned my lesson.
This tool will tell me how many contracts to use according to my risk amount.
Thank you Grok for writing me this code.
التحليل الأساسي
Empyrean - Strat 1minGood for bot trading. 1min TF, with 15min confluence. Setting are here
22
Min Pivot Size x ATR
0.1
Enable TF1
Resolution TF1
15
Use SMA
SmaLen
23
ADX Length
21
ADX Threshold
20
ATR Baseline Length
2
TP * ATR
5.5
SL * ATR
1.5/3
Price % Change from Time HighDisplays the following.
Highest in Last (interval)
Current Price:
% From High:
% To High:
% From (internal) Chart High:
WC Cross Clouds with Arrows - Customizable EditionThis is an enhanced and fully customizable version inspired by the original "WC CROSS CLOUDS with Arrows" indicator by AlfsDipz (thank you for the great foundation!).
What it shows:
• Two clouds for visual trend context:
- Static black WMA cloud (default WMA 21 & 24) – helps identify overall market structure
- Directional cloud (default SMA 9 & 21, but fully configurable) – green when fast MA is above slow MA (bullish), red when below (bearish)
• Clean signals with arrows + text:
- Green triangle up + "LFG" → New bullish regime starts (fresh crossover upward)
- Red triangle down + "DBD" → New bearish regime starts (fresh crossover downward)
• Small realtime label showing current regime + bars since last signal
New features / improvements compared to original:
• Fully user-configurable MA lengths for both clouds
• Choose MA type for the directional cloud (SMA, EMA, or WMA)
• Customizable source (close, hl2, open, etc.)
• Cleaner signal logic (only shows arrows when trend direction actually changes)
• No duplicate/false signals during ranging markets
• Works in Pine Script v6 (latest version)
How to use:
- Green cloud + "LFG" arrow → potential long opportunity
- Red cloud + "DBD" arrow → potential short / exit long
- Use together with your own price action, support/resistance, volume, etc.
Feel free to use, modify, expand, fork, or build upon this script however you like!
Credit to AlfsDipz for the original concept and cloud style that inspired this version.
Happy trading everyone!
Dove– Chesapeake, VA
BTC/M2 Fire Sniffer (Liquidity Range Z-Score)Howdy Fella. Great to see you here, exploring the true data in CRYPTOCAP:BTC analysis.
To ensure a perfect view on the markets, here are a few tips on how to fine tune the Fire Sniffer:
- Z-Score Lookback: 40
- Liquidity Ratio SuperSmoother Length: 8
- Z-score SuperSmoother Length: 132
Set the ranges as following:
Mean: -0.53
Liquidity Cycle Top: 0.8
Liquidity Cycle Bottom: -0.65
With that, you are set to go. Enjoy and make sure to let me know your thoughts on the script. You can contact me on X: @thebitcoinfrontier
RSI Momentum SignalRSI Momentum Signal is a technical analysis indicator designed to highlight potential momentum-based reversal points using the Relative Strength Index (RSI).
This script combines short-term RSI momentum behavior with basic candle structure to visualize possible bullish and bearish reaction zones directly on the chart.
How It Works
A fast RSI-based momentum calculation is used to color price bars when short-term momentum reaches extreme levels.
Buy and Sell signals are generated when momentum conditions align with RSI overbought or oversold levels and basic candle direction.
All signals are plotted visually on the chart to support discretionary analysis.
Intended Use
This indicator is not a standalone trading system.
It is designed to be used as a supportive analytical tool together with other technical analysis methods such as trend structure, price action, and support/resistance levels.
Disclaimer
This script does not provide financial advice and does not guarantee any trading results.
All trading decisions remain the sole responsibility of the user.
Use this indicator for educational and analytical purposes only.
EMA / SMA (Configurable + Labels)EMA / SMA (Configurable + Labels)
Trader can draw 2 EMA lines and 1 SMA line, with configurable lengths and labels.
ORB Algo | WolfOfFuturesThis Script is an updated version of the Flux Charts ORB Algo
15min ORB default
4EMA breakout Condition
Dynamic TP Default
Blockcircle Global Central Bank Balance Sheet and Money SupplyOVERVIEW
This indicator aggregates money supply (M2) and central bank balance sheet data from the world's largest economies into a single, unified view of global liquidity conditions. Rather than manually tracking dozens of separate data feeds or building your own aggregation logic, you get a ready-to-use tool that pulls from FRED, TradingView Economics, and real-time FX rates to convert everything into USD terms automatically.
Global liquidity has historically served as a leading indicator for risk assets. When central banks expand their balance sheets and the money supply grows, capital tends to flow into equities, crypto, and other risk-on assets. When liquidity contracts, markets often follow. This indicator gives you that macro context directly on your chart.
The global liquidity movement (expansionary or contractionary) often leads to asset price appreciation/depreciation in CRYPTOCAP:BTC , SP:SPX , etc
WHAT MAKES IT ORIGINAL AND DIFFERENT
Combines both M2 money supply AND central bank balance sheet data in one place, whereas most existing tools focus on only one metric
Aggregates 11 economies for M2 (USA, EU, China, Japan, UK, Canada, India, Russia, Brazil, Australia, Switzerland) and 10 central banks for balance sheet data
Automatically handles currency conversion using live FX rates so all values display in USD
Includes a dedicated US Net Liquidity calculation (Fed Balance Sheet minus Reverse Repo minus TGA) which filters out temporary distortions that other aggregate tools ignore
Provides granular country by country breakdown in the information table so you can identify which central banks are driving the aggregate trend
Offers four moving average types (SMA, EMA, WMA, RMA) for trend smoothing with configurable length
HOW IT WORKS
The indicator requests monthly M2 data from TradingView's Economics feeds for each included country. Central bank balance sheet data is pulled the same way. All non-USD values are converted using daily FX rates from major currency pairs. The script then sums these converted values to produce the Global M2 and Global CBBS lines.
For US liquidity specifically, the script pulls weekly data for the Reverse Repo Program (RRP) and Treasury General Account (TGA) from FRED. Net Liquidity is calculated as: Fed Balance Sheet minus RRP minus TGA. This formula removes funds parked in reverse repos and Treasury cash balances, showing what is actually circulating in the financial system.
KEY FEATURES
Global M2 Money Supply line tracking 11 major economies with individual toggles for each country
Global Central Bank Balance Sheet line tracking 10 central banks with individual toggles
US-specific components, including Reverse Repo, TGA, and Net Liquidity as separate plot lines
Moving average overlays with selectable type and length for identifying trend direction
Fill the option between M2 and CBBS lines to visualize the gap between money supply and central bank assets
Value labels at line endpoints showing current readings and period-over-period percentage change
Comprehensive information table with optional country breakdown view
Full color customization for all lines, configurable line width, and style options
Alert conditions for significant M2 and CBBS changes plus MA crossover signals
HOW TO USE
Add to any chart and observe the overall direction of global liquidity. Rising lines generally support risk on positioning, while declining lines suggest caution
Watch for divergences between the M2 and CBBS lines. If money supply grows faster than central bank assets, private credit may be expanding. If CBBS rises faster, central banks are actively injecting liquidity
Use the US Net Liquidity line to understand short term dollar liquidity conditions separate from longer term global trends
Enable moving averages to filter noise and identify when liquidity trends are changing direction
Toggle individual countries on or off in the settings to see how specific regions contribute to the total
Reference the information table for exact values and percentage changes without leaving your chart
SETTINGS BREAKDOWN
Table Settings: position, text size, and whether to show the country breakdown
Display Settings: toggle visibility for each line, fill area, value labels, percent labels, and the info table
Line Styling: customize colors for each metric, adjust line width, and select solid, dashed, or dotted style
Moving Average: enable or disable MA overlays for M2 and CBBS, select MA type, and set length
Global M2 Countries: individually enable or disable each of the 11 economies
US Liquidity Components: toggle RRP and TGA data
Global CBBS Countries: individually enable or disable each of the 10 central banks
Alerts: set percentage threshold for change based alerts
IMPORTANT CONSIDERATIONS
Data updates depend on the publication schedule of each source. M2 and CBBS data are typically monthly with some delay. US Fed Balance Sheet, US RRP and US TGA update weekly
FX conversion uses daily close rates which may introduce minor discrepancies during volatile currency periods
Some emerging market data may have longer reporting lags than developed market data
Hope you find it useful and impactful to your trading and investment decisions! If you have any questions at all, please just ask, happy to help
Risk & Lot Calculator PanelFXMANS Risk & Lot Panel
Smart Risk Management Tool for TradingView
- Overview
FXMANS Risk & Lot Panel is a lightweight and professional risk management tool designed to help traders calculate position size (lot) and take-profit levels directly on the chart, without cluttering the screen.
The panel is displayed as a minimal table in the top-right corner of the chart and automatically adapts to the currently opened symbol.
This tool focuses on clarity, precision, and usability, making it suitable for scalpers, day traders, and swing traders.
- Key Features
Automatic Direction Detection
The script can automatically determine BUY or SELL direction based on:
Entry Price
Stop Loss Price
Logic:
Stop Loss below Entry → BUY
Stop Loss above Entry → SELL
Manual override is available if auto direction is disabled.
Risk-Based Lot Size Calculation
Calculates position size based on:
User-defined risk amount in USD
Distance between Entry and Stop Loss
Symbol-specific tick size and point value
Ensures consistent risk management across all markets.
Automatic Take Profit (RR Based)
Take Profit is calculated automatically using a predefined Risk / Reward (RR) ratio.
Supports both BUY and SELL scenarios.
- Symbol-Aware Calculation
Uses TradingView’s built-in symbol properties:
syminfo.mintick
syminfo.pointvalue
Works correctly on:
Forex
Indices
Metals
Crypto
- Minimal & Non-Intrusive UI
Small, fixed panel located at the top-right corner
Designed to avoid covering price action
Clean FXMANS-style color palette
- Safe Panel Size Control
Panel size can be adjusted from settings:
Small
Medium
Large
Size changes are handled without modifying layout geometry, preventing UI bugs.
- How It Works
Enter your Entry Price and Stop Loss Price
Define your Risk Amount ($)
Set your desired Risk / Reward ratio
The script automatically calculates:
Trade Direction (BUY / SELL)
Lot Size
Take Profit Level
All results are displayed instantly in the panel
- Example Use Case
Risk: $100
Entry: 1.0850
Stop Loss: 1.0800
RR: 2.0
- The panel will automatically display:
Direction: BUY
Lot Size adjusted to risk exactly $100
Take Profit at 2R
- Important Notes
Entry and Stop Loss prices must be valid (greater than zero).
The tool does not place trades automatically.
Calculations are for position sizing only and may vary slightly depending on broker specifications.
- Disclaimer
This script is intended for educational and analytical purposes only.
Trading involves risk, and users are responsible for their own trading decisions.
- Ideal For
Traders who follow strict risk management rules
Forex, crypto, and index traders
Scalpers and intraday traders
Anyone who wants clean and fast position sizing on TradingView
Full Dashboard V18 - Pro PA & Column CustomizationTable (Multi timefram)
- show Trend
- show rsi
- show Stoch
- show prev candle (default hide)
- show curr candle (default hide)
- shows the time when the candlestick will close.
- can config show/hide all column
Graph
- show rsi 89/21
Signal
- show signal with tp/sl (default hide)
SHFE vs COMEX Silver USD Spread (FX Adjusted)This indicator converts Shanghai Futures Exchange silver pricing (CNY per kilogram) into U.S. dollars per troy ounce using the live USD/CNY exchange rate. It compares the FX-adjusted Shanghai price with COMEX silver futures pricing and displays:
• Shanghai silver (converted to USD/oz)
• COMEX silver (USD/oz)
• The spread between the two markets (Shanghai − COMEX)
The tool helps visualize cross-market pricing differences and how currency movements influence silver valuation between Chinese and U.S. futures markets.
This is an analytical comparison tool and does not provide trading signals.
Notes:
• Requires access to SHFE and COMEX futures data on TradingView
• Uses USDCNY from the current chart (or selected FX symbol)
• Spread values are calculated mechanically from price and FX conversion
Pivot Points {xqweasdzxcv}Pivot Points {xqweasdzxcv}
This indicator plots classic Pivot Point levels (PP, S1–S3, R1–R3) using the previous period’s High, Low, and Close. The pivot timeframe is fully customizable (Daily, Weekly, Monthly, etc.), making it suitable for both intraday and swing trading.
The script automatically calculates:
Pivot Point (PP)
Three Support levels (S1, S2, S3)
Three Resistance levels (R1, R2, R3)
Each level can be individually toggled on or off, with customizable colors, line width, and line style. Price labels are dynamically displayed on the right edge of the chart for quick reference.
Designed for clean visuals and practical use, this tool helps identify key market reaction zones, potential reversals, and breakout areas across any timeframe.
Created by xqweasdzxcv.
Price Above VWAP FilterPrice above VWAP
this shows either a zero or one if the price is above or below the vwap
Bitcoin Halving Cycles [DotGain]Halving Cycles
A lightweight, time-anchored Bitcoin halving cycle visualizer built for clean charting, repeatable process planning, and simple profit/DCA timing references.
This Code was heavily inspired by KevinSvenson_ who created Bitcoin Halving Cycle Profit .
What this indicator does
This script plots the key “cycle landmarks” relative to each halving date:
Halving (⛏) – the cycle anchor
Profit START – marks the beginning of the post-halving profit window (default: 40 weeks )
Profit END / Last Call – marks the final phase of the profit window (default: 77 weeks )
DCA START – marks the point where long-term accumulation becomes the focus again (default: 135 weeks )
How to read it
Vertical lines = the exact cycle milestones
Bottom labels = description of each milestone aligned to its line (keeps the chart clean)
Green background (optional) = active Profit Zone on existing bars
Red background (optional) = optional warning zone after Profit END
HUD Panel (top-right)
The HUD gives you a fast “where are we in the cycle?” view with two modes:
Current Cycle
Shows: Halving date, Weeks since, and time remaining to Profit START / Last Call / DCA START within the current cycle.
Next Halving (Projection)
Shows: Countdown to the next enabled future halving, plus the projected weeks from today to Profit START / Last Call / DCA START after that future halving.
Future Halvings (manual)
You can manually add up to 3 future halving dates (Halving #1–#3).
This is useful for forward planning and cycle projection even before the event happens.
Enable Halving #1 / #2 / #3
Set Year / Month / Day for each
Optional: show/hide future markers & projections
Note: background zones only shade existing bars . Future projections are shown via lines/labels.
Settings overview
Show all cycles – plots every enabled cycle (historical + optional future). If disabled, only the current cycle is drawn.
Show Profit Zone background – green shading during the active profit window (current cycle only).
Show vertical markers + labels – toggles all milestone lines + labels.
Show HUD – toggles the HUD panel.
HUD Mode – switch between Current Cycle and Next Halving (Projection).
Cycle Logic – edit offsets in weeks (Profit START / Profit END / DCA START).
Optional Warning Zone – show a post-profit warning shading for a chosen number of weeks.
Have fun :)
Disclaimer
This Halving Cycles indicator is provided for informational and educational purposes only. It does not, and should not be construed as, financial, investment, or trading advice.
This indicator is an independent implementation of a time-based Bitcoin halving cycle visualization tool and is not affiliated with, or endorsed by, any third-party trading systems, strategies, protocols, or trademarked methodologies. The cycle zones, milestone markers, and countdown values displayed by this indicator are generated by a predefined set of algorithmic rules based on historical halving dates and user-defined time offsets. They do not constitute a direct recommendation to buy, sell, or hold any financial instrument or digital asset.
All trading and investing in financial markets involves a substantial risk of loss. You may lose part or all of your invested capital. Past performance does not guarantee future results. This indicator highlights historical and projected time-based market cycles and may produce false, lagging, incomplete, or misleading signals. Market behavior is influenced by many external factors and can deviate significantly from historical patterns or expectations.
The creator DotGain assumes no responsibility or liability for any financial losses, damages, or decisions made based on the use of this indicator or the information it provides. You are solely responsible for your own trading and investment decisions. Always conduct your own research (DYOR), use proper risk management, validate insights with additional tools or analysis, and consider your personal financial situation and risk tolerance before making any financial decision.
NY Open 60-Min VarBox + Pure ICT FVG V8This is little indicator that shows the NY-Stock Exc. opening candles with a vertical line and a label. It works for different time scales. It also finds the bullish FVGs. It is a good tool for those who follow the opening of the exchange.
Apexflow PRO: Anchored Fair Value + Regime Readiness [v6]## Apexflow PRO — Anchored Fair Value Cloud + Regime Readiness (Non-Repaint Signals)
**Apexflow PRO** is an overlay indicator built to answer one core trading question:
**“Is price currently cheap, fair, or expensive — and is the market in a regime where that matters?”**
Instead of throwing random signals at you, Apexflow PRO combines **anchored fair value**, **market regime detection**, **flow participation**, and **optional cross-market confirmation** into a single, easy-to-read system with a **Readiness Score (0–100)** and clean, non-spam alerts.
---
# What you see on the chart
### 1) Anchored Fair Value Cloud (the “tunnel”)
This is the heart of the indicator.
* **Midline = Anchored VWAP fair value**
* Resets by **Day / Week / Month** (you choose).
* **Cloud = 3-layer adaptive tunnel**
* **Core (blue)** = “fair pricing zone”
* **Upper red layers** = increasingly stretched/expensive
* **Lower teal layers** = increasingly stretched/cheap
**Interpretation (beginner-simple):**
* **Inside blue core** → “priced fairly”
* **Below the tunnel** → “cheap / discounted”
* **Above the tunnel** → “expensive / premium”
* **Outer layers** → “extreme stretch” zones (higher snap-back risk)
### 2) Regime label (context filter)
Apexflow labels the market environment as:
* **TRENDING**
* **CHOP/RANGE**
* **VOLATILE**
* **BREAKOUT**
This prevents “using the right tool in the wrong market.”
Example: mean reversion works better in chop; trend continuation works better in trend/breakout regimes.
### 3) Readiness Score (0–100)
This is the **strength of confluence** between the engines.
* Low score = mixed signals / noise
* High score = alignment / higher-quality conditions
### 4) BUY / SELL signals (non-spam)
Signals trigger only when:
* **Readiness crosses above your threshold** (first bar only)
* **Regime filter agrees**
* **Structure agrees** (reclaim midline / lose midline OR location within the tunnel)
* **Cooldown** prevents rapid repeats
---
# What’s behind it (advanced, but readable)
Apexflow PRO uses four engines:
## A) Anchored Fair Value Engine (core)
A true anchored VWAP-style accumulator:
* Aggregates **price × volume** and **volume**
* Resets on your chosen anchor period
* Produces a stable “fair value spine”
### Stable Mode (important)
When **Stable Mode = ON**, Apexflow **does not drift intrabar** on live candles.
The anchored midline and tunnel update on confirmed bar closes to avoid the classic “wiggling anchor” problem.
## B) Regime Engine (Trend/Chop/Breakout/Volatile)
Uses multiple independent measures (not just one):
* **ADX** = trend strength
* **Efficiency Ratio (ER)** = trend efficiency vs chop
* **BB Width %Rank** = compression / squeeze context
* **ATR %Rank** = volatility regime context
This produces both a **regime label** and a **regime confidence score** used in the composite.
## C) Flow Engine (participation + intent proxy)
A blended participation model:
* **Signed candle pressure** (body vs range scaled by volume)
* **Wick rejection bias** (rejection strength)
* **RVOL** (relative volume lift)
This helps distinguish “real moves” from low-quality drifts.
## D) Cross-Market Confirmation (optional)
A light macro filter to reduce false positives:
* **Equities:** VIX (inverse risk)
* **Forex:** DXY (inverse USD pressure)
* **Crypto:** BTC.D (risk tone proxy)
If the cross-market symbol is unavailable, the script **falls back gracefully** and automatically reduces its weight.
---
# How to use (simple rules)
## Trend Following mode (default)
Best when you want to ride directional moves.
**BUY idea:**
* Readiness crosses above threshold
* Regime is **TRENDING** or **BREAKOUT**
* Price is reclaiming the midline OR is occurring from the lower half of tunnel
**SELL idea:**
* Same logic in reverse (lose midline / upper half)
**Practical beginner rule:**
> In Trend mode, treat the midline like “bias.”
> If price is above the midline and score is strong → favor longs.
> If below and score is strong → favor shorts.
## Reversion mode
Best in chop/range markets.
* Signals are biased toward **mean reversion**
* Use tunnel extremes as “stretch zones”
* Targets often gravitate back toward the **midline / inner bands**
---
# Best settings & timeframes (starting points)
These are practical defaults (not magic):
### Crypto
* 15m / 1H / 4H
* Anchor Reset: **Week**
* Threshold: **60–70**
### Equities / Indices
* 5m / 15m / 1H
* Anchor Reset: **Day or Week**
* Threshold: **60–75**
### Forex
* 15m / 1H
* Anchor Reset: **Day**
* Threshold: **60–75**
If signals feel too frequent: raise **Threshold** or increase **Cooldown**.
If signals feel too rare: lower **Threshold** slightly or reduce **Cooldown**.
---
# Alerts
Included:
* **Apexflow PRO Long**
* **Apexflow PRO Short**
These fire only when the indicator triggers a confirmed, threshold-cross event (designed for clean alerting).
---
# Notes & limitations (honest)
* This is not a “predict the future” tool — it’s a **context + fair value + confluence** system.
* Cross-market filters are helpful, but not universal. If you trade niche assets, consider turning cross-market OFF or customizing the reference symbol.
* Always use risk management. A strong score is not a guarantee.
Oscillator [Scalping-Algo]█ POSTING OSCILLATOR
A squeeze momentum indicator that detects volatility compression and shows momentum direction.
█ HOW IT WORKS
This indicator combines Bollinger Bands and Keltner Channels to identify "squeeze" conditions — periods of low volatility that often precede explosive moves.
When Bollinger Bands contract inside Keltner Channels, volatility is compressing. When they expand back out, the squeeze "fires" and price typically makes a strong directional move.
█ HISTOGRAM COLORS
🟦 Bright Cyan — Positive momentum, increasing
🟦 Dark Cyan — Positive momentum, decreasing
🟪 Dark Purple — Negative momentum, increasing
🟪 Bright Magenta — Negative momentum, decreasing
█ SQUEEZE DOTS (ZERO LINE)
🟢 Teal — No squeeze (normal volatility)
⚫ Gray — Low squeeze
🔴 Red — Medium squeeze
🟠 Orange — High squeeze (breakout imminent)
█ HOW TO USE
1. Wait for squeeze dots (gray/red/orange) to appear
2. Watch which direction momentum is building
3. Enter when dots turn teal (squeeze fired)
4. Go long if histogram is cyan, short if magenta
5. Consider exit when colors fade (bright → dark)
█ BEST PRACTICES
• Works best on higher timeframes (1H, 4H, Daily)
• Combine with trend analysis and support/resistance
• Most reliable in trending markets
• Avoid trading against major levels
█ SETTINGS
Length: 20 (default) — Period for all calculations
Adjust based on your timeframe and trading style.
█ ALERTS
Set alerts for:
• Histogram crossing zero
• Squeeze firing (dot color change to teal)
• High squeeze detection (orange dots)
US Stock Market Performance by Sector[Dots3Red]This indicator displays the annual performance of the U.S. stock market by sector.
Selected major sectors
IND – Industrials
TECH – Technology
HTH – Healthcare
FIN – Financials
COMM – Communication Services
CONSCYC – Consumer Cyclical
CONSSTAP – Consumer Staples
ENERGY – Energy
REAL ESTATE – Real Estate
BASMAT – Basic Materials
The data is presented in a table below the main chart.
Green cell — the sector was bullish during that year
Red cell — the sector was bearish during that year
The table automatically sorts sectors by performance, placing the best-performing sector at the top for each year.
NOTE:
Annual performance is calculated starting from 2020 by default (arbitrarily chosen) and can be adjusted by the user.
200 EMA Scalping 1 MinuteOnly Scalping in 1 Minute Super accurate, low faults, Strict rule based management, in Nifty 50
Sharpe Ratio [Alpha Extract]A sophisticated risk-adjusted return measurement system that calculates annualized Sharpe Ratio with dynamic color-coded visualization distinguishing return quality across positive and negative performance regimes. Utilizing rolling period calculations with smoothed moving average comparison, this indicator delivers institutional-grade performance assessment with overbought/oversold threshold detection for extreme risk-adjusted return conditions. The system's four-tier color classification combined with histogram fills and background highlighting provides comprehensive visual feedback on whether current returns justify their volatility risk across varying market cycles.
🔶 Advanced Sharpe Ratio Calculation Engine
Implements classic Sharpe Ratio methodology measuring mean daily return divided by return standard deviation with annualization factor for consistent interpretation. The system calculates daily percentage returns, computes rolling mean and standard deviation over configurable periods, applies square root of 365 scaling for annualized comparison, and generates unbounded ratio values where higher positive readings indicate superior risk-adjusted performance.
// Core Sharpe Ratio Framework
Daily_Return = close / close - 1
Mean_Return = ta.sma(Daily_Return, Period)
StdDev_Return = ta.stdev(Daily_Return, Period)
Sharpe_Ratio = (Mean_Return / StdDev_Return) * sqrt(365)
🔶 Dynamic Four-Tier Color Classification
Features sophisticated color logic distinguishing between strong positive returns (green), weakening positive returns (yellow), weakening negative returns (orange), and strong negative returns (red) based on relationship to smoothed average. The system compares current Sharpe against SMA-smoothed baseline, applying green when positive and accelerating, yellow when positive but decelerating, orange when negative but improving, and red when negative and deteriorating for nuanced regime assessment.
🔶 Smoothed Baseline Comparison Framework
Implements SMA smoothing of Sharpe Ratio with configurable period to establish momentum reference line for trend determination within risk-adjusted returns. The system calculates simple moving average of raw Sharpe values, uses this smoothed line as directional benchmark, and determines whether current risk-adjusted performance is strengthening or weakening relative to recent average for color classification logic.
🔶 Extreme Threshold Detection System
Provides overbought and oversold level identification with configurable upper and lower bounds marking exceptional risk-adjusted return extremes. The system defaults to +4.3 for overbought threshold (extremely favorable risk-return profile) and -2.3 for oversold threshold (severely unfavorable risk-return profile), applying dashed horizontal reference lines and background highlighting when Sharpe breaches these statistical extremes requiring attention.
🔶 Histogram Fill Visualization Architecture
Creates gradient-filled histogram between Sharpe Ratio line and zero baseline using dynamic color matching with 30% transparency for intuitive positive/negative return distinction. The system fills area above zero with bullish colors (green/yellow) and below zero with bearish colors (orange/red), providing immediate visual confirmation of whether returns are compensating for volatility risk or destroying risk-adjusted value.
🔶 Background Zone Highlighting Framework
Implements subtle background coloring when Sharpe enters extreme overbought or oversold zones, alerting traders to statistically significant risk-adjusted return conditions. The system applies semi-transparent red background when ratio exceeds +4.3 (exceptionally strong risk-adjusted returns potentially unsustainable) and green background when below -2.3 (severely poor risk-adjusted returns potentially reversionary), creating visual alerts without obscuring price action.
🔶 Annualization Methodology Integration
Utilizes standard square root of time scaling (sqrt(365)) to convert rolling period Sharpe calculations into annualized format for cross-temporal comparison. The system applies this mathematical transformation ensuring Sharpe values represent expected annual risk-adjusted returns regardless of calculation period length, enabling consistent interpretation whether using 100-day or 200-day rolling windows.
🔶 Zero-Line Reference System
Provides critical zero-line plot serving as boundary between positive risk-adjusted returns (capital allocation justified by return/risk profile) and negative risk-adjusted returns (strategy destroying value on risk-adjusted basis). The system emphasizes this threshold as decision point where values above zero suggest continuation while values below zero indicate reconsideration of exposure.
🔶 Momentum-Based Color
Transitions Implements intelligent color switching logic that considers both absolute Sharpe value and its momentum relative to smoothed average, creating four distinct regimes for granular performance assessment. The system enables identification of bullish acceleration (green), bullish deceleration (yellow), bearish improvement (orange), and bearish acceleration (red) for nuanced position management beyond simple positive/negative classification.
🔶 Configurable Period Optimization
Features adjustable calculation period and smoothing length enabling optimization across different trading timeframes and volatility regimes. The system defaults to 150-period calculation (approximately 6-7 months of daily data) with 30-period smoothing, but allows customization from short-term tactical assessment to long-term strategic evaluation based on investment horizon and strategy requirements.
🔶 Performance Optimization Framework
Employs efficient rolling calculations with streamlined daily return processing and optimized standard deviation computation for smooth real-time updates. The system includes minimal computational overhead through single-pass mean and variance calculations, enabling consistent performance across extended historical periods while maintaining accuracy of risk-adjusted return measurements.
This indicator delivers sophisticated risk-adjusted return analysis through classic Sharpe Ratio methodology with enhanced visual classification distinguishing return quality and momentum. Unlike simple return-focused indicators, Sharpe Ratio penalizes volatility ensuring traders evaluate whether returns justify the risk undertaken. The system's four-tier color coding, smoothed baseline comparison, and extreme threshold detection make it essential for portfolio managers and systematic traders seeking objective performance assessment beyond raw price gains. High positive Sharpe values indicate efficient return generation relative to volatility risk, while negative values signal value destruction on risk-adjusted basis requiring strategy reassessment. The indicator excels at identifying periods when risk-taking is rewarded (green zones) versus periods when volatility exceeds returns (red zones) across cryptocurrency, forex, and equity markets for optimal capital allocation decisions.
PEGY RatioThe basic metrics that all indicators descend from are for each bar the Open, High, Low, Close and Volume where the Close is often noted as Price. Then the Price/Earnings ratio entered trading. Price/Earnings is often noted as P/E ratio or PE.
The first major formalisation and widespread use of the P/E ratio came in 1934, when Benjamin Graham and David Dodd introduced it in their landmark book "Security Analysis". Their work established the P/E ratio as a core tool in fundamental analysis and value investing.
Graham’s influence was profound: he used the P/E ratio to help investors judge whether a stock was overpriced or underpriced, and his teachings shaped generations of value investors, including Warren Buffett.
The P/E ratio evolved into modern variants like forward P/E and Shiller CAPE.
There’s no single P/E cutoff that definitively marks a “growth” or “income” stock, but investors commonly treat P/E below about 10–15 as value/income oriented and P/E above about 20–25 as growth oriented. It is important to watch the P/E trend. If the P/E is a low value and reducing in value, then the company may be failing, and it is not good to invest in.
P/E is a relative signal, not an absolute rule. A high P/E usually means the market expects above average future earnings growth; a low P/E often signals lower growth expectations, higher current yield, or elevated risk. Benchmarks vary by sector and cycle: what’s “high” for utilities is low for software. Historical market averages (e.g., S&P 500) help frame whether a multiple is elevated or depressed.
The next step was the PEG ratio which was first introduced in 1969 by Mario Farina, who described it in his book "A Beginner’s Guide to Successful Investing in the Stock Market".
The concept later gained widespread popularity thanks to Peter Lynch, who championed it in his 1989 bestseller "One Up on Wall Street", arguing that a “fairly priced” company tends to have a PEG of about 1. Over 1 is overpriced and below is a bargain.
Later the PEGY ratio, a variation of the PEG ratio that added dividend yield into the valuation came into prominence so that mature, dividend paying companies are treated “fairly” . The PEGY ratio emerged in the 1990s as analysts and portfolio managers began adapting the PEG ratio for dividend paying companies. The concept is a natural extension of Peter Lynch’s PEG logic: If growth matters, and dividends matter, combine them into one valuation metric.
PEGY (Price/Earnings Growth% and Dividend Yield) is a straightforward modification of the PEG ratio that adds dividend yield to the growth term so that mature, dividend paying companies aren’t penalized by low growth rates alone. The formula is typically written as:
PEGY=(Price/Earnings)/(Earnings growth %+Dividend yield%)
Peter Lynch (One Up on Wall Street, 1989) is the most cited printed source that describes a dividend adjusted PEG concept and applies it as a practical screening rule for investors. PEGY is in Chapter “Some Fabulous Numbers”.
If earnings are negative, then the PEGY ratio will be negative, and it is best to invest in companies that make money. That is, positive PEGY ratio.
The PEGY ratio can have different ratios depending upon whether historical data is used (Mario Farina preference) or whether forward looking earnings (Peter Lynch preference) is used in the calculations.
Enough for the history lesson. You can quickly go through your watchlist and determine which stocks have a PEGY Ratio from 0 to 1 and eliminate the others. Then whittle down that list to find stocks travelling from bottom left to upper right on the page. Use any other indicators on that reduced list that your tradng plan uses and there you have your list of stocks in which to invest.






















