Moving Average Trend ToolsI. How M.A.T.T. Adds Value to the TradingView Community:
The "Moving Average Trend Tools" (M.A.T.T.) is a versatile Pine Script v6 indicator that empowers traders with clear trend analysis, reliable trade signals, and real-time insights. Its intuitive design and robust features make it a valuable addition to the TradingView Community Scripts by catering to traders of all levels. Here’s why it stands out:
Clear Trend Visualization: M.A.T.T. plots a moving average (MA) with dynamic coloring—green for rising, red for falling, and gray for flat—based on a user-defined lookback period. This simplifies trend interpretation, helping traders quickly assess market momentum.
Reliable Trade Signals : The script identifies price crossovers above or below the MA, plotting green circles for bullish crosses and red for bearish, confirmed on closed bars to prevent repainting. These signals guide entry and exit points for trend-following or reversal strategies.
Real-Time Extension Detection : M.A.T.T. calculates percentage price deviations from the MA, displaying real-time labels when thresholds (e.g., 6%) are exceeded. This highlights overextended moves, ideal for spotting reversals or pullbacks, with alerts to keep traders informed.
Extensive Customization : Traders can tailor the MA type (SMA, EMA, WMA, HMA), length, colors, line width, and label sizes. This flexibility supports diverse strategies across markets like stocks, forex, and crypto, from scalping to swing trading.
Automated Alerts : Alert conditions for crossovers and extensions integrate seamlessly with TradingView’s system, enabling traders to stay updated without constant chart monitoring.
M.A.T.T. combines trend analysis, signal generation, and overextension detection into a single, user-friendly tool. Its accessibility, reliability, and educational value for Pine Script learners make it a compelling contribution to the community.
II. What M.A.T.T. Does, How It Works, and Its Originality:
What It Does :
M.A.T.T. enhances trend analysis and trade decision-making through three core features:
Dynamic MA Visualization: Plots a customizable MA (SMA, EMA, WMA, or HMA) with trend-based coloring to reflect rising, falling, or flat market conditions.
Price Crossover Signals : Marks bullish (green circles) and bearish (red circles) crossovers, confirmed on closed bars, with alerts for trade opportunities.
Price Extension Labels : Displays real-time percentage deviations of price from the MA, with alerts when user-defined thresholds are breached, signaling potential reversals.
How It Works :
M.A.T.T. leverages Pine Script v6 for precise calculations and user-friendly outputs:
Inputs: Users select MA type, length, lookback period, colors, and thresholds for extensions, plus label styles and sizes for customization.
MA Calculation : A switch function computes the chosen MA (e.g., ta.ema(close, 21) for EMA). Trend direction is determined using ta.rising or ta.falling over the lookback period, coloring the MA accordingly.
Crossover Logic : Bullish crossovers (close > ma and close < ma ) and bearish crossovers (close < ma and close > ma ) are plotted as circles on confirmed bars (barstate.isconfirmed) to ensure reliability. Alerts trigger only on the first bar of a crossover.
Extension Logic : Percentage deviations are calculated as ((price - ma) / ma) * 100, using the high for above-MA extensions and low for below. Labels appear in real-time when thresholds are exceeded, with alerts on transitions to avoid noise.
Why It’s Original
M.A.T.T. distinguishes itself through a unique blend of features and thoughtful design:
All-in-One Design : It integrates dynamic MA coloring, non-repainting crossover signals, and real-time extension detection, addressing trend identification, trade signals, and overextension warnings in one tool—unlike most MA indicators that focus on a single aspect.
Real-Time Extension Labels : Displaying percentage deviations with customizable thresholds is a rare feature, ideal for volatile markets and not commonly found in standard scripts.
Non-Repainting Signals : Confirmed crossover signals enhance reliability for live trading, setting M.A.T.T. apart from less rigorous indicators.
Optimized Alert Condtions : Alerts trigger only on transitions (e.g., first bar of a crossover or extension), reducing noise and improving usability.
Visual and Functional Flexibility : Support for four MA types, extensive customization, and a clean interface (dynamic colors, tiny circles, clear labels) make it adaptable and user-friendly.
While MA plotting or crossovers exist elsewhere, M.A.T.T.’s seamless integration, real-time extension detection, alert conditions, and focus on reliability and customization create a distinctive, practical tool. Its balance of simplicity and sophistication makes it a unique asset for the TradingView community.
在腳本中搜尋"weekly"
Candle Type w/only 3-1This script is a "fork" of Crinklebine's excellent "Candle Type" script for Rob Smith's ( aka RobInTheBlack) #thestrat methodology. 1 strategy that's becoming increasingly popular is looking for 3-1 (outside-inside) set-ups per #thestrat. The idea is that as the inside candle breaks, the target to take profits is given by the high/low of the previous outside range. This script is for traders who only want to look for this specific candle combo (3-1) and highlights up/dn breaks of the inside candle. It's designed to work with or without "Candle Type" (so traders who want all bars labelled can also select Crinklebine's Candle Type script to run concurrently). I've had traders specifically request this script from me, so I thought others may be interested as well and I'm sharing it here.
Candle Type w/2Up + 2Dn v2.0This script builds on Candle Type w/2Up + 2Dn by incorporating signals for inside + up, outside + up, + rev strat set-ups. All of these can be turned off if they compete w/ other indicators or just clutter up the chart.
Briefly, the script works based on #thestrat developed by Rob Smith and the 1-2-3 bar script coded by @Crinklebine. Candle Type w/2Up + 2Dn is a "fork" of @Crinklebine's excellent indicator. I find the visualization of U-D-I-O (up/dn/inside/outside candles) easier to scan through 100's of charts than 1-2-3's. This is just personal preference, but they work based on the exact same principles. Performance is enhanced with a trend filter like @boardriderb's "TC" script or similar timeframe continuity filters based on the #thestrat developed by Rob Smith. I also prefer an ATR-based trailing stop; Rob recommends pSAR for trailing stops.
Together these indicators form a power system, but users are still responsible for their own trade management, entries & exits, risk profiles, stop loss, etc.
ATR Screener with Labels and ShapesWeekly Daily ATR Pine Scanner
To find out tightness or contraction in a stock we needs to check if volatality is decreasing as well as compared to previous 14 or 10 bars volatility . we check this for weekly and then for Daily , so that we can enter in a stock which is tightest in recent times.
Condition is :
1. Weekly Candle ATR x 0.8 < 10 Week ATR
2. Daily Candle ATR x 0.6 < 14 Day ATR
When both of the conditions are met then they signifies that the stock has tightened in weekly and daily aswell . so now we can find ways to enter during max squeeze.
How to scan in Pine Scanner ?
FIrst add indicator as favourite and Go to pine scanner page in trading view and then scan your watchlist and there you will see 3 columns 1 with only Weekly conditions met , 2 with only Daily and 3rd with Both conditions met .
Select stocks and move to new watchlist and now you have those stocks which has contracted the most in recent times .
Weekly Covered Calls Strategy with IV & Delta LogicWhat Does the Indicator Do?
this is interactive you must use it with your options chain to input data based on the contract you want to trade.
Visualize three strike price levels for covered calls based on:
Aggressive (closest to price, riskier).
Moderate (mid-range, balanced).
Low Delta (farthest, safer).
Incorporate Implied Volatility (IV) from the options chain to make strike predictions more realistic and aligned with market sentiment. Adjust the risk tolerance by modifying Delta inputs and IV values. Risk is defined for example .30 delta means 30% chance of your shares being assigned. If you want to generate steady income with your shares you might want to lower the risk of them being assigned to .05 or 5% etc.
How to Use the Indicator with the Options Chain
Start with the Options Chain:
Look for the following data points from your options chain:
Implied Volatility (IV Mid): Average IV for a particular strike price.
Delta:
~0.30 Delta: Closest strike (Aggressive).
~0.15–0.20 Delta: Mid-range strike (Moderate).
~0.05–0.10 Delta: Far OTM, safer (Low Delta).
Strike Price: Identify strike prices for the desired Deltas.
Open Interest: Check liquidity; higher OI ensures tighter spreads.
Input IV into the Indicator:
Enter the IV Mid value (e.g., 0.70 for 70%) from the options chain into the Implied Volatility field of the indicator.
Adjust Delta Inputs Based on Risk Tolerance:
Aggressive Delta: Increase if you want strikes closer to the current price (riskier, higher premium).
Default: 0.2 (20% chance of shares being assigned).
Moderate Delta: Balanced risk/reward.
Default: 0.12 (12%)
Low Delta: Decrease for safer, farther OTM strikes.
Default: 0.05 (5%)
Visualize the Chart:
Once inputs are updated:
Red Line: Aggressive Strike (closest, riskiest, higher premium).
Blue Line: Moderate Strike (mid-range).
Green Line: Low Delta Strike (farthest, safer).
Step-by-Step Workflow Example
Open the options chain and note:
Implied Volatility (IV Mid): Example 71.5% → input as 0.715.
Delta for desired strikes:
Aggressive: 0.30 Delta → Closest strike ~ $455.
Moderate: 0.15 Delta → Mid-range strike ~ $470.
Low Delta: 0.05 Delta → Farther strike ~ $505.
Open the indicator and adjust:
IV Mid: Enter 0.715.
Aggressive Delta: Leave at 0.12 (or adjust to bring strikes closer).
Moderate Delta: Leave at 0.18.
Low Delta: Adjust to 0.25 for safer, farther strikes.
View the chart:
Compare the indicator's strikes (red, blue, green) with actual options chain strikes.
Use the visualization to: Validate the risk/reward for each strike.
Align strikes with technical trends, support/resistance.
Adjusting Inputs Based on Risk Tolerance
Higher Risk: Increase Aggressive Delta (e.g., 0.15) for closer strikes.
Use higher IV values for volatile stocks.
Moderate Risk: Use default values (0.12–0.18 Delta).
Balance premiums and probability.
Lower Risk: Increase Low Delta (e.g., 0.30) for farther, safer strikes.
Focus on higher IV stocks with good open interest.
Key Benefits
Simplifies Strike Selection: Visualizes the three risk levels directly on the chart.
Aligns with Market Sentiment: Incorporates IV for realistic forecasts.
Customizable for Risk: Adjust inputs to match personal risk tolerance.
By combining the options chain (IV, Delta, and liquidity) with the technical chart, you get a powerful, visually intuitive tool for covered call strategies.
Weekly COTAdjusted COT Index
Improves upon: "COT Index Commercials vs large and small Speculators" by SystematicFutures
How: CoT Indexes are adjusted by Open Interest to normalise data over time, and threshold background colours are in-line with Larry Williams recommendations from his book.
Note: This indicator is **only** accurate on the Daily time-frame due to the mid-week release date for CoT data.
This script calculates and plots the Adjusted Commitment of Traders (COT) Index for Commercial, Large Speculator, and Retail (Small Speculator) categories.
The CoT Index is adjusted by Open Interest to normalise data through time, following the methodology of Larry Williams, providing insights into how these groups are positioned in the market with an arguably more historically accurate context.
COT Categories
-------------------
- Commercials (Producers/Hedgers): Large entities hedging against price changes in the underlying asset.
- Large Speculators (Non-commercials): Professional traders and funds speculating on price movements.
- Retail Traders (Nonreportable/Small Speculators): Small individual traders, typically less informed.
Features
----------
- Open Interest Adjustment
- The net positions for each category are normalized by Open Interest to account
for varying contract sizes.
- Customisable Look-back Period
- You can adjust the number of weeks for the index calculation to control the
historical range used for comparison.
- Thresholds for Extremes
- Upper and lower thresholds (configurable) are provided to mark overbought and
oversold conditions.
- Defaults
- Overbought: <=20
- Oversold: >= 80
- Hide Current Week Option
- Optionally hide the current week's data until market close for more accurate comparison.
- Visual Aids
- Plot the Commercials, Large Speculators, and Retail indexes, and optionally highlight extreme positioning.
Inputs
--------
- weeks
- Number of weeks for historical range comparison.
- upperExtreme and lowerExtreme
- Thresholds to identify overbought/oversold conditions (default 80/20).
- hideCurrentWeek
- Option to hide current week's data until market close.
- markExtremes
- Highlight extremes where any index crosses the upper or lower thresholds.
- Options to display or hide indexes for Commercials, Large Speculators, and Small Speculators.
Outputs
----------
- The script plots the COT Index for each of the three categories and highlights periods of extreme positioning with customisable thresholds.
Usage
-------
- This tool is useful for traders who want to track the positioning of different market participants over time.
- By identifying the extreme positions of Commercials, Large Speculators, and Retail traders, it can give insights into market sentiment and potential reversals.
- Reversals of trend can be confirmed with RSI Divergence (daily), for example
- Continuation can be confirmed with RSI overbought/oversold conditions (daily), and/or hidden RSI Hidden Divergence, for example
Weekly BoxThe indicator shows a box based on the high and low of the previous week that extends into the current week. The box is used to monitor breakouts or break downs of the price with respect to the previous week levels.
The box is colored:
- green, if there is a breakout above the previous week high; or
- red, if there is a break down below the previous week low; or
- yellow, if the price stays inside of the box.
during the current week.
Labels for the box top and bottom prices can be enabled or disabled in the settings.
Weekly Opening Gap (cryptonnnite)In the context of general equities, opening price that is substantially higher or lower than the previous day's closing price, usually because of some extraordinarily positive or negative news. Opening gap using as a potential target which market usually trades to.
RTI Pivot Points StandardWeekly daily Pivot point for ease.
This is will show support and resistance on 15 minutes and 30 minutes time frame.
COT Net Positions BTC & ETH FO_ALLWeekly Commitment of Traders Report for Futures positions, as well as futures plus options positions.
This is only for Bitcoin and Ether.
OPEN INTEREST
DEALER
ASSET MANAGER
LEVERAGED FUNDS
OTHER REPORTABLE
TOTAL REPORTABLE
NON REPORTABLE
Weekly currency strength indicatorThe indicator uses the SAXO feed for the currencies USD, EUR, GBP, JPY, AUD and CAD. This can easily be changed to your preferred feed and currencies by changing the code.
The overall idea is to get a clear picture of which currencies are strengthening and weakening. This indicator does not predict future price movements.
Weekly & Daily Percantage Price OscillatorMy first script.
By Vitali Apirine. Technical Analysis of Stocks & Commodities ( February 2018, Vol.36 Issue 2). Thank you.
Mavilim Multiple Trend By BDweekly mavilim line,daily mavilim line and more,within your current chart. and shows multiple mavilim trend. if u need something like this
Multiple Trend Indicatorweekly 21wma,daily 21wma and more,within your current chart. and shows multiple trend. if u need something like this
Trend Score with Dynamic Stop Loss HTF
How the Trend Score System Works
This indicator uses a Trend Score (TS) to measure price momentum over time. It tracks whether price is breaking higher or lower, then sums these moves into a cumulative score to define trend direction.
⸻
1. Trend Score (+1 / -1 Mechanism)
On each new bar:
• +1 point: if the current bar breaks the previous bar’s high.
• −1 point: if the current bar breaks the previous bar’s low.
• If both happen in the same bar, they cancel each other out.
• If neither happens, the score does not change.
This creates a simple running measure of bullish vs bearish pressure.
⸻
2. Cumulative Trend Score
The Trend Score is cumulative, meaning each new +1 or -1 is added to the total score, building a continuous count.
• Rising scores = buyers are consistently pushing price to higher highs.
• Falling scores = sellers are consistently pushing price to lower lows.
This smooths out noise and helps identify persistent momentum rather than single-bar spikes.
⸻
3. Trend Flip Trigger (default = 3)
A trend flip occurs when the cumulative Trend Score changes by 3 points (default setting) in the opposite direction of the current trend.
• Bullish Flip:
• Cumulative TS rises 3 points from its most recent low pivot.
• Marks a potential start of a new uptrend.
• A bullish stop-loss (SL) is set at the most recent swing low.
• Bearish Flip:
• Cumulative TS falls 3 points from its most recent high pivot.
• Marks a potential start of a new downtrend.
• A bearish SL is set at the most recent swing high.
Example:
• TS is at -2, then climbs to +1.
• That’s a +3 change, triggering a bullish flip.
⸻
4. Visual Summary
• Green background: Active bullish trend.
• Red background: Active bearish trend.
• ▲ Triangle Up: A bullish flip occurred this bar.
• Stop Loss Line: Shows the structural low used for risk management.
⸻
Why This Matters
The Trend Score measures trend pressure simply and objectively:
• +1 / -1 mechanics track real price behavior (breakouts of highs and lows).
• Cumulative changes of 3 points act like a momentum filter, ignoring small reversals.
• This helps you see true regime shifts on higher timeframes, which is especially useful for swing trades and investing decisions.
⸻
Key Takeaways
• Only flips after meaningful swings: prevents overreacting to single-bar noise.
• SL shows invalidation point: helps you know where a trend thesis fails.
• Works best on Daily or Weekly charts: for smoother, more reliable signals. Using Trend Score for Long-Term Investing
This indicator is designed to support decision-making for higher timeframe investing, such as swing trades, multi-month positions, or even multi-year holds.
It helps you:
• Identify major bullish regimes.
• Decide when to add to winning positions (DCA up).
• Know when to pause buying or consider trimming during weak periods.
• Stay disciplined while holding long-term winners.
Important Note:
These are suggestions for context. Always combine them with your own analysis, portfolio allocation rules, and risk tolerance.
⸻
1. Start With the Higher Timeframe
• Use Weekly charts for a broad investing view.
• Use Daily charts only for fine-tuning entry points or deciding when to add.
• A Bullish Flip on Weekly suggests the market may be entering a major uptrend.
• If Weekly is bullish and Daily also turns bullish, it’s extra confirmation of strength.
⸻
2. Building a Position with DCA
Goal: Grow your position gradually during strong bullish regimes while staying aware of risk.
A. Initial Buy
• Start with a small initial allocation when a Bullish Flip appears on Weekly or Daily.
• This is just a starter position to get exposure while the new trend develops.
B. Adding Through Strength (DCA Up)
• Consider adding during pullbacks, as long as price stays above the active SL line.
• Each add should be smaller or equal to your first buy.
• Spread out adds over time or price levels, instead of going all-in at once.
C. Pause Buying When:
• Price approaches or touches the SL level (trend invalidation).
• A Bearish Flip appears on Weekly or Daily — this signals potential weakness.
• Your total position size reaches your maximum allocation limit for that asset.
⸻
3. Holding Winners
When a position grows in profit:
• Stay in the trend as long as the Weekly regime remains bullish.
• The indicator’s green background acts as a reminder to hold, not panic sell.
• Use the SL bubble to monitor where the trend could potentially break.
• Avoid selling just because of small pullbacks — focus on big-picture trend health.
⸻
4. Taking Partial Profits
While this tool is designed to help hold long-term winners, there may be times to lighten risk:
• After large, rapid moves far above the SL, consider trimming a small portion of your position.
• When MFE (Maximum Favorable Excursion) in the table reaches unusually high levels, it may signal overextension.
• If the Weekly chart turns Neutral or Bearish, you can gradually reduce exposure while waiting for the next Bullish Flip.
⸻
5. Using the Stop Loss Line for Awareness
The Dynamic SL line represents a structural level that, if broken, may suggest the bullish trend is weakening.
How to think about it:
• Above SL: Market remains structurally healthy — continue holding or adding gradually.
• Close to SL: Pause adds. Be cautious and consider tightening your risk.
• Below SL: Treat this as a potential signal to reassess your position, especially if the break is confirmed on Weekly.
The SL is not a hard stop — it’s a visual guide to help you manage expectations.
⸻
6. Example Use Case
Imagine you are investing in a growth stock:
• Weekly Bullish Flip: You open a small starter position.
• Price pulls back slightly but stays above SL: You add a second, smaller tranche.
• Trend continues up for months: You hold and stop adding once your desired allocation is reached.
• Price doubles: You trim 10–20% to lock some profits, but continue holding the majority.
• Price later dips below SL: You slow down, reassess, and decide whether to reduce exposure.
This keeps you:
• Participating in major uptrends.
• Avoiding overcommitment during weak phases.
• Making adjustments gradually, not emotionally.
⸻
7. Suggested Workflow
1. Check Weekly chart → is it Bullish?
2. If yes, review Daily chart to fine-tune entry or adds.
3. Build exposure gradually while Weekly remains bullish.
4. Watch SL bubbles as awareness points for risk management.
5. Use partial trims during big rallies, but avoid exiting entirely too soon.
6. Reassess if Weekly turns Neutral or Bearish.
⸻
Key Takeaways
• Use this as a compass, not a command system.
• Weekly flips = big picture direction.
• Daily flips = timing and precision.
• Add gradually (DCA) while above SL, pause near SL, reassess below SL.
• Hold winners as long as Weekly remains bullish.
4H Range Breakout Strategy — ETH 4H optimized + dynamic stop4H Range Breakout Strategy — ETH Optimized + Risk Management + Forecast
This strategy trades 4H range breakouts on ETH, using the previous confirmed 4-hour candle as the reference range. It combines multi-timeframe context, professional risk management, and a Forecast Engine that sketches likely future paths based on dynamic support/resistance and trend conditions.
Key Features
4H Breakout Logic
Long when price breaks above the prior 4H high; short when it breaks below the prior 4H low.
Optional trend filter (Daily EMA200 + ADX) plus volatility/volume filters to reduce false signals.
Advanced Risk Management
Stop via ATR or fixed percent.
Take-profit via R-multiple, ATR-multiple, or percent.
Scale-out at TP1 (default 60%).
Chandelier-style ATR trailing stop.
Fixed-Risk Position Sizing: each trade risks a fixed % of equity (e.g., 0.5%) for consistent sizing across varying volatility.
Prop-Firm Style Kill Switch
Daily loss cap (% of equity).
Trade halt after N consecutive losses.
Automatic cool-off for a set number of bars.
Optional reset at the start of each trading day.
Auto Regime Engine
Classifies market as Trend, Range, High-Vol, or Neutral using ADX, EMA slope, and ATR Z-score.
Dynamically adjusts buffers, stops, targets, and trailing according to the active regime.
Forecast Path (Scenario Planning)
Draws bullish/bearish path candidates using nearest HTF support/resistance (pivot-based, non-repainting).
Includes an evaluation panel tracking hits/misses to monitor scenario quality over time.
How to Use
Primary timeframes: ETH 1H or 4H (optimized for ETH but adaptable).
Choose a preset (e.g., ETH 4H Optimized or Prop-Firm) or fine-tune inputs.
The Forecast module does not predict; it visualizes conditional paths to aid trade planning and post-analysis.
For robust testing, run backtests across multiple market regimes and review the evaluation panel.
Notes & Best Practices
Combine with higher-timeframe context (Daily/Weekly levels) and news/flow awareness.
Keep risk per trade modest (e.g., 0.25–1.0% of equity).
Consider disabling entries during extremely low volume or during major news releases.
Disclaimer
This script is for educational and research purposes. Trading involves substantial risk. Past results do not guarantee future returns. Always test thoroughly and trade responsibly.
DAYOFWEEK performance1 -Objective
"What is the ''best'' day to trade .. Monday, Tuesday...."
This script aims to determine if there are different results depending on the day of the week.
The way it works is by dividing data by day of the week (Monday, Tuesday, Wednesday ... ) and perform calculations for each day of the week.
1 - Objective
2 - Features
3 - How to use (Examples)
4 - Inputs
5 - Limitations
6 - Notes
7 - Final Tooughs
2 - Features
AVG OPEN-CLOSE
Calculate de Percentage change from day open to close
Green % (O-C)
Percentage of days green (open to close)
Average Change
Absolute day change (O-C)
AVG PrevD. Close-Close
Percentage change from the previous day close to the day of the week close
(Example: Monday (C-C) = Friday Close to Monday close
Tuesday (C-C) = Monday C. to Tuesday C.
Green % (C1-C)
Percentage of days green (open to close)
AVG Volume
Day of the week Average Volume
Notes:
*Mon(Nº) - Nº = Number days is currently calculated
Example: Monday (12) calculation based on the last 12 Mondays. Note: Discrepancies in numbers example Monday (12) - Friday (11) depend on the initial/end date or the market was closed (Holidays).
3 - How to use (Examples)
For the following example, NASDAQ:AAPL from 1 Jan 21 to 1 Jul 21 the results are following.
The highest probability of a Close being higher than the Open is Monday with 52.17 % and the Lowest Tuesday with 38.46 %. Meaning that there's a higher chance (for NASDAQ:AAPL ) of closing at a higher value on Monday while the highest chance of closing is lower is Tuesday. With an average gain on Tuesday of 0.21%
Long - The best day to buy (long) at open (on average) is Monday with a 52.2% probability of closing higher
Short - The best day to sell (short) at open (on average) is Tuesday with a 38.5% probability of closing higher (better chance of closing lower)
Since the values change from ticker to ticker, there is a substantial change in the percentages and days of the week. For example let's compare the previous example ( NASDAQ:AAPL ) to NYSE:GM (same settings)
For the same period, there is a substantial difference where there is a 62.5% probability Friday to close higher than the open, while Tuesday there is only a 28% probability.
With an average gain of 0.59% on Friday and an average loss of -0.34%
Also, the size of the table (number of days ) depends if the ticker is traded or not on that day as an example COINBASE:BTCUSD
4 - Inputs
DATE RANGE
Initial Date - Date from which the script will start the calculation.
End Date - Date to which the script will calculate.
TABLE SETTINGS
Text Color - Color of the displayed text
Cell Color - Background color of table cells
Header Color - Color of the column and row names
Table Location - Change the position where the table is located.
Table Size - Changes text size and by consequence the size of the table
5 - LIMITATIONS
The code determines average values based on the stored data, therefore, the range (Initial data) is limited to the first bar time.
As a consequence the lower the timeframe the shorter the initial date can be and fewer weeks can be calculated. To warn about this limitation there's a warning text that appears in case the initial date exceeds the bar limit.
Example with initial date 1 Jan 2021 and end date 18 Jul 2021 in 5m and 10 m timeframe:
6 - Notes and Disclosers
The script can be moved around to a new pane if need. -> Object Tree > Right Click Script > Move To > New pane
The code has not been tested in higher subscriptions tiers that allow for more bars and as a consequence more data, but as far I can tell, it should work without problems and should be in fact better at lower timeframes since it allows more weeks.
The values displayed represent previous data and at no point is guaranteed future values
7 - Final Tooughs
This script was quite fun to work on since it analysis behavioral patterns (since from an abstract point a Tuesday is no different than a Thursday), but after analyzing multiple tickers there are some days that tend to close higher than the open.
PS: If you find any mistake ex: code/misspelling please comment.
Nick_OS RangesUNDERSTANDING THE SCRIPT:
TIMEFRAME RESOLUTION:
* You have the option to choose Daily , Weekly , or Monthly
LOOKBACK WINDOW:
* This number represents how far back you want the data to pull from
- Example: "250" would represent the past 250 Days, Weeks, or Months depending on what is selected in the Timeframe Resolution
RANGE 1 nth (Gray lines):
* This number represents the range of the nth biggest day, week, or month in the Lookback Window
- Example: "30" would represent the range of the 30th biggest day in the past 250 days. (If the Lookback Window is "250")
RANGE 2 nth (Blue lines):
* This number represents the range of the nth biggest day, week, or month in the Lookback Window
- Example: "10" would represent the range of the 10th biggest day in the past 250 days. (If the Lookback Window is "250")
RANGE 3 nth (Pink lines):
* This number represents the range of the nth biggest day, week, or month in the Lookback Window
- Example: "3" would represent the range of the 3rd biggest day in the past 250 days. (If the Lookback Window is "250")
YELLOW LINES:
* The yellow lines are the average percentage move of the inputted number in the Lookback Window
SUGGESTED INPUTS:
FOR DAILY:
Lookback Window: 250
Range 1 nth: 30
Range 2 nth: 10
Range 3 nth: 3
FOR WEEKLY:
Lookback Window: 50
Range 1 nth: 10
Range 2 nth: 5
Range 3 nth: 2
FOR MONTHLY:
Lookback Window: 12
Range 1 nth: 3
Range 2 nth: 2
Range 3 nth: 1
TIMEFRAMES TO USE (If You Have TradingView Premium):
Daily: 5 minute timeframe and higher (15 minute timeframe and higher for Futures)
Weekly: 15 minute timeframe and higher
Monthly: Daily timeframe and higher (Monthly still has issues)
TIMEFRAMES TO USE (If You DO NOT Have TradingView Premium):
Daily: 15 minute timeframe and higher
Weekly: 30 minute timeframe and higher
Monthly: Daily timeframe and higher (Monthly still has issues)
IMPORTANT RELATED NOTE:
If you decide to use a higher Lookback Window, the ranges might be off and the timeframes listed above might not apply
ISSUES THAT MIGHT BE RESOLVED IN THE FUTURE
1. If it is a shortened week (No Monday or Friday), then the Weekly Ranges will show the same ranges as last week
2. Monthly ranges will change based on any timeframe used