jc-Inside_BarCopyright by jack calo -- v1.0 -- 03/04/2015 -- Paint the bar yellow when it's an inside day. When the full range of a candle is equal or within the full range of the previous bar. Credit to Rob Smith and his In The Black Strategy.
חפש סקריפטים עבור "bar"
Over ATR Bar highlightScript highlights bars over ATR (20), i use this to look for mazabuzo candles.
FVE Volatility color-coded Volume bar The FVE is a pure volume indicator. Unlike most of the other indicators
(except OBV), price change doesn?t come into the equation for the FVE
(price is not multiplied by volume), but is only used to determine whether
money is flowing in or out of the stock. This is contrary to the current trend
in the design of modern money flow indicators. The author decided against a
price-volume indicator for the following reasons:
- A pure volume indicator has more power to contradict.
- The number of buyers or sellers (which is assessed by volume) will be the same,
regardless of the price fluctuation.
- Price-volume indicators tend to spike excessively at breakouts or breakdowns.
This study is an addition to FVE indicator. Indicator plots different-coloured volume
bars depending on volatility.
Custom Indicator Clearly Shows If Bulls or Bears are in Control!The Two Versions of this Indicator I learned from Two Famous and Highly Successful Traders. This Indicator shows With No Lag Clear Up and Down Trends in Market by Documenting Clearly If Bulls or Bears are in Control. The Version In SubChart 1 Shows Consecutive Closes if the Current Close is Greater than of Less than the Midpoint of the Previous Bar (Why Midpoint Explained in Detail in 1st Post). The Version in SubChart 2 Shows Consecutive Closes that are Greater than or Less Than the Previous Close (Will Discuss Specific Uses in 1st Post). Works on Stocks, Forex, Futures, on All Timeframes.
VWAP filtered MACD Bars with positive MACD histogram value and closing above VWAP are colored, long positions should be taken in areas made of those bars.
Similarly, bars with negative MACD histogram value and closing below VWAP are also colored, short positions should be taken there.
This indicator by default should be a part of your trend following trading system.
In the setting you can change colors
Above grow: positive and rising MACD histogram value
Above fall: positive and falling MACD histogram value
Below fall: negative and falling MACD histogram value
Below grow: negative and rising MACD histogram value
bar color changeThis Pine v5 code allows you to distinguish between candles on the chart. The body/wick/frame of the "live" candle that hasn't yet closed is colored white. When a live candle is present, the body of the immediately preceding candle is colored green with offset = -1. All other candles remain gray (#2e2e2e). plotcandle fixes the wick/frame so that the live and previous candles are selected when following the trend. If there are other conflicting scripts, the most recently added one quickly takes precedence.
Bar RangeI use this to complement the daily ATR bars. It is interesting to see how much the stock has actually moved vs the ATR movement.
MACD Aspray Hybrid Bars (teal/red) = raw momentum (Aspray Histogram).
Teal line = smooth curve of the histogram (Aspray Line).
Orange line = 9-EMA of that line (new signal).
Zero line for reference.
Bar numberAdds a number above the last 50 candles. Candle 1 is always the most recent.
Can be useful when teaching people onlinet. Now they can just ask « what’s candle number 20 » instead of « what’s with that narrow range candle next to the big one to the left… no not that one, the other one »
Bars pattern MLThis script implements a K-Nearest Neighbors (KNN)-based machine learning model to predict future price movements in financial markets. It analyzes past price action using Euclidean distance and selects the most similar historical patterns to estimate future price changes. Unlike traditional KNN implementations, this approach optimizes distance calculations by maintaining a dynamically updated list of the closest neighbors, ensuring efficient selection without the need for sorting. The model generates a forecasted price trajectory based on incremental predictions, which are visualized on the chart using polylines for better interpretability.
Volume HighlightBar colouring: this indicator is simple but effective, it repaints higher than normal candles a certain colour (by default gold/yellow) it helps to know what are valuable areas to trade around for longs and shorts.
Changing the volume multiplier manually helps you to screen volume relevant to the timeframe you are trading on.
For example, some charts 1min the best filter/setting would be 12-35 multiplier where others like btc 1-4 hourly, the filter/setting might be 8-12.
The key is having only the highest/most relevant 3-4 volume candles showing as they often represent supports and resistances.
Pivot Points And Breakout Price Action With LuckyNickVaBar Color Candle Aligned with pivot points swing high and swing lows For Those Who Are Familiar with Trading The Breakouts Of Highs & Lows Of Structure. Pivots are said to be key areas in the market where price shows heavy reaction to where reversals make occur. At these points there are swing Highs & swing lows that traders may be able to find opportunity in the market. This Script is a combination of pivot points and Barcolor signals for the breakout.
Koalafied Volume Extension Bar colours based on extensions from volume Z-Score. Large volume candles can often signal exhaustion or show market strength in reversals or breakouts. Candles not supported by rising volume are coloured black while those that are retain their colouring.
Bars CharacteristicsThis code is for defining or explaining market conditions via micro trend and the characterized bars.
lines 5,6: show the conditions for a normal trend, means market can go in the direction that it has in the past.
lines 11,12: show the conditions for kind of the trend having cumulative energy itself, mean market can go in the same direction.
lines 18,19: show the conditions for kind of the trend having overbought/sold concept, means it's better exit from the market or to look for the other clues.
lines 24,25: show some kind of noise not a stable trend, it's better not to enter the market.
WhenWasThePriceAction
Bars of largest range (volatility)
* see moments of strongest price action immediately
* colored & upDown by candle color
* amplifier: you see only the bull runs, and subsequent dumps
Very nice on the 5 years scale of BITSTAMP:BTCUSD - nothing comparable to 2013 has happened yet.
Internals:
squared_range = pow(high-low, 2)
That is essentially it already. The rest are details:
* gauge with (in case of Bitcoin exponentially rising) price
* show in red for negative candles
* take even higher polynomial (than 2) to show only the very largest values
* allow some user input (but there is not much more that can be chosen here.)
Sorry for such a simple formula - but sometimes the easiest things are powerful.
Please give feedback. www.tradingview.com and/or in the cryptocurrency chat. Thanks.
Bars Since the last RSI ExtremeThis is something Jamie Saettele pointed out. Gold has been in 'neutral' RSI territory for its longest stretch in four years. It's coiling up for its next major move.
CandelaCharts - Trend Oscillator 📝 Overview
Trend Oscillator is a simple yet effective trend identification tool that uses the relationship between two exponential moving averages (EMAs) to determine market direction. It calculates the spread between a fast and slow EMA, applies a bias multiplier, and smooths the result to produce a clean oscillator that oscillates above and below a zero line. When the oscillator is above zero, the trend is considered bullish (upward); when below zero, it's bearish (downward). The indicator provides clear visual feedback through color-coded plots and optional price bar coloring, making it easy to identify trend direction at a glance.
📦 Features
This section highlights the core capabilities you'll rely on most.
Dual EMA system — Uses a fast EMA (default 9) and slow EMA (default 21) to capture trend momentum and direction.
Bias multiplier — Applies a small multiplier (default 1.001) to the EMA spread, providing a slight bias that helps filter noise and confirm trend strength.
Smoothed output — Applies an additional EMA smoothing (default 5 periods) to the raw spread, creating a cleaner, less choppy oscillator line.
Zero-line reference — Plots a horizontal zero line that serves as the critical threshold between bullish and bearish conditions.
Color-coded visualization — Automatically colors the oscillator line green/lime when bullish (above zero) and red when bearish (below zero).
Price bar coloring — Optional feature to color price bars based on the current trend direction, providing immediate visual context on the main chart.
Customizable parameters — Adjust EMA lengths, bias multiplier, smoothing period, and colors to match your trading style and timeframe.
⚙️ Settings
Use these controls to fine-tune the oscillator's sensitivity, appearance, and behavior.
Fast EMA Length — Period for the fast exponential moving average (default: 9). Lower values make the indicator more responsive to price changes.
Slow EMA Length — Period for the slow exponential moving average (default: 21). Higher values create a smoother baseline for trend identification.
Bias Multiplier — Multiplier applied to the EMA spread (default: 1.001). Small adjustments can help filter minor whipsaws and confirm trend strength.
Smoothing Length — Period for smoothing the raw spread calculation (default: 5). Higher values create a smoother oscillator line but may lag price action.
Colors — Set the bullish (default: lime) and bearish (default: red) colors for the oscillator line.
Color Price Bars — Toggle to enable/disable coloring of price bars based on the current trend direction.
⚡️ Showcase
Oscillator Line
Bar Coloring
Divergences
📒 Usage
Follow these steps to effectively use Trend Oscillator for trend identification and trading decisions.
1) Select your timeframe — The indicator works across all timeframes, but higher timeframes (daily, weekly, monthly) typically provide more reliable trend signals with less noise. Lower timeframes (1m, 5m, 15m) may produce more frequent but potentially less reliable signals. Consider your trading style: swing traders benefit from daily/weekly charts, while day traders can use 15m/1h timeframes. Always align the indicator's sensitivity with your timeframe choice.
2) Adjust EMA lengths — The default 9/21 combination works well for most cases. For faster signals, try 5/13; for slower, more conservative signals, try 12/26 or 20/50. Match the lengths to your trading style and timeframe.
3) Interpret the zero line — When the oscillator is above zero (green/lime), the trend is bullish. When below zero (red), the trend is bearish. The further from zero, the stronger the trend.
4) Watch for crossovers — Trend changes occur when the oscillator crosses the zero line. A cross from below to above indicates a shift to bullish; from above to below indicates a shift to bearish.
5) Identify divergences — Divergences can signal potential trend reversals. Bullish divergence : price makes lower lows while the oscillator makes higher lows (suggests weakening bearish momentum). Bearish divergence : price makes higher highs while the oscillator makes lower highs (suggests weakening bullish momentum). Divergences are most reliable when they occur near extreme levels and should be confirmed with price action before taking trades.
6) Use smoothing wisely — The smoothing parameter helps reduce noise but adds lag. Lower smoothing (3-5) is more responsive; higher smoothing (7-10) is more stable but slower to react.
7) Combine with price action — Use the oscillator to confirm trend direction, then look for entry opportunities when price pulls back in the direction of the trend. The optional price bar coloring helps visualize trend alignment on the main chart.
8) Filter with bias multiplier — The bias multiplier can help reduce false signals. Experiment with values between 1.000 and 1.005 to find the sweet spot for your instrument and timeframe.
🚨 Alerts
There are no built-in alerts in this version.
⚠️ Disclaimer
Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.
O'Neil Market TimingBill O'Neil Market Timing Indicator - User Guide
Overview
This Pine Script indicator implements William O'Neil's market timing methodology, which assigns one of four distinct states to a market index (such as SPY or QQQ) to help traders identify optimal market conditions for investing. The indicator is designed to work exclusively on Daily timeframe charts.
The Four Market States
The indicator tracks the market through four distinct states, with specific transition rules between them:
1. Confirmed Uptrend (Green)
- Meaning: The market is in a healthy uptrend with institutional support
- Action: Favorable conditions for building positions in leading stocks
- Can transition to: State 2 (Uptrend Under Pressure)
2. Uptrend Under Pressure (Yellow)
- Meaning: The uptrend is showing signs of weakness with increasing distribution
- Action: Be cautious, tighten stops, reduce position sizes
- Can transition to: State 1 (Confirmed Uptrend) or State 3 (Downtrend)
3. Downtrend (Red)
- Meaning: The market is in a confirmed downtrend
- Action: Stay mostly in cash, avoid new purchases
- Can transition to: State 4 (Rally Attempt)
4. Rally Attempt (Pink/Fuchsia)
- Meaning: The market is attempting to bottom and reverse
- Action: Watch for Follow-Through Day to confirm new uptrend
- Can transition to: State 1 (Confirmed Uptrend) or State 3 (Downtrend)
Key Concepts
Distribution Day
A distribution day occurs when:
1. The index closes down by more than the critical percentage (default 0.2%)
2. Volume is higher than the previous day's volume
Distribution days indicate institutional selling and are marked with red triangles on the indicator.
Follow-Through Day
A follow-through day occurs during a Rally Attempt when:
1. The index closes up by more than the critical percentage (default 1.6%)
2. Volume is higher than the previous day's volume
A Follow-Through Day confirms a new uptrend and triggers the transition from Rally Attempt to Confirmed Uptrend.
State Transition Logic
Valid Transitions
The system only allows specific transitions:
- 1 → 2: When distribution days reach the "pressure number" (default 5) within the lookback period (default 25 bars)
- 2 → 1: When distribution days drop below the pressure number
- 2 → 3: When distribution days reach "downtrend number" (default 7) AND price drops by "downtrend criterion" (default 6%) from the lookback high
- 3 → 4: When the market doesn't make a new low for 3 consecutive days
- 4 → 3: When a new low is made, undercutting the downtrend low
- 4 → 1: When a Follow-Through Day occurs during the Rally Attempt
Input Parameters
Distribution Day Parameters
- Distribution Day % Threshold (default 0.2%, range 0.1-2.0%)
- Minimum percentage decline required to qualify as a distribution day. While 0.2% seems to be the canonical number I see in literature about this, I use a much higher threshold (at least 0.5%)
Follow-Through Day Parameters
- Follow-Through Day % Threshold (default 1.6%, range 1.0-2.0%)
- Minimum percentage gain required to qualify as a follow-through day
### State Transition Parameters
- Pressure Number (default 5, range 3-6)
- Number of distribution days needed to transition from Confirmed Uptrend to Uptrend Under Pressure
- Lookback Period (default 25 bars, range 20-30)
- Number of days to count distribution days
- Downtrend Number (default 7, range 4-10)
- Number of distribution days needed (with price drop) to transition to Downtrend
- Downtrend % Drop from High (default 6%, range 5-10%)
- Percentage drop from lookback high required for downtrend confirmation
Visual Settings
- Color customization for each state
- Table position selection (Top Left, Top Right, Bottom Left, Bottom Right)
## How to Use This Indicator
### Installation
1. Open TradingView and navigate to SPY or QQQ (or another major index)
2. **Important**: Switch to the Daily (1D) timeframe
3. Click on "Indicators" at the top of the chart
4. Click "Pine Editor" at the bottom of the screen
5. Copy and paste the Pine Script code
6. Click "Add to Chart"
### Interpretation
**When the indicator shows:**
- **Green (State 1)**: Market is healthy - consider adding quality positions
- **Yellow (State 2)**: Exercise caution - tighten stops, be selective
- **Red (State 3)**: Defensive mode - preserve capital, avoid new buys
- **Pink (State 4)**: Watch closely - prepare for potential Follow-Through Day
### The Information Table
The table displays:
- **Current State**: The current market condition
- **Distribution Days**: Number of distribution days in the lookback period
- **Lookback Period**: Number of bars being analyzed
- **Rally Attempt Day**: (Only in State 4) Days into the current rally attempt
### Visual Elements
1. **State Line**: A stepped line showing the current state (1-4)
2. **Red Triangles**: Mark each distribution day
3. **Horizontal Reference Lines**: Dotted lines marking each state level
4. **Color-Coded Display**: The state line changes color based on the current market condition
## Trading Strategy Guidelines
### In Confirmed Uptrend (State 1)
- Build positions in stocks breaking out of proper bases
- Use normal position sizing
- Focus on stocks showing institutional accumulation
- Hold winners as long as they act properly
### In Uptrend Under Pressure (State 2)
- Take partial profits in extended positions
- Tighten stop losses
- Be more selective with new entries
- Reduce overall exposure
### In Downtrend (State 3)
- Move to cash or maintain very light exposure
- Avoid new purchases
- Focus on preservation of capital
- Use the time for research and watchlist building
### In Rally Attempt (State 4)
- Stay mostly in cash but prepare
- Build a watchlist of strong stocks
- On Day 4+ of the rally attempt, watch for Follow-Through Day
- If FTD occurs, begin cautiously adding positions
## Best Practices
1. **Use with Major Indices**: This indicator works best with SPY, QQQ, or other broad market indices
2. **Daily Timeframe Only**: The indicator is designed for daily bars - do not use on intraday timeframes
3. **Combine with Stock Analysis**: Use the market state as a filter for individual stock decisions
4. **Respect the Signals**: When the market enters Downtrend, reduce exposure regardless of individual stock setups
5. **Monitor Distribution Days**: Pay attention when distribution days accumulate - it's a warning sign
6. **Wait for Follow-Through**: Don't jump back in too early during Rally Attempt - wait for confirmation
## Alert Conditions
The indicator includes built-in alert conditions for:
- State changes (entering any of the four states)
- Distribution Day detection
- Follow-Through Day detection during Rally Attempt
To set up alerts:
1. Click the "Alert" button while the indicator is on your chart
2. Select "O'Neil Market Timing"
3. Choose your desired alert condition
4. Configure notification preferences
## Customization Tips
### For More Sensitive Detection
- Lower the "Pressure Number" to 3-4
- Lower the "Distribution Day % Threshold" to 0.15%
- Reduce the "Downtrend Number" to 5-6
### For More Conservative Detection
- Raise the "Pressure Number" to 6
- Raise the "Distribution Day % Threshold" to 0.3-0.5%
- Increase the "Downtrend Number" to 8-9
### For Different Market Conditions
- **Bull Market**: Consider slightly higher thresholds
- **Bear Market**: Consider slightly lower thresholds
- **Volatile Market**: May need to increase percentage thresholds
## Limitations and Considerations
1. **Not a Crystal Ball**: The indicator identifies conditions but doesn't predict the future
2. **False Signals**: Follow-Through Days can fail - use proper risk management
3. **Whipsaws Possible**: In choppy markets, the indicator may switch states frequently
4. **Confirmation Lag**: By design, there's a lag as the system waits for confirmation
5. **Works Best with Price Action**: Combine with your analysis of individual stocks
## Historical Context
This methodology is based on William J. O'Neil's decades of market research, documented in books like "How to Make Money in Stocks" and through Investor's Business Daily. O'Neil's research showed that:
- Most major market tops are preceded by accumulation of distribution days
- Most successful rallies begin with a Follow-Through Day on Day 4-7 of a rally attempt
- Identifying market state helps prevent buying during unfavorable conditions
## Troubleshooting
**Problem**: Indicator shows "Initializing"
- **Solution**: Let the chart load at least 5 bars to establish the initial state
**Problem**: No distribution day markers appear
- **Solution**: Verify you're on daily timeframe and check if volume data is available
**Problem**: Table not visible
- **Solution**: Check the table position setting and ensure it's not off-screen
**Problem**: State seems to change too frequently
- **Solution**: Increase the lookback period or adjust threshold parameters
## Support and Further Learning
For deeper understanding of this methodology:
- Read "How to Make Money in Stocks" by William J. O'Neil
- Study Investor's Business Daily's "Market Pulse"
- Review historical market tops and bottoms to see the pattern
- Practice identifying distribution days and follow-through days manually
## Version History
**Version 1.0** (November 2025)
- Initial implementation
- Four-state system with proper transitions
- Distribution day detection and marking
- Follow-through day detection
- Customizable parameters
- Information table display
- Alert conditions
---
## Quick Reference Card
| State | Number | Color | Action |
|-------|--------|-------|--------|
| Confirmed Uptrend | 1 | Green | Buy quality setups |
| Uptrend Under Pressure | 2 | Yellow | Tighten stops, be selective |
| Downtrend | 3 | Red | Cash position, no new buys |
| Rally Attempt | 4 | Pink | Watch for Follow-Through Day |
**Distribution Day**: Down > 0.2% on higher volume (red triangle)
**Follow-Through Day**: Up > 1.6% on higher volume during Rally Attempt (triggers State 4→1)
---
*Remember: This indicator is a tool to help identify market conditions. It should be used as part of a comprehensive trading strategy that includes proper risk management, position sizing, and individual stock analysis.*
Also, I created this with the help of an AI coding framework, and I didn't exhaustively test it. I don't actually use this for my own trading, so it's quite possible that it's materially wrong, and that following this will lead to poor investment decisions.. This is "copy left" software, so feel free to alter this to your own tastes, and claim authorship.






















