Indicator 10**Indicator 10** is a sophisticated technical analysis tool designed for use on trading platforms that support Pine Script (version 5). This indicator is primarily focused on analyzing price movements over different timeframes, incorporating elements of ZigZag analysis, Fibonacci levels, and historical price range calculations. Below is a detailed description of its features and functionalities:
#### Key Features:
1. **Input Variables:**
- **Year_calc:** Specifies the number of years to consider for historical price range calculations.
- **Size_fibo:** Defines the size of the Fibonacci levels in points.
- **Dig:** Represents the minimum tick size for the instrument being analyzed.
- **ZigZag Parameters:**
- **Period (zigzag_len):** The length of the ZigZag indicator.
- **Depth (zigzag_depth):** The depth percentage for the ZigZag indicator.
- **Display Count (zigzag_hist):** The number of ZigZag points to display.
- **Font Size (font_size):** The size of the font used for labels.
2. **Historical Price Range Calculation:**
- The indicator calculates the average weekly and monthly price ranges over the specified number of years (`Year_calc`).
- These ranges are used to adjust the Fibonacci levels dynamically based on historical volatility.
3. **ZigZag Analysis:**
- The indicator employs a custom ZigZag function to identify significant price swings on different timeframes (H4, D1, W1).
- The ZigZag points are stored in arrays, allowing for the visualization of recent price swings.
4. **Fibonacci Adjustment:**
- The Fibonacci levels are adjusted based on the historical price ranges (`W1_Val`, `MN1_Val`, `D1_Val`).
- These adjusted levels are used to draw support and resistance lines on the chart.
5. **Visualization:**
- The indicator draws lines and labels on the chart to represent the ZigZag points and adjusted Fibonacci levels.
- Different colors are used to distinguish between upward and downward trends.
6. **Dynamic Updates:**
- The indicator continuously updates the ZigZag points and Fibonacci levels as new price data becomes available.
- It ensures that only the most recent ZigZag points are displayed, maintaining a clean and relevant chart.
#### How It Works:
1. **Initialization:**
- The indicator initializes variables for storing historical price ranges and ZigZag points.
- It sets the start date for historical calculations based on the current year minus the specified number of years (`Year_calc`).
2. **Historical Data Retrieval:**
- The indicator retrieves weekly and monthly high and low prices for the specified period.
- It calculates the total price range and the average range for each timeframe.
3. **ZigZag Calculation:**
- The custom ZigZag function identifies local highs and lows based on the specified period and depth.
- These points are stored in arrays for later visualization.
4. **Fibonacci Adjustment:**
- The Fibonacci levels are adjusted based on the historical price ranges and the specified Fibonacci size.
- These adjusted levels are used to draw lines on the chart.
5. **Visualization:**
- The indicator draws lines connecting ZigZag points and labels indicating the direction of the trend.
- It ensures that only the most recent ZigZag points are displayed, maintaining a clean and relevant chart.
6. **Continuous Updates:**
- The indicator continuously updates the ZigZag points and Fibonacci levels as new price data becomes available.
- It ensures that only the most recent ZigZag points are displayed, maintaining a clean and relevant chart.
#### Conclusion:
**Indicator 10** is a powerful tool for traders who rely on historical price analysis, ZigZag patterns, and Fibonacci levels to make trading decisions. Its dynamic and adaptive nature ensures that the chart remains relevant and useful, providing traders with a clear view of recent price movements and potential support/resistance levels.
Chỉ báo và chiến lược
Supertrend Scanner on ChartThis Indicator is Used to scan 10 stock on chart.
Supertrend is widely used indicator on tradingview. So we have used the originals indicator codes of supertrend by tradingview here. Background color has been changed as per supertrend trrend.
Problem : Sometime trader wants to track multiple stocks supertrend at a time. Mostly those stock are of same sector. To track all the stocks of same sector in one chart , trader has to open multiple charts for that.
Solution : This indicator pointout where other stocks has changed the trend. Like if you see "SBIN" written in GEREEN at bottom of the candle , that means on that particular candle SBIN supertrend has changed to positive. Similarly if you see "KOTAK" written in RED at top of the candle the means supertrend has changed to Negative on that particular candle. Its so easy to trace 10 stock on same chart which stocks labelling.
How to use :
When you trade on any index , then apply all the index constituents stock on this indicator. When Index changes the trend and that change in trend is confirmed by other constituents ( like 7/10 confirmed ) then that is confirmed trend. If all the constituents are on same direction than that's the confirmed trend.
Disclamer : This indicator is for education purpose , for any profit or loss , we are not responsible. Trade on your own risk.
Trend Magic with EMA, SMA, and Auto-TradingRelease Notes
Strategy Name: Trend Magic with EMA, SMA, and Auto-Trading
Purpose: This strategy is designed to capture entry and exit points in the market using the Trend Magic indicator and three moving averages (EMA45, SMA90, and SMA180). Specifically, it uses the perfect order of the moving averages and the color changes in Trend Magic to identify trend reversals and potential trading opportunities.
Uniqueness and Usefulness
Uniqueness: The strategy utilizes the Trend Magic indicator, which is based on price and volatility, along with three moving averages to assess the strength of trends. The signals are generated only when the moving averages are in perfect order, and the Trend Magic color changes, ensuring that the entry is made during established trends. This combination provides a higher degree of reliability compared to strategies that rely solely on price action or single indicators.
Usefulness: This strategy is particularly useful for traders looking to capture trends over longer periods. It is effective at reducing noise in the market, only providing signals when the moving averages align and the Trend Magic indicator confirms a trend reversal. It works well in both trending and volatile markets.
Entry Conditions
Long Entry:
Condition: A perfect order (EMA45 > SMA90 > SMA180) is established, and Trend Magic changes color from red to blue.
Signal: A buy signal is generated, indicating the start of an uptrend.
Short Entry:
Condition: A perfect order (EMA45 < SMA90 < SMA180) is established, and Trend Magic changes color from blue to red.
Signal: A sell signal is generated, indicating the start of a downtrend.
Exit Conditions
Exit Strategy:
This strategy automatically enters and exits trades based on signals, but traders are encouraged to manage exits manually according to their own risk management preferences. The strategy includes stop loss and take profit settings based on risk-to-reward ratios for better risk management.
Risk Management
The strategy includes built-in risk management by using the SMA90 level at the time of entry as the stop-loss point and setting the take profit at a 1:1.5 risk-to-reward ratio. The stop-loss level is fixed at the entry point and does not move as the market progresses. Traders are advised to implement additional risk management, such as trailing stops, for added protection.
Account Size: ¥100,000
Commissions and Slippage: Assumes 94 pips for commissions and 1 pip for slippage per trade
Risk per Trade: 10% of account equity (adjust this based on personal risk tolerance)
Configurable Options
Configurable Options:
CCI Period: Set the period for the CCI used to calculate the Trend Magic indicator (default is 21).
ATR Multiplier: Set the multiplier for ATR used in the Trend Magic calculation (default is 1.0).
EMA/SMA Periods: The periods for the three moving averages (default is EMA45, SMA90, and SMA180).
Signal Display Control: An option to toggle the display of buy and sell signals on the chart.
Adequate Sample Size
To ensure the robustness and reliability of this strategy, it is recommended to backtest it with a sufficiently long period of historical data. Testing across different market conditions, including high and low volatility periods, is also advised.
Credits
Acknowledgments:
This strategy is based on the Trend Magic indicator combined with moving averages and draws on contributions from the technical analysis and trading community.
Clean Chart Description
Chart Appearance:
To maintain a clean and simple chart, this strategy includes options to turn off the display of Trend Magic, moving averages, and entry signals. Traders can adjust these display settings as needed to minimize visual clutter and focus on effective trend analysis.
Addressing the House Rule Violations
Omissions and Unrealistic Claims
Clarification:
This strategy does not make any unrealistic or unsupported claims about its performance. All signals are intended for educational purposes only and do not guarantee future results. It is important to note that past performance does not guarantee future outcomes, and proper risk management is crucial.
TASC 2024.10 Adaptive Oscillator Threshold█ OVERVIEW
This script introduces a more dynamic approach to generating trading signals using the RSI indicator and a threshold that adapts to price trends and dispersion. This methodology comes from Francesco Bufi's article "Overbought/Oversold Oscillators: Useless Or Just Misused" from the October 2024 edition of TASC's Traders' Tips .
█ CONCEPTS
According to Francesco Bufi's observations, an oscillator-based buy signal should have a threshold that varies with the trend direction: higher during uptrends and lower during downtrends. Additionally, the level should decrease as the distance from the price to its mean increases to reduce signals in volatile conditions. Accordingly, Bufi proposes a formula for an adaptive buy level whose value is proportional to the trend (linear regression slope) and inversely proportional to the typical distance between price and its mean (standard deviation). Traders can apply this method to any oscillator to add adaptivity without modifying the oscillator's calculations, as it's simply an adaptive technique for interpreting the calculated values.
This script demonstrates the application of Bufi's Adaptive Threshold (BAT) in a simple RSI-based strategy and allows users to compare its performance to the traditional fixed-threshold approach. Bufi's observations suggest that using the BAT instead of a static threshold can help improve the backtest performance of oscillator-based systems.
█ DISCLAIMER
This strategy script educates users on the trading systems outlined by the TASC article. By default, it uses 10% of equity as the order size and a slippage amount of 5 ticks. Traders should adjust these settings and the commission amount when using this script.
Power MarketPower Market Indicator
Description: The Power Market Indicator is designed to help traders assess market strength and make informed decisions for entering and exiting positions. This innovative indicator provides a comprehensive view of the evolution of Simple Moving Averages (SMA) over different periods and offers a clear measure of market strength through a total score.
Key Features:
Multi-Period SMA Analysis:
Calculates Simple Moving Averages (SMA) for 10 different periods ranging from 10 to 100.
Provides detailed analysis by comparing the current closing price with these SMAs.
Market Strength Measurement:
Assesses market strength by calculating a total score based on the relationship between the closing price and the SMAs.
The total score is displayed as a histogram with distinct colors for positive and negative values.
Smoothed Curve for Better View:
A smoothing of the total score is applied using a 5-period Simple Moving Average to represent the overall trend more smoothly.
Dynamic Information Table:
Real-time display of the maximum and minimum values among the SMAs, as well as the difference between these values, providing valuable insights into the variability of moving averages.
Visual Reference Lines:
Horizontal lines at zero, +50, and -50 for easy evaluation of key score levels.
How to Use the Indicator:
Position Entries: Use high positive scores to identify buying opportunities when market strength is strong.
Position Exits: Negative scores may signal market weakness, allowing you to exit positions or wait for a better opportunity.
Data Analysis: The table helps you understand the variability of SMAs, offering additional context for your trading decisions.
This powerful tool provides an in-depth view of market dynamics and helps you navigate your trading strategies with greater confidence. Embrace the Power Market Indicator and optimize your trading decisions today!
Connors RSI with Down GapThe Connors RSI with Down Gap indicator is a technical tool designed to support Larry Connors' Terror Gap Strategy, which is part of his broader framework outlined in the book "Buy the Fear, Sell the Greed: 7 Behavioral Quant Strategies for Traders." This specific indicator integrates the ConnorsRSI calculation with a focus on detecting down gaps in price, providing insights into moments when panic selling may occur.
The ConnorsRSI
ConnorsRSI is a composite indicator developed by Larry Connors that combines three core components:
RSI: A short-term relative strength index measuring the speed and magnitude of price changes.
Streak RSI: Tracks consecutive up or down closes to assess momentum.
Percent Rank: Evaluates how the current close ranks in relation to past prices.
When combined, these three elements provide a nuanced view of short-term overbought or oversold conditions. ConnorsRSI readings below a certain threshold (commonly 30 or lower) suggest that the asset has been heavily sold, indicating potential exhaustion of selling pressure.
Behavioral Finance Insights
The Terror Gap Strategy is grounded in principles from behavioral finance, which studies how psychological factors affect market participants' decision-making. Specifically, the indicator exploits the fear and irrational behavior that often arise when traders face persistent losses, especially after a down gap. According to behavioral finance theories like prospect theory (Kahneman & Tversky, 1979), people tend to overreact to losses, leading to panic selling. This creates opportunities for contrarian traders who understand the psychology behind these market movements.
The ConnorsRSI with Down Gap indicator works because it identifies:
Overextended selling through the ConnorsRSI, where persistent price declines result in low RSI values (indicating panic).
Gap down days, where the opening price is below the previous day’s close, typically amplifying the sense of loss and fear for traders already in losing positions.
Why This Indicator Works
The psychology of losses makes traders more prone to selling during periods of fear, especially when confronted with a gap down after sustained price declines. This indicator, by combining ConnorsRSI with down gaps, offers a quantitative way to spot these moments of panic. Traders can take advantage of these signals to enter positions when the market is in a state of fear, often when there is potential for a reversion to the mean.
Indicator Mechanics
In the current implementation:
The ConnorsRSI is calculated using three components: a short-term RSI, streak RSI, and percent rank.
When the ConnorsRSI drops below a user-defined lower threshold, the indicator highlights oversold conditions.
If there is a down gap (open price lower than the previous close) and the ConnorsRSI is below the threshold, a label is displayed, signaling a potential opportunity to buy.
Practical Use and Application
For traders looking to implement the Terror Gap Strategy, this indicator provides a clear visual cue (via background coloring and labels) when conditions are ripe for a contrarian trade. It can be particularly useful for traders who thrive on taking advantage of fear-driven sell-offs.
However, to fully understand and apply this strategy effectively, it is recommended to purchase Larry Connors' book "Buy the Fear, Sell the Greed." The book provides detailed explanations of how to execute the strategy with precision, including insights into exit conditions, scaling into positions, and managing risk.
Conclusion
The ConnorsRSI with Down Gap indicator combines quantitative analysis with behavioral finance principles to exploit fear-driven market behavior. By utilizing this tool within a disciplined trading strategy, traders can potentially profit from temporary market inefficiencies caused by panic selling.
References
Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263-291.
Connors, L. (2013). Buy the Fear, Sell the Greed: 7 Behavioral Quant Strategies for Traders.
This indicator can be a valuable asset, but understanding its proper use within a broader strategy framework is essential. Purchasing Connors' book is a recommended step toward mastering the approach.
Options Series - MTF 1 and 3 Minute
Objective:
The indicator is named "Options Series - MTF 1 and 3 Minute", suggesting it's designed to analyze options series with multiple time frames (MTF), particularly focusing on 1-minute and 3-minute intervals.
OHLC Values Of Candle:
The code fetches the Open, High, Low, and Close (OHLC) values of the current candle for the specified ticker and timeframes (current, 1 minute, and 3 minutes). Additionally, it calculates the 200-period Simple Moving Average (SMA) of the closing prices for each timeframe.
Bull vs. Bear Condition:
It defines conditions for Bullish and Bearish scenarios based on comparing the current close price with the previous 200-period SMA close price for both 1-minute and 3-minute timeframes. If the current close price is higher than the previous 200-period SMA close price, it's considered Bullish, and if it's lower, it's considered Bearish.
Final Color Condition and Plot:
It determines the color of the candlestick based on the Bullish or Bearish condition. If the conditions for a Bullish scenario are met, the candlestick color is set to green (GreenColorCandle). If the conditions for a Bearish scenario are met, the candlestick color is set to red (RedColorCandle). If neither condition is met (i.e., the candle is neither Bullish nor Bearish), the color remains gray.
The code then plots the 200-period SMA values for both 1-minute and 3-minute timeframes and colors them based on the candlestick color. It also colors the bars based on the candlestick color.
Insights:
This indicator focuses on comparing current close prices with the 200-period SMA close prices to determine market sentiment (Bullish or Bearish).
It utilizes multiple time frames (1 minute and 3 minutes) to provide a broader perspective on market movements.
The color-coded candlesticks and bars make it visually easy to identify Bullish and Bearish trends.
This indicator can be used as part trading based on the identified market sentiment.
The Vet [TFO]In collaboration with @mickey1984 , "The Vet" was created to showcase various statistical measures of price.
The first core measurement utilizes the Defining Range (DR) concept on a weekly basis. For example, we might track the session from 09:30-10:30 on Mondays to get the DR high, DR low, IDR high, and IDR low. The DR high and low are the highest high and lowest low of the session, respectively, whereas the IDR high and low would be the highest candle body level (open or close) and lowest candle body level, respectively, during this window of time.
From this data, we use the IDR range (from IDR high to IDR low) to extrapolate several, custom projections of this range from its high and low so that we can collect data on how often these levels are hit, from the close of one DR session to the open of the next one.
This information is displayed in the Range Projection Table with a few main columns of information:
- The leftmost column indicates each level that is projected from the IDR range, where (+) indicates a projection above the range high, and (-) indicates a projection below the range low
- The "First Touch" column indicates how often price has reached these levels in the past at any point until the next weekly DR session
- The "Other Side Touch" column indicates how often price has reached a given level, then reversed to hit the opposing level of the same magnitude. For example, the above chart shows that if price hit the +1 projection, ~33% of instances also hit the -1 projection before the next weekly DR session. For this reason, the probabilities will be the same for projection levels of the same but opposite magnitude (+1 would be the same as -1, +3 would be the same as -3, etc.)
- The "Next Level Touch" column provides insight into how often price reaches the next greatest projection level. For example, in the above chart, the red box in the projection table is highlighting that once price hits the -2 projection, ~86% of instances reached the -3 projection before the next weekly DR session
- The last columns, "Within ADR" and "Within AWR" show if any of the projection levels are within the current Average Daily Range, or Average Weekly Range, respectively, which can both be enabled from the Average Range section
The next section, Distributions, primarily measures and displays the average price movements from specified intraday time windows. The option to Show Distribution Boxes will overlay a box showing each respective session's average range, while adjusting itself to encapsulate the price action of that session until the average range is met/exceeded. Users can choose to display the range average by Day of Week, or the Total average from all days. Values for average ranges can either be shown as point or percent values. We can also show a table to display this information about price's average ranges for each given session, and show labels displaying the current range vs its average.
The final section, Average Range, simply offers the ability to plot the Average Daily Range (ADR) and Average Weekly Range (AWR) of a specified length. An ADR of 10 for example would take the average of the last 10 days, from high to low, while an AWR of 10 would take the average of the last 10 weeks (if the current chart provides enough data to support this). Similarly, we can also show the Average Range Table to indicate what these ADR/AWR values are, what our current range is and how it compares to those values, as well as some simple statistics on how often these levels are hit. As an example, "Hit +/- ADR: 40%/35%" in this table would indicate that price has hit the upper ADR limit 40% of the time, and the lower limit 35% of the time, for the amount of data available on the current chart.
Trend Fusion: ADX&EMA+Ichimoku (Custom)SAME AS THE ORIGINAL (WITHOUT BOTTOM PART)
Trend Fusion: ADX & EMA+Ichimoku is an innovative indicator designed to provide traders with comprehensive insights into market trends. Combining the power of the Average Directional Index (ADX) with Exponential Moving Averages (EMA) and the Ichimoku Cloud, this indicator offers a sophisticated approach to trend analysis.
This indicator stands out for its unique integration of multiple trend-following indicators, offering traders a holistic view of market dynamics. Unlike traditional trend indicators that focus solely on price movements, Trend Fusion incorporates the ADX, EMA, and Ichimoku Cloud to provide a more nuanced understanding of trend strength and direction. By combining these indicators, traders can make more informed decisions and enhance their trading strategies.
How it works:
Trend Fusion generates buy and sell signals based on the convergence of these indicators. A combination of strong ADX readings, EMA crossovers, and alignment with the Ichimoku Cloud confirms trend direction and provides entry and exit points for traders.
Average Directional Index (ADX): Measures the strength of the prevailing trend by analyzing price movements. A rising ADX indicates a strengthening trend, while a falling ADX suggests weakening momentum.
Exponential Moving Averages (EMA): Detects potential trend reversals through crossover signals. A bullish crossover (fast EMA crossing above slow EMA) suggests an uptrend, while a bearish crossover indicates a downtrend.
Ichimoku Cloud: Provides support and resistance levels along with trend direction. Price movements above the cloud indicate bullish sentiment, while movements below the cloud suggest bearish sentiment.
How to useColour codes:
Green Candles: Represent a strong uptrend, indicating robust buying momentum. The intensity of green color deepens with increasing trend strength.
Red Candles: Indicate a strong downtrend, signaling significant selling pressure in the market. The intensity of red color deepens with increasing trend strength.
Yellow Candles: Suggest a weak trend, characterized by indecision and lack of clear direction. The intensity of yellow color varies based on the strength of the trend, with lighter shades indicating weaker trends and darker shades suggesting slightly stronger trends.
Trend Strength: Monitor the ADX to gauge the strength of the prevailing trend. Higher ADX values indicate stronger trends, while lower values suggest weaker trends.
Trend Direction: Confirm trend direction using EMA crossovers and Ichimoku Cloud signals. Look for bullish crossovers and price movements above the cloud for uptrends, and bearish crossovers and movements below the cloud for downtrends.
Entry and Exit Signals: Enter trades when all components align, signaling a strong trend. Use EMA crossovers and cloud confirmations to identify potential entry points, and consider exiting trades when these signals reverse.
The ADX calculation and signal logic are based on the ADX script by PineCoders, with modifications to integrate it into this indicator.
The EMA crossover logic is adapted from the GDAX EMA Cross script by stefano98.
The Ichimoku Cloud calculation and plotting are adapted from the Ichimoku Cloud script by lonesometheblue.
Trading involves risk, and past performance is not indicative of future results. It is recommended to use this indicator alongside other technical analysis tools and risk management strategies.
Morning Star Pattern### Purpose and Use of the Output
- **Identifying Bullish Reversal**: The Morning Star pattern is a bullish reversal signal that traders look for at the end of a downtrend. When this pattern appears, it suggests that the market may be shifting from bearish to bullish sentiment.
- **Trading Decisions**: Traders can use this indicator to make informed decisions about entering long positions. The appearance of the Morning Star pattern may prompt traders to buy, anticipating a price increase.
- **Visual Representation**: The plotted shape on the chart provides a visual cue for traders, making it easier to spot potential trading opportunities without having to analyze each candle manually.
### Conclusion
This Pine Script code is a useful tool for traders who want to automate the detection of the Morning Star candlestick pattern on their charts. By visually marking this pattern, traders can quickly identify potential bullish reversal points and make more informed trading decisions.
SMA, 20%UP, 20% SMA, LTH newFeatures:
Simple Moving Averages (SMAs):
200 SMA (Gray): Long-term trend indicator. A widely used benchmark in many trading strategies.
50 SMA (Red): Mid-term trend indicator.
20 SMA (Green): Short-term trend indicator. These three SMAs allow traders to visualize the general market trend over different time horizons.
20% Gain on Green Candles:
This feature tracks continuous green candles and calculates the percentage gain from the lowest low to the highest high in that series.
If the gain is greater than or equal to 20%, the script highlights it with a purple triangle above the candle.
If the series of green candles starts with a candle where the low is below the 200 SMA, a purple diamond appears under the bar, indicating potential strong buying signals.
Lifetime High (LTH):
The script automatically tracks and displays the Lifetime High (LTH), i.e., the highest price ever recorded on the chart.
This level is important for identifying potential resistance areas and monitoring long-term market tops.
Once a new LTH is reached, it is displayed as a green line across the chart.
Support Levels from LTH:
The script calculates 30%, 50%, and 67% down from the LTH, marking key support levels.
These levels are plotted on the chart as orange lines and labeled to assist in spotting potential buy zones or market reversals.
52-Week Low:
It also calculates and displays the 52-week low for quick reference, plotted as a green line.
This helps traders assess major market bottoms and potential areas of support.
Export Candles DataThis program is written in Pine Script (version 5) and is designed to retrieve candlestick data (open, high, low, and close prices) from the TradingView chart. The data is displayed in a table located in the upper right corner of the chart.
Main Functions of the Program:
Retrieving candlestick data: The program processes data for the last 10 candlesticks on the selected timeframe (e.g., hourly, minute, etc.) in the TradingView chart. For each candlestick, it retrieves:
Time of the candle's close
Opening price
Highest price during the period
Lowest price during the period
Closing price
Displaying data in a table: The data is presented in a compact table located in the upper right corner of the chart. The table contains 5 columns:
Time of the candle's close (formatted as yyyy-MM-dd HH:mm)
Opening price
Highest price
Lowest price
Closing price
Clearing the table every 50 bars: To prevent the table from becoming overloaded, it clears itself every 50 bars, starting from the first row and first column.
Data updates dynamically: The table dynamically updates, displaying the latest 10 candles, allowing traders to track current market changes.
Application:
This indicator is useful for traders who want a quick view of key candlestick parameters directly on the chart.
The indicator can be easily applied to any instrument or index in TradingView, such as the IMOEX index.
The table view makes it easy to quickly analyze market movements without needing to inspect each candle individually.
How the Program Works:
On each new bar, the program checks the current bar's index.
The program clears the table if 50 bars have passed since the last clearing.
It writes the data of the last 10 candlesticks into the table: the time of the candle's close, opening price, highest and lowest prices, and closing price.
The table updates automatically and continuously displays the latest data.
This indicator is suitable for both short-term and long-term market analysis, providing a convenient and efficient way to monitor price movements directly on the chart.
ICT Indicator with Paper TradingThe strategy implemented in the provided Pine Script is based on **ICT (Inner Circle Trader)** concepts, particularly focusing on **order blocks** to identify key levels for potential reversals or continuations in the market. Below is a detailed description of the strategy:
### 1. **Order Block Concept**
- **Order blocks** are price levels where large institutional orders accumulate, often leading to a reversal or continuation of price movement.
- In this strategy, **order blocks** are identified when:
- The high of the current bar crosses above the high of the previous bar (for bullish order blocks).
- The low of the current bar crosses below the low of the previous bar (for bearish order blocks).
### 2. **Buy and Sell Signal Generation**
The core of the strategy revolves around identifying the **breakout** of order blocks, which is interpreted as a signal to either enter or exit trades:
- **Buy Signal**:
- Generated when the closing price crosses **above** the last identified bullish order block (i.e., the highest point during the last upward crossover of highs).
- This signals a potential upward trend, and the strategy enters a long position.
- **Sell Signal**:
- Generated when the closing price crosses **below** the last identified bearish order block (i.e., the lowest point during the last downward crossover of lows).
- This signals a potential downward trend, and the strategy exits any open long positions.
### 3. **Strategy Execution**
The strategy is executed using the `strategy.entry()` and `strategy.close()` functions:
- **Enter Long Positions**: When a buy signal is generated, the strategy opens a long position (buying).
- **Exit Positions**: When a sell signal is generated, the strategy closes the long position.
### 4. **Visual Indicators on the Chart**
To make the strategy easier to follow visually, buy and sell signals are marked directly on the chart:
- **Buy signals** are indicated with a green upward-facing triangle above the bar where the signal occurred.
- **Sell signals** are indicated with a red downward-facing triangle below the bar where the signal occurred.
### 5. **Key Elements of the Strategy**
- **Trend Continuation and Reversals**: This strategy is attempting to capture trends based on the breakout of important price levels (order blocks). When the price breaks above or below a significant order block, it is expected that the market will continue in that direction.
- **Order Block Strength**: Order blocks are considered strong areas where price action could reverse or accelerate, based on how institutional investors place large orders.
### 6. **Paper Trading**
This script uses **paper trading** to simulate trades without actual money being involved. This allows users to backtest the strategy, seeing how it would have performed in historical market conditions.
### 7. **Basic Strategy Flow**
1. **Order Block Identification**: The script constantly monitors price movements to detect bullish and bearish order blocks.
2. **Buy Signal**: If the closing price crosses above the last order block high, the strategy interprets it as a sign of bullish momentum and enters a long position.
3. **Sell Signal**: If the closing price crosses below the last order block low, it signals a bearish momentum, and the strategy closes the long position.
4. **Visual Representation**: Buy and sell signals are displayed on the chart for easy identification.
### **Advantages of the Strategy:**
- **Simple and Clear Rules**: The strategy is based on clearly defined rules for identifying order blocks and trade signals.
- **Effective for Trend Following**: By focusing on breakouts of order blocks, this strategy attempts to capture strong trends in the market.
- **Visual Aids**: The plot of buy/sell signals helps traders to quickly see where trades would have been placed.
### **Limitations:**
- **No Shorting**: This strategy only enters long positions (buying). It does not account for shorting opportunities.
- **No Risk Management**: There are no built-in stop losses, trailing stops, or profit targets, which could expose the strategy to large losses during adverse market conditions.
- **Whipsaws in Range Markets**: The strategy could produce false signals in sideways or choppy markets, where breakouts are short-lived and prices quickly reverse.
### **Overall Strategy Objective:**
The goal of the strategy is to enter into long positions when the price breaks above a significant order block, and exit when it breaks below. The strategy is designed for trend-following, with the assumption that price will continue in the direction of the breakout.
Let me know if you'd like to enhance or modify this strategy further!
Support Resistance DynamicsThe Support Resistance Dynamics indicator is an advanced technical analysis tool designed to identify and visualize key support and resistance levels in real-time. This innovative indicator stands out from traditional support and resistance tools by employing a dynamic approach that adapts to market conditions.
Key Features:
Dynamic Level Calculation: Unlike static support and resistance indicators, this tool continuously updates levels based on recent price action, providing traders with the most relevant and up-to-date information.
Logarithmic Scale Option: The indicator offers a unique logarithmic scale feature, essential for analyzing long-term trends or assets with significant price changes. This allows for more accurate level plotting across various timeframes and price ranges.
Customizable Display: Users can adjust the number of support and resistance lines displayed, allowing for a clean and uncluttered chart view while focusing on the most significant levels.
Adaptive Slope Calculation: The indicator uses an innovative approach to calculate the slope of support and resistance lines, offering options from dynamic adaptation to fixed long-term periods. This ensures the lines remain relevant in both trending and ranging markets.
Enhanced Visualization: With customizable line colors, styles, and transparency, traders can easily distinguish between support and resistance levels, improving chart readability and analysis.
Flexible Period Settings: From dynamic calculations based on recent pivots to fixed long-term periods, the indicator adapts to various trading styles and timeframes.
The Support Resistance Dynamics indicator is particularly useful for:
Identifying potential reversal points in trends
Setting more accurate entry and exit points for trades
Placing stop-loss orders with greater precision
Recognizing breakout levels for potential new trends
By combining dynamic calculation methods with customizable visual elements, this indicator provides traders with a powerful tool for market analysis. Whether you're a day trader looking for short-term opportunities or a long-term investor analyzing macro trends, the Support Resistance Dynamics indicator offers valuable insights to enhance your trading strategy.
This indicator is provided for informational and educational purposes only. It should not be considered as financial advice or a recommendation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading involves significant risk of loss. Users should conduct their own research and due diligence before making any investment decisions. The creator of this indicator is not responsible for any losses incurred from its use. Always test thoroughly on demo accounts before applying to live trading.
Gaps Trend [ChartPrime]The Gaps Trend - ChartPrime indicator is designed to detect Fair Value Gaps (FVGs) in the market and apply a trailing stop mechanism based on those gaps. It identifies both bullish and bearish gaps and provides traders with a way to manage trades dynamically as gaps appear. The indicator visually highlights gaps and uses the detected momentum to assess trend direction, helping traders identify price imbalances caused by strong buy or sell pressure.
⯁ KEY FEATURES & HOW TO USE
⯌ Fair Value Gap (FVG) Detection :
The indicator automatically detects both bullish and bearish FVGs, identifying gaps between candle highs and lows. Bullish gaps are shown in green, and bearish gaps in purple. These gaps indicate price imbalances driven by strong momentum, such as when there is significant buying or selling pressure.
Use : Traders can use FVG detection to identify periods of high price momentum, offering insight into potential continuation or exhaustion of trends.
⯌ Trailing Stop Feature Based on FVGs :
A core feature of this indicator is the trailing stop mechanism, which adjusts dynamically based on the identified FVGs. When a bullish gap is detected, the trailing stop is placed below the price to capture upward momentum, while bearish gaps result in a trailing stop placed above the price. This feature helps traders stay in trends while protecting profits as the price moves.
Use : The trailing stop follows the momentum of the price, ensuring that traders can stay in profitable trades during strong trends and exit when the momentum shifts.
bullish set up
bearish set up
⯌ Trend Direction Indication :
The indicator colors the chart according to the current trend direction based on the position of the price relative to the trailing stop. Green indicates an uptrend (bullish gap), while purple shows a downtrend (bearish gap). This provides traders with a quick visual assessment of trend direction based on the presence of gaps.
Use : Traders can monitor the chart's color to stay aligned with the market’s trend, staying long during green phases and short during purple ones.
⯌ Gap Size Filtering :
Each detected gap is assigned a numerical ranking based on its size, with larger gaps having higher rankings. The gap size filter allows traders to only display gaps that meet a minimum size threshold, focusing on the most impactful gaps in terms of price movement.
Use : Traders can use the filter to focus on gaps of a certain size, filtering out smaller, less significant gaps. The numerical ranking helps identify the largest and most influential gaps for decision-making.
⯌ FVG Level Visualization :
The indicator can display dashed lines marking the levels of previously filled FVGs. These levels represent areas where price once experienced a gap and later filled it. Monitoring these levels can provide traders with key reference points for potential reactions in price.
Use : Traders can use these gap levels to track where price has filled gaps and potentially use these levels as zones for entry, exit, or assessing market behavior.
⯁ USER INPUTS
Filter Gaps : Adjust the size threshold to filter gaps by their size ranking.
Show Gap Levels : Toggle the display of dashed lines at filled FVG levels.
Enable Trailing Stop : Activate or deactivate the trailing stop feature based on FVGs.
Trailing Stop Length : Set the number of bars used to calculate the trailing stop.
Bullish/Bearish Colors : Customize the colors representing bullish and bearish gaps.
⯁ CONCLUSION
The Gaps Trend indicator combines Fair Value Gap detection with a dynamic trailing stop feature to help traders manage trades during periods of high price momentum. By detecting gaps caused by strong buy or sell pressure and applying adaptive stops, the indicator provides a powerful tool for riding trends and managing risk. The additional ability to filter gaps by size and visualize previously filled gaps enhances its utility for both trend-following and risk management strategies.
Adjusted Average VolatilityThis Pine Script calculates the average volatility over the past 20 bars by taking the difference between the high and low prices. It then adjusts this volatility based on the previous closing price: if the price is below $20, the volatility is multiplied by 2, and if it’s above $20, the volatility is multiplied by 1.5. The adjusted volatility is then plotted on the chart, helping traders visualize how volatility changes relative to the asset's price level.
Daily Moving Average for Intraday TimeframesThis indicator provides a dynamic tool for visualizing the Daily Moving Average (DMA) on intraday timeframes.
It allows you to analyze how the price behaves in relation to the daily moving average in timeframes from 1 minute up to 1 day.
KEY FEATURES
DMA on Intraday timeframes only : This indicator is designed to work exclusively on intraday charts with timeframes between 1 minute and 1 day. It will not function on tick, second-based, or daily-and-above charts.
Color-Coded Zones for Trend Identification :
Green Zone: The price is above a rising DMA, signaling a bullish momentum.
Red Zone: The price is below a falling DMA, signaling a bearish momentum.
Yellow Zone: Signaling uncertainty or mixed conditions, where either the price is above a falling DMA or below a rising/flat DMA.
Configurable DMA Period : You can adjust the number of days over which the DMA is calculated (default is 5 days). This can be customized based on your trading strategy or market preferences.
24/7 Market Option : For assets that trade continuously (e.g., cryptocurrencies), activate the "Is trading 24/7?" setting to ensure accurate calculations.
WHAT IS THE DMA AND WHY USE IT INTRADAY?
The Daily Moving Average is a Simple Moving Average indicator used to smooth out price fluctuations over a specified period (in days) and reveal the underlying trend.
Typically, a SMA takes price value for the current timeframe and reveal the trend for this timeframe. It gives you the average price for the last N candles for the given timeframe.
But what makes the Intraday DMA interesting is that it shows the underlying trend of the Daily timeframe on a chart set on a shorter timeframe . This helps to align intraday trades with broader market movements.
HOW IS THE DMA CALCULATED?
If we are to build a N-day Daily Moving Average using a Simple Moving Average, we need to take the amount of candles A needed in that timeframe to account for a period of a day and multiply it by the number of days N of the desired DMA.
So for instance, let say we want to compute the 5-Day DMA on the 10 minute timeframe :
In the 10 minute timeframe there are 39 candles in a day in the regular session.
We would take the 39 candles per day and then multiply that by 5 days. 39 x 5 = 195.
So a 5-day moving average is represented by a simple moving average with a period of 195 when looking at a 10 minute timeframe.
So for each period, to create a 5-day DMA, you would have to set the period of your simple moving average like so :
- 195 minutes = 10 period
- 130 minutes = 15 period
- 65 minutes = 30 period
- 30 minutes = 65 period
- 15 minutes = 130 period
- 10 minutes = 195 period
- 5 minutes = 390 period
and so on.
This indicator attempts to do this calculation for you on any intraday timeframe and whatever the period you want to use is for your DMA. You can create a 10-day moving average, a 30-day moving average, etc.
Half Trend HeikinAshi [BigBeluga]This indicator is a cool combo of the half-trend methodology and Heikin Ashi candles. The main idea is to help spot where the market is trending and where it might be reversing by using a mix of moving averages and the highest and lowest price data values. What’s nice is that it doesn’t just give you trend lines but also converts them into Heikin Ashi candles, so you can visually gauge the strength of a trend based on candle sizes.
NIFTY50:
NVIDIA:
🔵 IDEA
The thinking behind this Half Trend HeikinAshi indicator is pretty straightforward: it’s designed to give you a flexible way to detect trends and trend reversals, but with an added bonus—measuring trend strength via Heikin Ashi candles. The core idea is based on the classic half-trend strategy, where it adjusts to the highest and lowest price values within a certain period. The Heikin Ashi transformation smooths out half-trend line, making it easier to spot solid trends and potential reversals.
🔵 KEY FEATURES & USAGE
◉ Half Trend Calculation with Reversal Signals:
The main feature here is spotting trends based on a moving average of the close price and the highest/lowest price data.
//#region ———————————————————— Calculations
// Calculate moving average of close prices
series float closeMA = ta.sma(close, amplitude)
// Calculate highest high and lowest low
series float highestHigh = ta.highest(amplitude)
series float lowestLow = ta.lowest(amplitude)
// Initialize hl_t on the first bar
if barstate.isfirst
hl_t := close
// Update hl_t based on conditions
switch
closeMA < hl_t and highestHigh < hl_t => hl_t := highestHigh
closeMA > hl_t and lowestLow > hl_t => hl_t := lowestLow
=> hl_t := hl_t
When the trend flips, you’ll see arrows on your chart—either pointing up or down—marking the exact price where that reversal occurred. This makes it easy to see where the market might turn, which is helpful for timing entries and exits.
◉ Heikin Ashi Candlestick Transformation:
There’s a Heikin Ashi mode that transforms the half-trend line into Heikin Ashi candles.
These smooth out market noise and make the overall trend much clearer.
◉ Trend Strength Calculation:
The indicator doesn’t just stop at showing trends. It also calculates trend strength based on the size of the Heikin Ashi candles. Bigger candles mean stronger trends, and smaller ones indicate weaker momentum. You can see this displayed on the dashboard, so you know exactly how strong the current trend is at any moment.
◉ Graphical Dashboard Display:
You’ve got a small dashboard right on the chart that shows key info like the ticker, timeframe, and whether the trend is up or down. If you’re in Heikin Ashi mode, it shows trend strength instead. So, no need to dig through the data—you can just glance at the dashboard for a quick market read.
🔵 CUSTOMIZATION
Amplitude Input: You can tweak the amplitude to control how sensitive the half-trend line is. A lower setting makes it more reactive to small price moves, while a higher setting smooths it out for longer-term trends.
Heikin Ashi Toggle: You can easily switch between standard half-trend lines and Heikin Ashi candle mode, depending on how you prefer to see the market.
Trend Colors: You’ve got control over the colors for up and down trends, so you can adjust the appearance to fit your charting style.
Signal Labels size: Change Labels signal sizes for your preference
🔵 CONCLUSION
The Half Trend HeikinAshi indicator is a solid tool for tracking trends and measuring their strength. By combining the usual half-trend signals with Heikin Ashi candles, you get a clearer picture of what’s happening in the market. Whether you're looking to spot potential reversals or just want to measure the strength of a current trend, this indicator gives you plenty of flexibility to do both.
Amplitude [Anan]The Amplitude indicator calculates and visualizes both the amplitude and cumulative amplitude of price movements, providing traders with insights into price volatility and trend strength. By distinguishing between positive and negative amplitude movements, this indicator aids in identifying bullish and bearish sentiments, potential reversal points, and confirming trend directions.
█ Main Formulas
‣ Amplitude = High - Low
‣ Cumulative Amplitude = sum of Amplitude over the specified lookback period
‣ Percentage Amplitude = (Amplitude / Open) × 100%
High: Candle high (or highest high when lookback > 1)
Low: Candle low (or lowest low when lookback > 1)
Open: Open price of the first candle in the lookback period
█ Key Features
✦Dual Amplitude Calculations:
Amplitude: Reflects price range and direction over a short-term period.
Cumulative Amplitude: Aggregates amplitude over a longer period for broader trend analysis.
✦Customizable Parameters: Adjust lookback periods, smoothing options, moving averages and Alerts.
✦Direction Separation: Distinguish between positive and negative amplitude movements to identify market sentiment.
✦Flexible Visualization: Customizable colors and plot styles for enhanced chart readability.
✦Alert System: Generate signals based on amplitude direction and moving average crossovers
█ How to Use and Interpret
✦Understanding Amplitude and Cumulative Amplitude:
‣Amplitude: Measures the price range (high - low) over a specified short-term period.
‣Cumulative Amplitude: Aggregates amplitude over a defined longer-term period.
‣Percentage Representation: shows amplitude relative to the open price from `amp_length` bars ago, providing a normalized view.
‣Interpretation:
Large Amplitude Values: Indicate high volatility.
Small Amplitude Values: Indicate low volatility.
✦Trend Identification:
‣Uptrend: Consistently positive amplitudes and upward-moving averages.
‣Downtrend: Consistently negative amplitudes and downward-moving averages.
✦Overbought/Oversold Conditions:
‣High Positive Amplitude: May indicate overbought conditions and potential reversals.
‣High Negative Amplitude: May indicate oversold conditions and potential reversals.
✦Volatility Analysis:
‣High Amplitude Values: Suggest increased market volatility.
‣Low Amplitude Values: Suggest reduced market volatility.
✦Signal Confirmation:
‣Moving Average Crossovers: Confirm the strength and direction of trends, aiding in informed trading decisions.
✦Trading Strategies:
‣ Breakout Trading: Large increases in amplitude can signal potential breakouts.
‣ Mean Reversion: Extreme amplitude values may indicate upcoming price corrections.
‣ Volatility-Based Strategies: Adjust position sizes or trading frequency based on amplitude magnitudes.
‣ Multi-Timeframe Analysis: Compare amplitudes across different timeframes for a comprehensive market view.
█ Customization Tips
‣ Lookback Periods: Experiment with different periods to suit your trading style and asset characteristics.
‣ Smoothing Settings: Adjust to balance responsiveness and noise reduction.
‣ Percentage Amplitude: Use for normalized comparisons across different price levels.
Auto Signal Buy/SellAuto Signal Buy/Sell with Time Filter and Dynamic ZLEMA (GMT+2) 🌟
Are you looking for an indicator that combines efficiency and simplicity while integrating advanced elements like SuperTrend, ZLEMA (Zero Lag EMA), and a MACD DEMA for clear and precise buy/sell signals? 📈 Introducing Auto Signal Buy/Sell, the ultimate indicator designed for intraday and swing traders, optimized for market hours in GMT+2.
🛠️ Key Features:
- **Advanced SuperTrend**: Follow the dominant trend with a robust SuperTrend, adjustable to your preferences (customizable multiplier and period).
- **Dynamic ZLEMA**: Get a zero-lag EMA curve with a visual signal. Additionally, the ZLEMA turns blue when it’s nearly flat, helping you easily spot market consolidation phases.
- **MACD DEMA**: An enhanced version of the traditional MACD, using the Double EMA to capture more responsive buy/sell cross signals. 📊
- **Buy/Sell Signals**: Visual arrows clearly indicate potential entry and exit points on your chart, filtered by MACD crossovers and the SuperTrend trend.
- **Smart Time Filter (GMT+2)**: This script adapts to trading hours (customizable) and only displays signals during trading hours. The background turns light blue when the market is closed, preventing confusion during inactivity periods. 🕒
⚙️ Full Customization:
- Adjustable trading hours (default 9 AM to 5 PM in GMT+2) with dynamic background indicating when markets are closed.
- Flexible settings for SuperTrend, ZLEMA, and MACD DEMA to suit any strategy.
🎯 Why Choose This Indicator?
- Optimized for maximum precision with advanced algorithms like ZLEMA and DEMA.
- Easy to use: it provides clear, visual signals directly on the chart—no need to decipher complex indicators.
- A complete intraday and swing indicator that combines trend analysis and signal filtering with precise market hours.
🚀 Boost Your Trading!
Add this indicator to your toolkit and enhance your decision-making. Thanks to its intuitive interface and clear visual signals, you can trade with confidence. 💡
Don't forget to like 👍 and comment if you find this indicator useful! Your feedback helps us continue improving such tools. 🚀
📌 How to Use:
1. Add the indicator to your chart.
2. Adjust the SuperTrend and ZLEMA settings to suit your needs.
3. Follow the buy/sell signals and watch for the light blue background outside of trading hours.
4. Trade effectively and stay in control, even during consolidation phases.
Geometric Mean IndicatorThis script calculates and plots the Geometric Mean (GM) of two significant price levels (in this case, moving averages) to identify balance points or equilibrium levels in the market.
Key Components of the Script:
Input Variables:
length1: Defines the period for the first moving average (representing the first radius 𝑥x).
length2: Defines the period for the second moving average (representing the second radius
𝑦y).
Moving Averages (Price Levels):
ma1: The first moving average (calculated using the closing price over the period defined by length1).
ma2: The second moving average (calculated using the closing price over the period defined by length2).
Geometric Mean (GM) Calculation:
The geometric mean between the two moving averages is calculated as:
GM = sqrt(ma1 * ma2)
This value represents the midpoint or balance between the two price levels (analogous to the geometric mean between the radii in the mathematical discovery).
Plotting the Values:
The script plots:
ma1: First moving average (blue line).
ma2: Second moving average (red line).
geometric_mean: The geometric mean of the two moving averages (green line), which serves as the dynamic equilibrium point.
Visual Markers for Crossovers:
The script detects when the price crosses above or below the geometric mean:
Green markers (below the bar) indicate a crossover above the geometric mean.
Red markers (above the bar) indicate a crossover below the geometric mean.
Purpose of the Indicator:
The Geometric Mean Indicator is designed to:
Highlight equilibrium points: The geometric mean between two price levels can signal areas where the market is balanced or poised for a potential breakout.
Detect potential trend reversals: When the price crosses above or below the geometric mean, it can indicate shifts in market momentum, similar to how the GM in geometry represents a transition point.
How to Use:
Dynamic Equilibrium: The geometric mean (green line) represents a balance between two price levels (moving averages) and can act as support or resistance.
Price Crossovers: Watch for price crossing the geometric mean to identify potential trend changes or areas of significant price action.
Adjust Inputs: You can modify the lengths of the moving averages (length1 and length2) to adjust the sensitivity of the indicator based on different timeframes or strategies.
Summary in Context of the Geometric Proof:
The script applies the geometric concept of the Geometric Mean (GM) as a balance point between two radii (represented by moving averages in this case).
It mirrors the idea that the GM is the midpoint of the tangent slope between two circles, where the moving averages (or price levels) serve as the "radii" in the market context.
ICT MACROS (UTC-4)This Pine Script creates an indicator that draws vertical lines on a TradingView chart to mark specific time intervals during the day. It allows the user to see when certain predefined time periods start and end, using vertical lines of different colors. The script is designed to work with time frames aligned to the UTC-4 timezone.
### Key Features of the Script
1. **Vertical Line Drawing Function**:
- The script uses a custom function, `draw_vertical_line`, to draw vertical lines at specific times.
- This function takes four parameters:
- `specificTime`: The specific timestamp when the vertical line should be drawn.
- `lineColor`: The color of the vertical line.
- `labelText`: The text label for the line (used internally for debugging purposes).
- `adjustment_minutes`: An integer value that allows time adjustment (in minutes) to make the lines align more accurately with the chart’s candles.
- The function calculates an adjusted time using the `adjustment_minutes` parameter and checks if the current time (`time`) falls within a 3-minute range of the adjusted time. If it does, it draws a vertical line.
2. **User Input for Time Adjustment**:
- The `adjustment_minutes` input allows users to fine-tune the appearance of the lines by shifting them slightly forward or backward in time to ensure they align with the chart candles. This is useful because of potential minor discrepancies between the script’s timestamps and the chart’s actual candle times.
3. **Predefined Time Intervals**:
- The script specifies six different time intervals (using the UTC-4 timezone) and draws vertical lines to mark the start and end of each interval:
- **First interval**: 8:50 - 9:10 AM
- **Second interval**: 9:50 - 10:10 AM
- **Third interval**: 10:50 - 11:10 AM
- **Fourth interval**: 13:10 - 13:40 PM
- **Fifth interval**: 14:50 - 15:10 PM
- **Sixth interval**: 15:15 - 15:45 PM
- For each interval, there are two timestamps: the start time and the end time. The script draws a green vertical line for the start and a red vertical line for the end.
4. **Line Drawing Logic**:
- For each time interval, the script calculates the timestamp using the `timestamp()` function with the specified time in UTC-4.
- The `draw_vertical_line` function is called twice for each interval: once for the start time (with a green line) and once for the end time (with a red line).
5. **Visual Overlay**:
- The script uses the `overlay=true` setting, which means that the vertical lines are drawn directly on top of the existing price chart. This helps in visually identifying the specific time intervals without cluttering the chart.
### Summary
This Pine Script is designed for traders or analysts who want to visualize specific time intervals directly on their TradingView charts. It provides a customizable way to highlight these intervals using vertical lines, making it easier to analyze price action or trading volume during key times of the day. The `adjustment_minutes` input adds flexibility to align these lines accurately with chart data.
Median Kijun-Sen [InvestorUnknown]The Median Kijun-Sen is a versatile technical indicator designed for both trend-following strategies and long-term market valuation. It incorporates various display modes and includes a backtest mode to simulate its performance on historical price action.
Key Features:
1. Trend-Following and Long-Term Valuation:
The indicator is ideal for trend-following strategies, helping traders identify entry and exit points based on the relationship between price and the Kijun-Sen calculated from median price (customizable price source).
With longer-term settings, it can also serve as a valuation tool (in oscillator display mode), assisting in identifying potential overbought or oversold conditions over extended timeframes.
2. Display Modes:
The indicator can be displayed in three main modes, each serving a different purpose:
Overlay Mode : Plots the Median Kijun-Sen directly over the price chart, useful for visualizing trends relative to price action.
Oscillator Mode : Displays the oscillator that compares the current price to the Median Kijun-Sen, providing a clearer signal of trend strength and direction
Backtest Mode : Simulates the performance of the indicator with different settings on historical data, offering traders a way to evaluate its reliability and effectiveness without needing TradingView's built-in strategy tool
3. Backtest Functionality:
The inbuilt backtest mode enables users to evaluate the indicator's performance across historical data by simulating long and short trades. Users can customize the start and end dates for the backtest, as well as specify whether to allow long & short, long only, or short only signals.
This backtest functionality mimics TradingView's strategy feature, allowing users to test the effectiveness of their chosen settings before applying them to live markets.
equity(series int sig, series float r, startDate, string signals, bool endDate_bool) =>
if time >= startDate and endDate_bool
float a = 0
if signals == "Long & Short"
if sig > 0
a := r
else
a := -r
else if signals == "Long Only"
if sig > 0
a := r
else if signals == "Short Only"
if sig < 0
a := -r
else
runtime.error("No Signal Type found")
var float e = na
if na(e )
e := 1
else
e := e * (1 + a)
float r = 0.0
bool endDate_bool = use_endDate ? (time <= endDate ? true : false) : true
float eq = 1.0
if disp_mode == "Backtest Mode"
r := (close - close ) / close
eq := equity(sig, r, startDate, signals, endDate_bool)
4. Hint Table for Pane Suggestions:
An inbuilt hint table guides users on how to best visualize the indicator in different display modes:
For Overlay Mode, it is recommended to use the same pane as the price action.
For Oscillator and Backtest Modes, it is advised to plot them in a separate pane for better clarity.
This table also provides step-by-step instructions on how to move the indicator to a different pane and adjust scaling, making it user-friendly.
Potential Weakness
One of the key drawbacks is the indicator’s tendency to produce false signals during price consolidations, where price action lacks clear direction and may trigger unnecessary trades. This is particularly noticeable in markets with low volatility.
Alerts
The indicator includes alert conditions for when it crosses above or below key levels, enabling traders to receive notifications of LONG or SHORT signals.
Summary
The Median Kijun-Sen is a highly adaptable tool that serves multiple purposes, from trend-following to long-term valuation. With its customizable settings, backtest functionality, and built-in hints, it provides traders with valuable insights into market trends while allowing them to optimize the indicator to their specific strategy.
This versatility, however, comes with the potential weakness of false signals during consolidation phases, so it's most effective in trending markets.