Fifty Percent RuleAlternative Approach: Embed a Chart with the Study Pre-Applied
If the studies parameter still doesn’t work, embed a chart where your study is already applied:
Apply the Fifty Percent Rule study to a chart.
Click Share → Embed Code.
Use the iframe-based embed code:
Educational
Fifty Percent RuleSPY allocation for use on the official NVS website.
This is not meant for general use, but is public solely to be used as an embed.
Nadaraya-Watson Envelope plus relative strenght of stockNadaraya-Watson Envelope plus relative strenght of stock
FTIFreedom Trading Indicator (FTI)
Instagram: instagram.com/freedom_university_xx
Overview:
The Freedom Trading Indicator (FTI) is a versatile and highly customizable session-based indicator designed for intraday traders who rely on tracking global market sessions. This script highlights the Asia, Frankfurt, London, and New York (AM & PM) trading sessions on the chart, allowing users to visualize session ranges and identify key price movements.
Key Features:
Customizable Sessions:
Asia (23:00 - 07:00 UTC)
Frankfurt (07:00 - 08:00 UTC)
London (08:00 - 12:00 UTC)
New York AM (13:00 - 16:00 UTC)
New York PM (17:00 - 23:00 UTC)
Traders can enable or disable any session individually.
Session Range Visualization:
Displays the high and low ranges of each session using customizable colors.
Option to enable range labels for each session.
Outlines and transparent background ranges provide clear visibility.
Timezone Flexibility:
Supports customization of UTC offsets.
Option to use the exchange’s timezone for automatic adjustment.
User-Friendly Customization:
Transparent range areas with adjustable visibility.
Optional range outlines and session labels for clarity.
Compact settings make it easy to adjust the script to your preference.
How It Works:
Each trading session is defined by its start and end times.
When enabled, the indicator tracks the price action during the session and marks the session’s range (high and low) on the chart.
The session ranges are updated in real-time, helping traders monitor key support and resistance levels within each session.
How to Use:
Add the Freedom Trading Indicator to your chart.
Adjust the session times, colors, and visibility in the settings panel.
Monitor the session ranges to identify price breakouts, consolidations, or reversals.
Practical Application:
Intraday Trading: Use session ranges to plan trades around major market open and close times.
Breakout Strategies: Identify price breakouts above or below session highs/lows.
Session-Specific Patterns: Spot trading opportunities by observing price behavior within specific global sessions.
Important Notes:
This indicator works best on the 4H timeframe to align with session tracking. If applied to other timeframes, a message will notify users.
Traders can combine this indicator with other tools like volume, price action, or trend-following indicators for a complete trading system.
Credits:
This script was developed from scratch with inspiration from session tracking methods widely used by traders. Any use of similar concepts is purely coincidental and implemented uniquely in this script.
By focusing on session analysis, the Freedom Trading Indicator equips traders with a powerful tool to align their trades with global market activity.
Disclaimer: This script is for educational and informational purposes only. Always test indicators in a demo environment before using them in live markets.
FTIFreedom Trading Indicator (FTI)
Instagram: instagram.com/freedom_university_xx
Overview:
The Freedom Trading Indicator (FTI) is a versatile and highly customizable session-based indicator designed for intraday traders who rely on tracking global market sessions. This script highlights the Asia, Frankfurt, London, and New York (AM & PM) trading sessions on the chart, allowing users to visualize session ranges and identify key price movements.
Key Features:
Customizable Sessions:
Asia (23:00 - 07:00 UTC)
Frankfurt (07:00 - 08:00 UTC)
London (08:00 - 12:00 UTC)
New York AM (13:00 - 16:00 UTC)
New York PM (17:00 - 23:00 UTC)
Traders can enable or disable any session individually.
Session Range Visualization:
Displays the high and low ranges of each session using customizable colors.
Option to enable range labels for each session.
Outlines and transparent background ranges provide clear visibility.
Timezone Flexibility:
Supports customization of UTC offsets.
Option to use the exchange’s timezone for automatic adjustment.
User-Friendly Customization:
Transparent range areas with adjustable visibility.
Optional range outlines and session labels for clarity.
Compact settings make it easy to adjust the script to your preference.
How It Works:
Each trading session is defined by its start and end times.
When enabled, the indicator tracks the price action during the session and marks the session’s range (high and low) on the chart.
The session ranges are updated in real-time, helping traders monitor key support and resistance levels within each session.
How to Use:
Add the Freedom Trading Indicator to your chart.
Adjust the session times, colors, and visibility in the settings panel.
Monitor the session ranges to identify price breakouts, consolidations, or reversals.
Practical Application:
Intraday Trading: Use session ranges to plan trades around major market open and close times.
Breakout Strategies: Identify price breakouts above or below session highs/lows.
Session-Specific Patterns: Spot trading opportunities by observing price behavior within specific global sessions.
Important Notes:
This indicator works best on the 4H timeframe to align with session tracking. If applied to other timeframes, a message will notify users.
Traders can combine this indicator with other tools like volume, price action, or trend-following indicators for a complete trading system.
Credits:
This script was developed from scratch with inspiration from session tracking methods widely used by traders. Any use of similar concepts is purely coincidental and implemented uniquely in this script.
By focusing on session analysis, the Freedom Trading Indicator equips traders with a powerful tool to align their trades with global market activity.
Disclaimer: This script is for educational and informational purposes only. Always test indicators in a demo environment before using them in live markets.
Estratégia de Scalping com EMA, RSI e SuperTrend - GALITOEste script combina três poderosos indicadores - EMA, RSI e SuperTrend - para identificar pontos ideais de entrada e saída em estratégias de scalping. A EMA ajuda a monitorar a tendência geral, enquanto o RSI detecta níveis de sobrecompra e sobrevenda. O SuperTrend valida os movimentos e fornece confirmações adicionais para operações mais seguras. Ideal para traders que operam em timeframes curtos, como gráficos de 1 a 5 minutos.
Lanczos CandlesThis indicator reconstructs price action using Lanczos resampling, incorporating lower timeframe data to create a more detailed representation of market movements. Traditional candle aggregation on higher timeframes tends to lose some price action detail - this indicator attempts to preserve more of that information through mathematical resampling.
The indicator samples price data from a lower timeframe and uses the Lanczos algorithm, a mathematical method commonly used in signal processing and image resampling, to reconstruct the price series at the chart's timeframe. The process helps maintain price movements that might otherwise be smoothed out in regular candle aggregation.
The main settings allow you to select the source timeframe for sampling, adjust the Lanczos filter width to balance smoothness versus detail preservation, and optionally enable Heikin Ashi calculation. The filter width parameter (default: 3) affects how aggressive the smoothing is - higher values produce smoother results while lower values retain more of the original variation.
This approach can be useful for technical analysis when you want to work with higher timeframes while maintaining awareness of significant price movements that occurred within those candles. The optional Heikin Ashi mode can help visualize trends in the resampled data.
The indicator works best when there's a clear ratio between your chart timeframe and the source timeframe (for example, using 1-minute data to build 5-minute candles).
Polyphase MACD (PMACD)The Polyphase MACD (PMACD) uses polyphase decimation to create a continuous estimate of higher timeframe MACD behavior. The number of phases represents the timeframe multiplier - for example, 3 phases approximates a 3x higher timeframe.
Traditional higher timeframe MACD indicators update only when each higher timeframe bar completes, creating stepped signals that can miss intermediate price action. The PMACD addresses this by maintaining multiple phase-shifted MACD calculations and combining them with appropriate anti-aliasing filters. This approach eliminates the discrete jumps typically seen in higher timeframe indicators, though the resulting signal may sometimes deviate from the true higher timeframe values due to its estimative nature.
The indicator processes price data through parallel phase calculations, each analyzing a different time-offset subset of the data. These phases are filtered and combined to prevent aliasing artifacts that occur in simple timeframe conversions. The result is a smooth, continuous signal that begins providing meaningful values immediately, without requiring a warm-up period of higher timeframe bars.
The PMACD maintains the standard MACD components - the MACD line (fast MA - slow MA), signal line, and histogram - while providing a more continuous view of higher timeframe momentum. Users can select between EMA and SMA calculations for both the oscillator and signal components, with all calculations benefiting from the same polyphase processing technique.
Polyphase Stochastic RSI (PSRSI)The Polyphase Stochastic RSI (PSRSI) provides a continuous estimate of higher timeframe Stochastic RSI behavior by using polyphase decimation. The number of phases represents the timeframe multiplier - for example, 3 phases approximates a 3x higher timeframe.
While traditional higher timeframe indicators only update at the completion of each higher timeframe bar, the PSRSI creates a continuous signal by maintaining multiple phase-shifted calculations and combining them with appropriate anti-aliasing filters. This approach eliminates the gaps and discontinuities typically seen in higher timeframe indicators, though the resulting signal may sometimes deviate from the true higher timeframe values due to its estimative nature.
The indicator processes data through parallel phase calculations, each handling a different subset of price data offset in time. These phases are then filtered and combined to prevent aliasing artifacts that occur in simple timeframe conversions. The result is a smooth, continuous signal that starts providing meaningful values immediately, without requiring a warm-up period of higher timeframe bars.
Users can choose between RSI and Stochastic RSI modes, with both benefiting from the same polyphase processing technique. The indicator maintains the standard interpretation of overbought and oversold conditions while providing a more continuous view of higher timeframe momentum.
Weighted Fourier Transform: Spectral Gating & Main Frequency🙏🏻 This drop has 2 purposes:
1) to inform every1 who'd ever see it that Weighted Fourier Tranform does exist, while being available nowhere online, not even in papers, yet there's nothing incredibly complicated about it, and it can/should be used in certain cases;
2) to show TradingView users how they can use it now in dem endevours, to show em what spectral filtering is, and what can they do with all of it in diy mode.
... so we gonna have 2 sections in the description
Section 1: Weighted Fourier Transform
It's quite easy to include weights in Fourier analysis: you just premultiply each datapoint by its corresponding weight -> feed to direct Fourier Transform, and then divide by weights after inverse Fourier transform. Alternatevely, in direct transform you just multiply contributions of each data point to the real and imaginary parts of the Fourier transform by corresponding weights (in accumulation phase), and in inverse transform you divide by weights instead during the accumulation phase. Everything else stays the same just like in non-weighted version.
If you're from the first target group let's say, you prolly know a thing or deux about how to code & about Fourier Transform, so you can just check lines of code to see the implementation of Weighted Discrete version of Fourier Transform, and port it to to any technology you desire. Pine Script is a developing technology that is incredibly comfortable in use for quant-related tasks and anything involving time series in general. While also using Python for research and C++ for development, every time I can do what I want in Pine Script, I reach for it and never touch matlab, python, R, or anything else.
Weighted version allows you to explicetly include order/time information into the operation, which is essential with every time series, although not widely used in mainstream just as many other obvious and right things. If you think deeply, you'll understand that you can apply a usual non-weighted Fourier to any 2d+ data you can (even if none of these dimensions represent time), because this is a geometric tool in essence. By applying linearly decaying weights inside Fourier transform, you're explicetly saying, "one of these dimensions is Time, and weights represent the order". And obviously you can combine multiple weightings, eg time and another characteristic of each datum, allows you to include another non-spatial dimension in your model.
By doing that, on properly processed (not only stationary but Also centered around zero data), you can get some interesting results that you won't be able to recreate without weights:
^^ A sine wave, centered around zero, period of 16. Gray line made by: DWFT (direct weighted Fourier transform) -> spectral gating -> IWFT (inverse weighted Fourier transform) -> plotting the last value of gated reconstructed data, all applied to expanding window. Look how precisely it follows the original data (the sine wave) with no lag at all. This can't be done by using non-weighted version of Fourier transform.
^^ spectral filtering applied to the whole dataset, calculated on the latest data update
And you should never forget about Fast Fourier Transform, tho it needs recursion...
Section 2: About use cases for quant trading, about this particular implementaion in Pine Script 6 (currently the latest version as of Friday 13, December 2k24).
Given the current state of things, we have certain limits on matrix size on TradingView (and we need big dope matrixes to calculate polynomial regression -> detrend & center our data before Fourier), and recursion is not yet available in Pine Script, so the script works on short datasets only, and requires some time.
A note on detrending. For quality results, Fourier Transform should be applied to not only stationary but also centered around zero data. The rightest way to do detrending of time series
is to fit Cumulative Weighted Moving Polynomial Regression (known as WLSMA in some narrow circles xD) and calculate the deltas between datapoint at time t and this wonderful fit at time t. That's exactly what you see on the main chart of script description: notice the distances between chart and WLSMA, now look lower and see how it matches the distances between zero and purple line in WFT study. Using residuals of one regression fit of the whole dataset makes less sense in time series context, we break some 'time' and order rules in a way, tho not many understand/cares abouit it in mainstream quant industry.
Two ways of using the script:
Spectral Gating aka Spectral filtering. Frequency domain filtering is quite responsive and for a greater computational cost does not introduce a lag the way it works with time-domain filtering. Works this way: direct Fourier transform your data to get frequency & phase info -> compute power spectrum out of it -> zero out all dem freqs that ain't hit your threshold -> inverse Fourier tranform what's left -> repeat at each datapoint plotting the very first value of reconstructed array*. With this you can watch for zero crossings to make appropriate trading decisions.
^^ plot Freq pass to use the script this way, use Level setting to control the intensity of gating. These 3 only available values: -1, 0 and 1, are the general & natural ones.
* if you turn on labels in script's style settings, you see the gray dots perfectly fitting your data. They get recalculated (for the whole dataset) at each update. You call it repainting, this is for analytical & aesthetic purposes. Included for demonstration only.
Finding main/dominant frequency & period. You can use it to set up Length for your other studies, and for analytical purposes simply to understand the periodicity of your data.
^^ plot main frequency/main period to use the script this way. On the screenshot, you can see the script applied to sine wave of period 16, notice how many datapoints it took the algo to figure out the signal's period quite good in expanding window mode
Now what's the next step? You can try applying signal windowing techniques to make it all less data-driven but your ego-driven, make a weighted periodogram or autocorrelogram (check Wiener-Khinchin Theorem ), and maybe whole shiny spectrogram?
... you decide, choice is yours,
The butterfly reflect the doors ...
∞
Multi TimeFrame OHLC Overlay @MaxMaseratiMulti TimeFrame OHLC Overlay @MaxMaserati
A powerful and versatile indicator that displays OHLC (Open, High, Low, Close) data across multiple timeframes with enhanced visualization features. Perfect for traders who need to analyze price action across different time periods simultaneously.
Key Features:
Customizable multi-timeframe OHLC visualization with box and line overlays
Extended OHLC lines from higher timeframes with clear labeling
Distinct bullish and bearish candle representations
Fully configurable color schemes and display options
Real-time timeframe information display
Main Components:
Multi-Timeframe Display
Primary timeframe OHLC visualization with boxes and lines
Extended timeframe overlay for broader market context
Clear visual distinction between timeframes
Customizable Visuals
Separate color settings for bullish and bearish patterns
Adjustable transparency for both body and wick components
Configurable OHLC line colors and visibility
Extended Lines Features
Higher timeframe OHLC level overlay
Custom labels with timeframe identification
Adjustable line properties and visibility
Information Display
Current timeframe indicator
Extended timeframe reference
Clean and unobtrusive interface
Settings Groups:
Extended OHLC Lines
Labels Options
Display Options
Bullish/Bearish Candle Settings
OHLC Lines Configuration
Usage Tips:
Start with the default 240-minute timeframe or adjust to your preferred interval
Use the extended lines feature to view higher timeframe levels
Customize colors and transparency to match your chart theme
Enable/disable specific components based on your analysis needs
Perfect For:
Multi-timeframe analysis
Support/Resistance identification
Price action trading
Trend following strategies
Market structure analysis
This indicator combines powerful multi-timeframe analysis capabilities with clean visualization, making it an essential tool for traders who need to maintain awareness of price action across different time periods.
Note:
For optimal performance, adjust the visual settings according to your chart's timeframe and color scheme. The indicator is designed to work seamlessly across all trading instruments and timeframes.
Custom Strategy: ETH Martingale 2.0Strategic characteristics
ETH Little Martin 2.0 is a self-developed trading strategy based on the Martingale strategy, mainly used for trading ETH (Ethereum). The core idea of this strategy is to place orders in the same direction at a fixed price interval, and then use Martin's multiple investment principle to reduce losses, but this is also the main source of losses.
Parameter description:
1 Interval: The minimum spacing for taking profit, stop loss, and opening/closing of orders. Different targets have different spacing. Taking ETH as an example, it is generally recommended to have a spacing of 2% for fluctuations in the target.
2 Base Price: This is the price at which you triggered the first order. Similarly, I am using ETH as an example. If you have other targets, I suggest using the initial value of a price that can be backtesting. The Base Price is only an initial order price and has no impact on subsequent orders.
3 Initial Order Amount: Users can set an initial order amount to control the risk of each transaction. If the stop loss is reached, we will double the amount based on this value. This refers to the value of the position held, not the number of positions held.
4 Loss Multiplier: The strategy will increase the next order amount based on the set multiple after the stop loss, in order to make up for the previous losses through a larger position. Note that after taking profit, it will be reset to 1 times the Initial Order Amount.
5. Long Short Operation: The first order of the strategy is a multiple entry, and in subsequent orders, if the stop loss is reached, a reverse order will be opened. The position value of a one-way order is based on the Loss Multiplier multiple investment, so it is generally recommended that the Loss Multiplier default to 2.
Improvement direction
Although this strategy already has a certain trading logic, there are still some improvement directions that can be considered:
1. Dynamic adjustment of spacing: Currently, the spacing is fixed, and it can be considered to dynamically adjust the spacing based on market volatility to improve the adaptability of the strategy. Try using dynamic spacing, which may be more suitable for the actual market situation.
2. Filtering criteria: Orders and no orders can be optimized separately. The biggest problem with this strategy is that it will result in continuous losses during fluctuations, and eventually increase the investment amount. You can consider filtering out some fluctuations or only focusing on trend trends.
3. Risk management: Add more risk management measures, such as setting a maximum loss limit to avoid huge losses caused by continuous stop loss.
4. Optimize the stop loss multiple: Currently, the stop loss multiple is fixed, and it can be considered to dynamically adjust the multiple according to market conditions to reduce risk.
Employee Portfolio Generator [By MUQWISHI]▋ INTRODUCTION :
The “Employee Portfolio Generator” simplifies the process of building a long-term investment portfolio tailored for employees seeking to build wealth through investments rather than traditional bank savings. The tool empowers employees to set up recurring deposits at customizable intervals, enabling to make additional purchases in a list of preferred holdings, with the ability to define the purchasing investment weight for each security. The tool serves as a comprehensive solution for tracking portfolio performance, conducting research, and analyzing specific aspects of portfolio investments. The output includes an index value, a table of holdings, and chart plots, providing a deeper understanding of the portfolio's historical movements.
_______________________
▋ OVERVIEW:
● Scenario (The chart above can be taken as an example) :
Let say, in 2010, a newly employed individual committed to saving $1,000 each month. Rather than relying on a traditional savings account, chose to invest the majority of monthly savings in stable well-established stocks. Allocating 30% of monthly saving to AMEX:SPY and another 30% to NASDAQ:QQQ , recognizing these as reliable options for steady growth. Additionally, there was an admired toward innovative business models of NASDAQ:AAPL , NASDAQ:MSFT , NASDAQ:AMZN , and NASDAQ:EBAY , leading to invest 10% in each of those companies. By the end of 2024, after 15 years, the total monthly deposits amounted to $179,000, which would have been the result of traditional saving alone. However, by sticking into long term invest, the value of the portfolio assets grew, reaching nearly $900,000.
_______________________
▋ OUTPUTS:
The table can be displayed in three formats:
1. Portfolio Index Title: displays the index name at the top, and at the bottom, it shows the index value, along with the chart timeframe, e.g., daily change in points and percentage.
2. Specifications: displays the essential information on portfolio performance, including the investment date range, total deposits, free cash, returns, and assets.
3. Holdings: a list of the holding securities inside a table that contains the ticker, last price, entry price, return percentage of the portfolio's total deposits, and latest weighted percentage of the portfolio. Additionally, a tooltip appears when the user passes the cursor over a ticker's cell, showing brief information about the company, such as the company's name, exchange market, country, sector, and industry.
4. Indication of New Deposit: An indication of a new deposit added to the portfolio for additional purchasing.
5. Chart: The portfolio's historical movements can be visualized in a plot, displayed as a bar chart, candlestick chart, or line chart, depending on the preferred format, as shown below.
_______________________
▋ INDICATOR SETTINGS:
Section(1): Table Settings
(1) Naming the index.
(2) Table location on the chart and cell size.
(3) Sorting Holdings Table. By securities’ {Return(%) Portfolio, Weight(%) Portfolio, or Ticker Alphabetical} order.
(4) Choose the type of index: {Assets, Return, or Return (%)}, and the plot type for the portfolio index: {Candle, Bar, or Line}.
(5) Positive/Negative colors.
(6) Table Colors (Title, Cell, and Text).
(7) To show/hide any of selected indicator’s components.
Section(2): Recurring Deposit Settings
(1) From DateTime of starting the investment.
(2) To DateTime of ending the investment
(3) The amount of recurring deposit into portfolio and currency.
(4) The frequency of recurring deposits into the portfolio {Weekly, 2-Weeks, Monthly, Quarterly, Yearly}
(5) The Depositing Model:
● Fixed: The amount for recurring deposits remains constant throughout the entire investment period.
● Increased %: The recurring deposit amount increases at the selected frequency and percentage throughout the entire investment period.
(5B) If the user selects “ Depositing Model: Increased % ”, specify the growth model (linear or exponential) and define the rate of increase.
Section(3): Portfolio Holdings
(1) Enable a ticker in the investment portfolio.
(2) The selected deposit frequency weight for a ticker. For example, if the monthly deposit is $1,000 and the selected weight for XYZ stock is 30%, $300 will be used to purchase shares of XYZ stock.
(3) Select up to 6 tickers that the investor is interested in for long-term investment.
Please let me know if you have any questions
DCA Order Info PlannerDescription :
This script is a Dollar-Cost Averaging (DCA) order planner designed for SPOT, LONG, and SHORT markets. It automatically calculates the optimal price levels for your orders based on configurable parameters, while also considering leverage and liquidation price.
🔹 Key Features:
1. Automatic Order Planning:
- The script calculates price levels for your orders based on an adjustable scaling coefficient (default: 1.5).
- You can set the percentage interval between each order (default: 2%).
- Displays the number of units to buy/sell at each level.
2.Leverage Management:
- Integrates a configurable leverage and computes the liquidation price for LONG and SHORT positions.
3.Clear Visual Display:
- Markers on the chart indicating order levels with customizable labels.
- A summary table shows price levels and corresponding quantities.
- Visualizes Stop Loss and Take Profit levels if defined.
4.Automatic Alerts:
- Sends alerts when the price reaches an order level.
🔹 Customizable Parameters:
- Starting Price: Initial price for calculating orders.
- Budget: Total budget for DCA orders.
- Leverage: Multiplier for LONG/SHORT positions.
- Scaling Coefficient: Adjusts the spacing between order levels.
- Maximum DCA Levels: Limits the number of generated orders.
🔹 How to Use:
1. Configure the parameters according to your strategy.
2. The script displays order levels and quantities on the chart.
3. Use the summary table to manually input orders on your favorite trading platform.
This script is particularly useful in volatile market conditions to average your entry or exit price and manage risk effectively.
Overnight High/LowThe script identifies the Overnight High (the highest price) and Overnight Low (the lowest price) for a trading instrument during a specified overnight session. It then plots these levels on the chart for reference in subsequent trading sessions.
Key Features:
Time Settings:
The script defines the start (startHour) and end (endHour + endMinute) times for the overnight session.
The session spans across two calendar days, such as 5:00 PM (17:00) to 9:30 AM (09:30).
Tracking High and Low:
During the overnight session, the script dynamically tracks:
Overnight High: The highest price reached during the session.
Overnight Low: The lowest price reached during the session.
Reset Mechanism:
After the overnight session ends (at the specified end time), the script resets the overnightHigh and overnightLow variables, preparing for the next session.
Visual Representation:
The script uses horizontal dotted lines to plot:
A green line for the Overnight High.
A red line for the Overnight Low.
These lines extend to the right of the chart, providing visual reference points for traders.
How It Works:
Session Detection:
The script checks whether the current time falls within the overnight session:
If the hour is greater than or equal to the start hour (e.g., 17:00).
Or if the hour is less than or equal to the end hour (e.g., 09:30), considering the next day.
The end minute (e.g., 30 minutes past the hour) is also considered for precision.
High and Low Calculation:
During the overnight session:
If the overnightHigh is not yet defined, it initializes with the current candle's high.
If already defined, it updates by comparing the current candle's high to the existing overnightHigh using the math.max function.
Similarly, overnightLow is initialized or updated using the math.min function.
Post-Session Reset:
After the session ends, the script clears the overnightHigh and overnightLow variables by setting them to na (not available).
Line Drawing:
The script draws horizontal dotted lines for the Overnight High and Low during and after the session.
The lines extend indefinitely to the right of the chart.
Benefits:
Visual Aid: Helps traders quickly identify overnight support and resistance levels, which are critical for intraday trading.
Automation: Removes the need for manually plotting these levels each day.
Customizable: Time settings can be adjusted to match different markets or trading strategies.
This script is ideal for traders who use the overnight range as part of their analysis for breakouts, reversals, or trend continuation strategies.
IU Opening range Breakout StrategyIU Opening Range Breakout Strategy
This Pine Script strategy is designed to capitalize on the breakout of the opening range, which is a popular trading approach. The strategy identifies the high and low prices of the opening session and takes trades based on price crossing these levels, with built-in risk management and trade limits for intraday trading.
Key Features:
1. Risk Management:
- Risk-to-Reward Ratio (RTR):
Set a customizable risk-to-reward ratio to calculate target prices based on stop-loss levels.
Default: 2:1
- Max Trades in a Day:
Specify the maximum number of trades allowed per day to avoid overtrading.
Default: 2 trades in a day.
- End-of-Day Close:
Automatically closes all open positions at a user-defined session end time to ensure no overnight exposure.
Default: 3:15 PM
2. Opening Range Identification
- Opening Range High and Low:
The script detects the high and low of the first trading session using Pine Script's session functions.
These levels are plotted as visual guides on the chart:
- High: Lime-colored circles.
- Low: Red-colored circles.
3. Trade Entry Logic
- Long Entry:
A long trade is triggered when the price closes above the opening range high.
- Entry condition: Crossover of the price above the opening range high.
-Short Entry:
A short trade is triggered when the price closes below the opening range low.
- Entry condition: Crossunder of the price below the opening range low.
Both entries are conditional on the absence of an existing position.
4. Stop Loss and Take Profit
- Long Position:
- Stop Loss: Previous candle's low.
- Take Profit: Calculated based on the RTR.
- **Short Position:**
- **Stop Loss:** Previous candle's high.
- **Take Profit:** Calculated based on the RTR.
The strategy plots these levels for visual reference:
- Stop Loss: Red dashed lines.
- Take Profit: Green dashed lines.
5. Visual Enhancements
-Trade Level Highlighting:
The script dynamically shades the areas between the entry price and SL/TP levels:
- Red shading for the stop-loss region.
- Green shading for the take-profit region.
- Entry Price Line:
A silver-colored line marks the average entry price for active trades.
How to Use:
1.Input Configuration:
Adjust the Risk-to-Reward ratio, max trades per day, and session end time to suit your trading preferences.
2.Visual Cues:
Use the opening range high/low lines and shading to identify potential breakout opportunities.
3.Execution:
The strategy will automatically enter and exit trades based on the conditions. Review the plotted SL and TP levels to monitor the risk-reward setup.
Important Notes:
- This strategy is designed for intraday trading and works best in markets with high volatility during the opening session.
- Backtest the strategy on your preferred market and timeframe to ensure compatibility.
- Proper risk management and position sizing are essential when using this strategy in live markets.
3 Timeframe MACD3 Timeframe MACD Indicator
This indicator provides a multi-timeframe visualization of the MACD (Moving Average Convergence Divergence), enabling traders to analyze momentum and trend signals effectively across different timeframes.
Key Features:
Multi-Timeframe Capability:
Timeframe 1: Automatically uses the chart's current timeframe and displays the MACD Histogram along with the MACD line and Signal line.
Timeframe 2: A user-defined timeframe (default: 4 hours) displays both the MACD line and Signal line for trend and crossover analysis.
Timeframe 3: Another user-defined timeframe (default: 1 day) also displays the MACD line and Signal line, with increased line thickness for emphasis.
Dynamic Histogram Plot:
Timeframe 1's histogram is color-coded:
Green shades for positive values (brighter for increasing momentum).
Red shades for negative values (darker for increasing negative momentum).
Customizable MACD Parameters:
Adjustable Fast Length, Slow Length, and Signal Length to tailor the MACD calculation to specific trading styles or assets.
Clear and Distinct Visualizations:
Timeframe 1 includes the MACD Histogram with MACD and Signal lines for a detailed momentum view.
Timeframes 2 and 3 highlight the MACD and Signal lines in distinct colors for easy differentiation.
Use Case:
Ideal for traders seeking to monitor momentum changes (via Histogram) and trend/crossover signals (via MACD and Signal lines) across the current and two higher/lower timeframes.
Enhances decision-making by providing multi-timeframe confluence for trend-following or countertrend strategies.
This indicator is particularly useful for traders looking for a streamlined way to incorporate multi-timeframe analysis into their trading workflow.
Intraday Trend CandlesThe Intraday Trend Candles (ITC) indicator is a Pine Script-based tool designed for traders seeking to visualize market trends effectively. Using a combination of the Look Back Period, a multiplier for true range, and linearly weighted moving averages (LWMA), this indicator calculates dynamic trend limits that adapt to price movements. It identifies key trend shifts by comparing the current price to these dynamic thresholds, resulting in a visually intuitive display of market bias directly on the chart. The indicator is particularly well-suited for intraday trading, as it provides responsive insights tailored to short-term price action.
The ITC plots color-coded candles, highlighting bullish trends in blue and bearish trends in yellow, with gray indicating indecision or trend continuation. This color-coded approach makes it easy to identify reversals and trend dynamics at a glance. Additionally, a trend line is plotted to enhance clarity, signaling whether the price is favoring the upper or lower threshold of the calculated range. With built-in alerts for trend reversals, traders can stay informed about critical market shifts without constantly monitoring the chart. This combination of visual cues and alerts makes the ITC a versatile and powerful tool for traders focusing on momentum and trend-following strategies.
Bar Replay Fix - Smooth Candle Transition for TradingViewThe Bar Replay Fix indicator addresses a known issue in TradingView’s Bar Replay mode, where the last completed candle is incorrectly drawn when switching from a lower timeframe to a higher one. This issue can create confusion during analysis, especially when replaying historical price action.
Key Features:
Accurate Candle Rendering: Ensures that candles are displayed correctly in Bar Replay mode by referencing and plotting the previous candle data.
Customizable Appearance: Configure the candle body, wick, and border colors for bullish, bearish, and doji candles to match your chart theme.
Seamless Integration: Works invisibly in the background to provide a smoother and more reliable replay experience.
Use Cases:
Enhance your backtesting accuracy by eliminating incorrect candle rendering during Bar Replay.
Maintain consistency in candle visualization when transitioning between timeframes in Replay mode.
Disclaimer: This indicator is specifically designed to resolve a visual issue in Bar Replay mode and does not provide any trading signals or analysis recommendations.
Hidden SMT Divergence ICT 01 [TradingFinder] HSMT SMC Technique🔵 Introduction
Hidden SMT Divergence, an advanced concept within the Smart Money Technique (SMT), identifies discrepancies between correlated assets by focusing on their closing prices.
Unlike the standard SMT Divergence, which uses high and low prices for analysis, Hidden SMT Divergence uncovers subtle signals by examining divergences based on the assets' closing values.
These divergences often highlight potential reversals or trend continuations, making this technique a valuable tool for traders aiming to anticipate market movements.
This approach applies across various markets and asset classes, including :
Commodities : CAPITALCOM:GOLD vs. CAPITALCOM:SILVER or BLACKBULL:BRENT vs. BLACKBULL:WTI .
Indices : NASDAQ:NDX vs. TVC:SPX vs. FX:US30 .
FOREX : FX:EURUSD vs. OANDA:GBPUSD vs. TVC:DXY (US Dollar Index).
Cryptocurrencies : BITSTAMP:BTCUSD vs. COINBASE:ETHUSD vs. KUCOIN:SOLUSDT vs. CRYPTOCAP:TOTAL3 .
Volatility Measures : FOREXCOM:XAUUSD vs. TVC:VIX (Volatility Index).
By identifying divergences within these asset groups, traders can gain actionable insights into potential market reversals or shifts in trend direction. Hidden SMT Divergence is particularly effective for pinpointing subtle market signals that traditional methods may overlook.
Bullish Hidden SMT Divergence : This divergence emerges when one asset forms a higher low, while the correlated asset creates a lower low in terms of their closing prices. It often signals weakening downward momentum and a potential reversal to the upside.
Bearish Hidden SMT Divergence : This occurs when one asset establishes a higher high, while the correlated asset forms a lower high based on their closing prices. It typically reflects declining upward momentum and a probable shift to the downside.
🔵 How to Use
The Hidden SMT Divergence indicator provides traders with a systematic approach to identify market reversals or trend continuations through divergences in closing prices between two correlated assets.
🟣 Bullish Hidden SMT Divergence
Bullish Hidden SMT Divergence occurs when the closing price of the primary asset forms a higher low, while the correlated asset creates a lower low. This pattern indicates weakening downward momentum and signals a potential reversal to the upside.
After identifying the divergence, confirm it using additional tools like support levels, volume trends, or indicators such as RSI and MACD. Enter a buy position as the price shows signs of reversal near support zones, ensuring proper risk management by placing a stop-loss below the support level.
Bearish Hidden SMT Divergence
Bearish Hidden SMT Divergence is identified when the closing price of the primary asset forms a higher high, while the correlated asset creates a lower high. This divergence suggests a weakening uptrend and a likely reversal to the downside.
Validate the signal by examining resistance levels, declining volume, or complementary indicators. Consider entering a sell position as the price starts declining from resistance levels, and set a stop-loss above the resistance zone to limit potential losses.
🔵 Setting
Second Symbol : Select the secondary asset to compare with the primary asset. By default, "XAUUSD" (Gold) is used, but it can be customized to any stock, cryptocurrency, or currency pair.
Divergence Fractal Periods : Defines the number of past candles considered for identifying divergences. The default value is 2, but traders can adjust it for greater precision.
Bullish Divergence Line : Displays a dashed line connecting the points of bullish divergence.
Bearish Divergence Line : Shows a similar line for bearish divergence points.
Bullish Divergence Label : Marks areas of bullish divergence with a "+SMT" label.
Bearish Divergence Label : Highlights bearish divergences with a "-SMT" label.
Chart Type : Choose between Line or Candle charts for enhanced visualization.
🔵 Conclusion
Hidden SMT Divergence offers traders a refined method for identifying market reversals by analyzing closing price discrepancies between correlated assets. Its ability to uncover subtle divergences makes it an essential tool for traders who aim to stay ahead of market trends.
By integrating this technique with other technical analysis tools and sound risk management, traders can enhance their decision-making process and capitalize on market opportunities with greater confidence.
Hidden SMT Divergence’s focus on closing prices ensures more precise signals, helping traders refine their strategies across various markets, including Forex, commodities, indices, and cryptocurrencies.
Its open-source nature allows for customization and verification, providing transparency and flexibility to suit diverse trading needs. Hidden SMT Divergence stands as a powerful addition to the arsenal of any trader seeking to unlock hidden opportunities in dynamic financial markets.
Advanced MA and MACD PercentageIntroduction
The "Advanced MA and MACD Percentage" indicator is a powerful and innovative tool designed to help traders analyze financial markets with ease and precision. This indicator combines Moving Averages (MA) with the MACD indicator to assess the market’s overall trend and calculate the percentage of buy and sell signals based on current data.
Features
Multi-Timeframe Analysis:
Allows selecting your preferred timeframe for trend analysis, such as minute, hourly, daily, or weekly charts.
Support for Multiple Moving Average Types:
Offers the option to use either Simple Moving Average (SMA) or Exponential Moving Average (EMA), based on user preference.
Comprehensive MACD Analysis:
Analyzes the relationship between multiple moving averages (e.g., 20/50, 50/100) using MACD to provide deeper insights into market dynamics.
Calculation of Buy and Sell Percentages:
Computes the percentage of indicators signaling buy or sell conditions, providing a clear summary to assist trading decisions.
Intuitive Visual Interface:
Displays buy and sell percentages as two visible lines (green and red) on the chart.
Includes reference lines to clarify the range of percentages (100% to 0%).
How It Works
Moving Averages Calculation:
Calculates moving averages (20, 50, 100, 150, and 200) for the selected timeframe.
MACD Pair Analysis:
Computes the MACD to compare the performance between various moving average pairs, such as (20/50) and (50/100).
Identifying Buy and Sell Signals:
Counts the number of indicators signaling buy (price above MAs or positive MACD histogram).
Converts the count into percentages for both buy and sell signals.
Visual Representation:
Plots buy and sell percentages as clear lines (green for buy, red for sell).
Adds reference lines (100% and 0%) for easier interpretation.
How to Use the Indicator?
Settings:
Choose the type of moving average (SMA or EMA).
Select the timeframe that suits your strategy (e.g., 15 minutes, 1 hour, or daily).
Reading the Results:
If the buy percentage (green line) is above 50%, the overall trend is bullish (buy).
If the sell percentage (red line) is above 50%, the overall trend is bearish (sell).
Integrating Into Your Strategy:
Combine it with other indicators to confirm entry and exit signals.
Use it to quickly understand the market’s overall trend without needing complex manual analysis.
Benefits of the Indicator
Simplified Analysis: Provides a straightforward summary of the market's overall trend.
Adaptable to All Timeframes: Works perfectly on all timeframes.
Customizable: Allows users to adjust settings according to their needs.
Important Notes
This indicator does not provide direct buy or sell signals. Instead, it offers a summary of the market’s condition based on a combination of indicators.
It is recommended to use it alongside other technical analysis tools for precise trading signals.
Conclusion
The "Advanced MA and MACD Percentage" indicator is an ideal tool for traders who want to analyze the market using a combination of Moving Averages and MACD. It gives you a comprehensive overview of the overall trend, helping you make informed and quick trading decisions. Try it now and see the difference!