QTY@RISK VWAP based calculationVWAP Volatility-Based Risk Management Calculator for Intraday Trading
Overview
This script is an innovative tool designed to help traders manage risk effectively by calculating position sizes and stop-loss levels using the Volume Weighted Average Price (VWAP) and its standard deviation (StdDev). Unlike traditional methods that rely on time-based calculations, this approach is time-independent within the intraday timeframe, making it particularly useful for traders seeking precision and efficiency.
Key Concepts
VWAP (Volume Weighted Average Price): VWAP is a trading benchmark that represents the average price a security has traded at throughout the day, based on both volume and price. It provides insight into the average price level over a specific period, helping traders understand the market trend.
StdDev (Standard Deviation): In the context of VWAP, the standard deviation measures the volatility around the VWAP. It provides a quantifiable range that traders can use to set stop-loss levels, ensuring they are neither too tight nor too loose.
How the Script Works
1. VWAP Calculation: The script calculates the VWAP continuously as the market trades, integrating both price and volume data.
2. Volatility Measurement: It then computes the standard deviation of the VWAP, giving a measure of market volatility.
3. Stop-Loss Calculation: Using user-defined StdDev factors, the script calculates two stop-loss levels. These levels adjust dynamically based on market conditions, ensuring they remain relevant throughout the trading session.
4. Position Sizing: By incorporating your risk tolerance, the script determines the appropriate position size. This ensures that your maximum loss per trade does not exceed your predefined risk value.
How to Use the Calculator
1. Select Two VWAP StdDev Factors: Choose two standard deviation factors for calculating stop-loss levels. For example, you might choose 0.5 and 0.75 to set conservative and aggressive stop-losses respectively.
2. Set Your Trading Account Size: Enter your total trading capital. For example, $50,000.
3. Maximum Lot Size: Define the maximum number of shares you are willing to trade in a single position. For instance, 200 shares.
4. Risk Value per Trade: Input the maximum amount of money you are willing to risk on a single trade. For instance, $50.
5. Plotting Options: If you wish to visualize the stop-loss levels, enable the plot option and choose the price base for the plot, such as the closing price or the average of the high and low prices (hl2).
Example of Use
1. Initial Setup: After the market opens, wait for at least 15 minutes to ensure the VWAP has stabilized with sufficient volume data.
2. Parameter Configuration: Input your desired parameters into the calculator. For instance:
- VWAP StdDev Factors: 0.5 and 0.75
- Trading Account Size: $50,000
- Maximum Lot Size: 200 shares
- Risk Value per Trade: $50
- Plot Option: On, using "hl2" or "close" as the price base
3. Execution: Based on the inputs, the script calculates the position size and stop-loss levels. If the calculated stop-loss falls within the selected VWAP StdDev range, it will provide you with precise stop-loss prices.
4. Trading: Use the calculated position size and stop-loss levels to execute your trades confidently, knowing that your risk is managed effectively.
Advantages for Traders
- Time Independence: By relying on VWAP and its StdDev, the calculations are not dependent on specific time intervals, making them more adaptable to real-time trading conditions.
- Focus on Strategy: Novice traders can focus more on their trading strategies rather than getting bogged down with complex calculations.
- Dynamic Adjustments: The script adjusts stop-loss levels dynamically based on evolving market conditions, providing more accurate and relevant risk management.
- Flexibility: Traders can tailor the calculator to their risk preferences and trading style by adjusting the StdDev factors and risk parameters.
By incorporating these concepts and using this risk management calculator, traders can enhance their trading efficiency, improve their risk management, and ultimately make more informed trading decisions.
Chart patterns
Prometheus Polarized Fractal Efficiency (PFE)This indicator uses market data to calculate Polarized Fractal Efficiency (PFE) on an asset, so traders can have a better idea of which direction it may go.
Users can control the lookback length for the fractal calculation, the lookback length for the Exponential Moving Average (EMA), and whether or not to display lines at the -50 and 50 level, or -25 and 25 level.
Polarized Fractal Efficiency:
The Polarized Fractal Efficiency (PFE) indicator is a value between -100 and 100 with 0 as a midpoint.
A PFE above 0 indicates the asset may trend higher, a PFE below 0 indicates the asset may trend lower.
There are many ways to trade with PFE, the intuitive trend riding as described above, or reversals.
Even when the PFE is above 0, if it gets high enough, it may also be an indication of a reversal. A PFE of 90 - 100, or -100 - -90, may indicate price is ready to revert the other direction. Furthermore, traders already in a position may look to breaks of other levels to be their take profit or stop out spot.
Calculation:
Pi = 100 x (Price - Price )2 + N2 / Summation, j= 0, to N-2 (Price - Price )2 + 1
If Close < Close Pi = -Pi
PFEi = EMA(Pi, M)
Where:
N = period of indicator
M = smoothing period
Citation: www.investopedia.com
Scenarios:
Inputs are (9, 5) and every display option is on.
Trend example
Step 1: A short trade appears as PFE crosses below -25. We reach a safe take profit as PFE crosses below -50. Traders can use these levels to exit as well as enter.
Step 2: On the cross above 25 there is a safe long. As the PFE value breaks 0 a safe, early take profit could be appropriate for this trade. No guarantee we would see 50.
Step 3: Long scenario at break of 25, straight to 50. Simple, straightforward setup.
Step 4: This long results in a stop loss. Once again entry as PFE crosses 25, but as we cross the 0 line it is for a loss.
Step 5: The last trade in this example is reminiscent of step 3. This is a short trade entry at break of 25 and exit at break of 50.
Traders have liberty to use the PFE value to determine spots to enter and exit trades, long or short. 25 and 50 were chosen arbitrarily, values like 10 and 60 may work as well, we encourage traders to use their own discretion along with tools.
Reversal example
Step 1: PFE is around -100, crossing below it at one point! Strong zone for a potential reversal.
Step 2: PFE crosses above 25 adding conviction.
Step 3: Option to exit at 70.
Step 4: Option to exit at 90.
There is no “one size fits all method”, this approach may be more intuitive for some users and is just as feasible as the first.
Longer trend example
Step 1: Using -50 and 50 this time instead of -25 and 25 to be safer on our entries we see a short here. Was a good entry and as the value gets closer to -70 we can safely close.
Step 2: On this candle we see a long for the break of 50. On the next candle we break the 0 line, but because of our safe entry at 50, we could hold this and only stop out at a break of -25. We get close but stay in it and close at 70.
Step 3: Break of 50 for a long once again. This time the break of 0 line occurs as we are in profit, not letting a green trade go red is a golden rule of trading, so an early exit here.
Step 4: Same at step 2, break of 50 to long and stay in it, not stopping out at break of 0 line. The PFE value eventually reaches 70 and there is a good exit.
Quicker Reversal example
Step 1: Notice a close with PFE below -90, enter long for the reversal. Then close for profit when the PFE crosses above 70.
Step 2: When the PFE breaks above 90 we have a short entry. Like the long closing it when it crosses below -70.
Step 3: This step is the same setup as step 2. As PFE breaks above 90 we have a short entry. Closing it when it crosses below -70.
Recap:
Described above are 4 different examples with many different trades. Both trend and reversal trades. The PFE value is an indicator that can be used by traders in many different ways and Prometheus encourages traders to use their own discretion along with tools and not follow indicators blindly.
Options:
Users can control the input for the lookback of the indicator. The default is 9.
The smoothing factor for the EMA is also changeable, default is 5.
Users have options to display lines at -50, -25, 25, and 50.
Support and Resistance Breakouts By RICHIESupport and resistance are fundamental concepts in technical analysis used to identify price levels on charts that act as barriers, preventing the price of an asset from getting pushed in a certain direction. Here’s a detailed description of each and how breakout strategies are typically used:
Support
Support is a price level where a downtrend can be expected to pause due to a concentration of demand. As the price of an asset drops, it hits a level where buyers tend to step in, causing the price to rebound.
Support Level Identification: Support levels are identified by looking at historical data where prices have repeatedly fallen to a certain level but have then rebounded.
Strength of Support: The more times an asset price hits a support level without breaking below it, the stronger that support level is considered to be.
Resistance
Resistance is a price level where an uptrend can be expected to pause due to a concentration of selling interest. As the price of an asset increases, it hits a level where sellers tend to step in, causing the price to drop.
Resistance Level Identification: Resistance levels are identified by looking at historical data where prices have repeatedly risen to a certain level but have then fallen back.
Strength of Resistance: The more times an asset price hits a resistance level without breaking above it, the stronger that resistance level is considered to be.
Breakouts
A breakout occurs when the price moves above a resistance level or below a support level with increased volume. Breakouts can be significant because they suggest a change in supply and demand dynamics, often leading to strong price movements.
Breakout Above Resistance: Indicates a bullish market sentiment. Traders often interpret this as a sign to enter a long position (buy).
Breakout Below Support: Indicates a bearish market sentiment. Traders often interpret this as a sign to enter a short position (sell).
Breakout Trading Strategies
Confirmation: Wait for a candle to close beyond the support or resistance level to confirm the breakout.
Volume: Increased volume on a breakout adds credibility, suggesting that the price move is supported by strong buying or selling interest.
Retest: Sometimes, after a breakout, the price will return to the breakout level to test it as a new support or resistance. This retest offers another entry point.
Stop-Loss: Place stop-loss orders just below the resistance (for long positions) or above the support (for short positions) to limit potential losses in case of a false breakout.
Take-Profit: Identify target levels for taking profits. These can be set based on previous support/resistance levels or using tools like Fibonacci retracements.
TASC 2024.07 Gaps and Extreme Closes█ OVERVIEW
This script, inspired by Perry Kaufman's article "Trading Opening Gaps and Extreme Closes in Stocks" from the TASC's July 2024 edition of Traders' Tips , provides analytical insights into stock price behaviors following significant price moves. The information about the frequency, pullbacks, and closing patterns of these extreme price movements can aid in developing more effective trading strategies by understanding what to expect during volatile market conditions.
█ CONCEPTS
Perry Kaufman's article investigates the behavior of stock prices following substantial opening gaps and extreme closing moves to identify patterns and expectations that traders can utilize to make informed decisions. The motivation behind the article is to offer traders a more scientific approach to understanding price movements during volatile market conditions, particularly during earnings season or significant economic events. Kaufman's analysis reveals that stock prices have a history of exhibiting certain behaviors after substantial price gaps and extreme closes. This script follows Perry Kaufman's study and helps provide insight into how prices often behave after significant price changes. This analysis can help traders establish price movement expectations and potential strategies for trading such occurrences.
█ CALCULATIONS
Input Parameters:
This script offers users the choice to analyze "Opening Gaps" or "Extreme Closes" for price movements of different predefined magnitudes in a specified direction ("Upward" or "Downward").
Outputs:
Based on the specified inputs, the script performs the following calculations for the active ticker displayed on the chart:
Frequency of Extreme Price Movements : Quantifies the occurrences of directional price movements within predefined percentage ranges.
Average Pullbacks : Computes the average retracement (pullback) from analyzed price movements within each percentage range.
Average Closes : Analyzes the typical closing behavior relative to the directional price movements within each range.
The script organizes the results from these calculations within the table on a separate chart pane, providing users with helpful insights into how a stock historically behaved following significant price movements.
Strong Support and Resistance with EMAs @viniciushadek
### Strategy for Using Continuity Points with 20 and 9 Period Exponential Moving Averages, and Support and Resistance
This strategy involves using two exponential moving averages (EMA) - one with a 20-period and another with a 9-period - along with identifying support and resistance levels on the chart. Combining these tools can help determine trend continuation points and potential entry and exit points in market operations.
### 1. Setting Up the Exponential Moving Averages
- **20-Period EMA**: This moving average provides a medium-term trend view. It helps smooth out price fluctuations and identify the overall market direction.
- **9-Period EMA**: This moving average is more sensitive and reacts more quickly to price changes, providing short-term signals.
### 2. Identifying Support and Resistance
- **Support**: Price levels where demand is strong enough to prevent the price from falling further. These levels are identified based on previous lows.
- **Resistance**: Price levels where supply is strong enough to prevent the price from rising further. These levels are identified based on previous highs.
### 3. Continuity Points
The strategy focuses on identifying trend continuation points using the interaction between the EMAs and the support and resistance levels.
### 4. Buy Signals
- When the 9-period EMA crosses above the 20-period EMA.
- Confirm the entry if the price is near a support level or breaking through a resistance level.
### 5. Sell Signals
- When the 9-period EMA crosses below the 20-period EMA.
- Confirm the exit if the price is near a resistance level or breaking through a support level.
### 6. Risk Management
- Use appropriate stops below identified supports for buy operations.
- Use appropriate stops above identified resistances for sell operations.
### 7. Validating the Trend
- Check if the trend is validated by other technical indicators, such as the Relative Strength Index (RSI) or Volume.
### Conclusion
This strategy uses the combination of exponential moving averages and support and resistance levels to identify continuity points in the market trend. It is crucial to confirm the signals with other technical analysis tools and maintain proper risk management to maximize results and minimize losses.
Implementing this approach can provide a clearer view of market movements and help make more informed trading decisions.
Prometheus Analytics Hurst ExponentThis indicator uses market data to calculate the Hurst Exponent so traders can have knowledge of the long memory of the asset.
Users can control the lookback length for the H value (Hurst Exponent), lookback length for the SMA (Simple Moving Average) of the Hurst Exponent, to show either, and what to calculate the H value and SMA on.
Hurst Exponent:
The Hurst Exponent is a value between 0 and 1 with 0.5 as a midline.
An H value(Hurst Exponent) above 0.5 indicates a trending market, and a market that should have larger, longer moves.
An H value below 0.5 indicates a mean reverting market, and a market that should have smaller, shorter moves.
An H value of0.5 indicates a random walk. This would mean the price would follow a Brownian Motion model and future prices would be independent from past prices.
Just because the H value is above 0.5 does not indicate that there should be an UP trend, just as a value below 0.5 does not indicate a DOWN trend. It indicates that there should be a trend, up or down.
Scenarios:
An intuitive way to use the Hurst Exponent is as an asset is trending in whatever direction, as the H value crosses below 0.5 it indicates a reversal. It indicates that what was happening before isn’t impacting what is happening now as much.
Steps explained from picture:
Step 1: Strong uptrend is identified with the asset moving up aggressively with H above 0.5.
Step 2: The H value crosses below 0.5 and prices stay elevated.
Step 3: Price reverts back down as the H value stays below 0.5
Just because the H value is above 0.5 doesn’t mean the asset has to be uptrending. In this example we see the asset fall as the H value is above 0.5. Not only that, but every time it crosses below 0.5, the asset takes a breather on the way down
Step 1: As the H value crosses above 0.5, we can expect trends to appear in the asset.
Step 2: After the trend switches to down, we only see a breather and some chop after the H value crosses back below 0.5.
Step 3: Once The H value crosses back over we see the downtrend continue and new lows be made.
Step 4: We see it once again, simply the area of chop is bigger. We don’t see a higher high, breaking the overall downtrend, but once the H value crosses over again the downturn continues and we see a lower low.
It may occur when no strong trend is made in either direction. The H value above 0.5 does indeed sometimes correlate with an uptrend sometimes.
Step 1: After the strong downtrend we see a break below 0.5 with some consolidation.
Step 2: No clear big move on the asset or H value.
Step 3: H value above 0.5 leads to a break of highs and a new uptrend.
Users have the option to decide what to calculate the H value on. Close is the default, or dollar return per bar are the options. Dollar return per bar and offer an H value that may give a better indication of when price moves will be small and sporadic.
Using dollar move per bar.
Step 1: H value cross above 0.5, we see large candles and fast moves.
Step 2: H value crosses below 0.5, the candles immediately following are shorter. The big red candles come right before the cross back above.
Step 3: H value cross back above 0.5, after some chop, large move down.
Similar story
Step 1: H value above 0.5, big trends either direction
Step 2: After the H value crosses below, the moves are short and choppy.
Settings:
Options to show or remove either the H value or it’s SMA.
Options to adjust the period uses, default is (32, 16)
Fresh Zones The indicator is named "Fresh Zones"
Bullish Fresh Zone:
- This part looks for a specific pattern in the price movement that indicates a potential bullish (upward) trend.
- It checks if the current bar's low price is higher than the previous bar's opening price.
- It also checks if the previous bar's closing price was higher than its opening price.
- Additionally, it checks if the bar before the previous one had a closing price lower than its opening price.
- If all these conditions are met, it identifies a bullish fresh zone.
Bearish Fresh Zone:
- This part looks for a specific pattern in the price movement that indicates a potential bearish (downward) trend.
- It checks if the current bar's high price is lower than the previous bar's opening price.
- It also checks if the previous bar's closing price was lower than its opening price.
- Additionally, it checks if the bar before the previous one had a closing price higher than its opening price.
- If all these conditions are met, it identifies a bearish fresh zone.
Color Coding:
- When a bullish fresh zone is identified, it colors the candlestick from two bars ago with a specific yellowish color (`color.rgb(240, 243, 33)`).
- When a bearish fresh zone is identified, it colors the candlestick from two bars ago with a specific pink color (`color.rgb(255, 0, 191)`).
Alert:
- The script creates an alert condition.
- If either a bullish or bearish fresh zone pattern appears, it triggers an alert with the message "A Fresh zone has appeared!".
ADR Study [TFO]This indicator is focused on the Average Daily Range (ADR), with the goal of collecting data to show how often price reaches/closes through these levels, as well as a look at historical moves that reached ADR and at similar times of day to study how price moved for the remainder of the session.
The ADR here (blue line) is calculated using the difference between a day's highest and lowest points. If our ADR length is 5, then we are taking this difference from the last 5 days and averaging them together. At the following day's open, we take half of this average and plot it above and below the daily opening price to place theoretical limits on how far price may move according to the lookback period. The triangles indicate when price has reached ADR (either +ADR or -ADR), and alerts can be created for these events.
The Scale Factor is an optional parameter to scale the ADR by a certain amount. If set to 2 for example, then the ADR would be 2x the average daily range. This value will be reflected in the statistics options so that users can see how different values affect the outcomes.
Show Table will display data collected on how often price reaches these levels, and how often price closes through them, for each day of the week. By default, these are colored as blue and red, respectively. From the following chart of NQ1!, we can see for example that on Mondays, price reached +ADR 38% of the time and closed through it 23% of the time. Note that the statistics for closing through the ADR levels are derived from all instances, not just those that reached ADR.
Show Sample Sizes will display how many instances were collected for all given sets of data. Referring to the same example of NQ1!, we can see that this particular chart has collected data from 109 Mondays. From those Mondays, 41 reached +ADR (38%, verifying our initial claim) and 25 closed through it (23%). This is important to understand the scope of the data that we're working with, as percentages can be misleading for smaller sample sizes.
Show Histogram will plot the same exact data as the table, just in a histogram form to visually emphasize the differences on a day-by-day basis. On this chart of RTY1!, we can see for example from the top histogram that on Wednesdays, 40% reached +ADR and only 22% closed through it. Similarly if we look at the bottom histogram, we can see that Wednesdays reached -ADR 46% of the time and closed through it only 28% of the time.
We can also use Show Sample Sizes to display the same information that would be in the table, showing how many instances were collected for each event. In this case we can see that we observed 175 Fridays, where 76 reached +ADR (43%) and 44 closed above it (25%).
Show Historical Moves is an interesting feature of this script. When enabled, if price has reached +/- ADR in the current session, the indicator will plot the evolution of the close prices from all past sessions that reached +/- ADR to see how they traded for the remainder of the session. These calculations are made with respect to the ADR range at the time that price traded through these levels.
Historical Proximity (Bars) allows the user to observe historical moves where price reached ADR within this many bars of the current session (assuming price has reached an ADR level in the current session). In the above chart, this is set to 1000 so that we can observe each and every instance where price reached an ADR level. However, we can refine this a bit more.
By limiting the Historical Proximity to something like 20, we are only considering historical moves that reached ADR within 20 bars of todays +ADR reach (9:50 am EST, noted by the blue triangle up). We can enable Show Average Move to display the average move by the filtered dataset, and Match +/-ADR to only observe moves inline with the current day's price action (in this case, only moves that reached +ADR, since price has not reached -ADR).
We can add one more filter to this data with the setting Only Show Days That: closed through ADR; closed within ADR; or either. The option either is what you see above, as we are considering both days that closed through ADR and days that closed within it (note that in this case, closing within ADR simply means that price reached +ADR and closed the day below it, and vice versa for -ADR; this does not mean that price must have closed in between +ADR and -ADR). If we set this to only show instances that closed within ADR, we see the following data.
Alternatively, we can choose to Only Show Days That closed through ADR, where we would see the following data. In this case, the average move very much resembles the price action that occurred on this particular day. This is in no way guaranteed, but it makes an interesting case for how we could use this data in our analysis by observing similar, historical price action.
Please note that this data will change over time on a rolling basis due to TradingView's bar lookback, and that for this same reason, lower timeframes will yield less data than larger timeframes.
Three Bar ReversalThis script was written to make it easier to discover three bar reversal patterns.
A three bar reversal occurs when these conditions are met:
Long Setup (Reversal Up)
1. Bar 1 closes down
2. Low of Bar 2 is below the low of Bar 1 and Bar 3
3. Bar 3 closes above the high of both Bar 1 and Bar 2
Short Setup (Reversal Down)
1. Bar 1 closes up
2. High of Bar 2 is above the high of Bar 1 and Bar 3
3. Bar 3 closes below the low of both Bar 1 and Bar 2
When this indicator is added to your chart, you will see "Reversal Up" or "Reversal Down" when one of the above conditions are met.
It is recommended to use the 1 minute time frame for short scalps and 5 minute time frame for longer held day trade positions.
This indicator also has an alert option.
To enable an alert:
1. Create a new alert
2. Set condition "Reversal" and "Any alert() function call"
3. Give the alert a unique name
It is good to have an alert for different tickers and different time frames!
When the alert is triggered, you will receive a message:
Reversal up on: ticker-ID-here
or
Reversal down on: ticker-ID-here
Never miss a trade setup again!
Swing Failure Zones and Signals [AlgoAlpha]Elevate your trading strategy with the Swing Failure Zones and Signals indicator by AlgoAlpha! This powerful tool helps you identify potential swing failure zones, offering clear bullish and bearish signals to guide your trading decisions. 📈💡
🎨 Bullish/Bearish Color Customization : Easily set the colors for bullish and bearish signals to match your chart preferences.
🧹 Mitigated Zone Removal : Option to remove mitigated zones from the chart for a cleaner view.
🔍 Range High/Low Lookback : Adjustable lookback period for determining significant highs and lows.
🖌 Dynamic Zone Creation : Automatically draws zones based on swing failure criteria.
🔔 Alert Conditions : Set alerts for both bullish and bearish swing failure conditions to stay informed without constant monitoring.
Quick Guide to Using the Swing Failure Zones and Signals Indicator
🛠 Add the Indicator : Search for "Swing Failure Zones and Signals " in TradingView's Indicators & Strategies. Customize settings like lookback period, colors, and zone removal options to fit your trading style.
📊 Market Analysis : Watch for the appearance of the zones and the directional arrows for potential reversal signals. Use these signals to identify key market entries and exits.
🔔 Alerts : Enable alerts for bullish and bearish swing failure conditions to capture trading opportunities without constant chart monitoring.
How it works
The indicator calculates the direction and length of each candle to identify swing failure points by comparing current high and low prices with those from the lookback period. A bullish swing failure is detected when the current low is lower than the previous low and the close is higher than the previous high, while a bearish swing failure occurs when the current high is higher than the previous high and the close is lower than the previous low. Upon detection, the script creates zones on the chart to indicate these failure points and manages them by removing invalidated zones based on the user's settings. Visual signals are plotted on the chart as arrows, and alerts are set for these conditions to help traders capture potential entry opportunities efficiently.
Enhance your trading edge with this robust tool designed to spotlight critical swing failure points in the market! 💪📈
Pre-COVID High and COVID LowOverview
The "Pre-COVID High and COVID Low" indicator is designed to identify and mark significant price levels on your chart, specifically targeting the pre-COVID-19 high and the low during the initial COVID-19 market impact. This script is particularly useful for traders who are interested in analyzing how stocks or other financial instruments reacted during the onset of the COVID-19 pandemic, providing a historical perspective that may help in making informed trading decisions.
How It Works
Date Ranges : The script uses predefined date ranges to calculate the highest and lowest price levels before and during the early stages of the COVID-19 pandemic. These ranges are:
Pre-COVID High: Between January 1, 2020, and March 31, 2020.
COVID Low: Between March 1, 2020, and March 31, 2020.
Calculation Method :
The highest price during the pre-COVID period is tracked and recorded as the "Pre-COVID High".
The lowest price during the specified COVID period is tracked and recorded as the "COVID Low".
Visibility Conditions : The script includes logic to ensure that these historical levels are only displayed if they fall within a range close to the current visible price range on the chart. This prevents the indicator from compressing the price scale unduly.
How to Use It
Adding to Your Char t: To use this indicator, add it to any chart on TradingView. It works best with daily time frames to clearly visualize the impact over these specific months.
Interpretation :
The "Pre-COVID High" is marked with a red line and is labeled the first day it becomes applicable.
The "COVID Low" is marked with a green line and is similarly labeled on its applicable day.
Trading Strategy Consideration : Traders can use these historical levels as potential support or resistance zones for their trading strategies. These levels can indicate significant price points where the market previously showed strong reactions.
No Wick Candlestick Identifier_GOVS1. Identification of Candlestick Patterns: The script checks each candlestick to determine if it meets the criteria for a "no wick" pattern. For bullish candles, it identifies those with no bottom wick, where the open price is equal to the low and the close price is greater than the open. For bearish candles, it identifies those with no top wick, where the open price is equal to the high and the close price is lower than the open.
2. Visualization: The script plots small triangles on the chart to highlight the identified candlestick patterns. Green triangles are plotted below bullish candles with no bottom wick, while red triangles are plotted above bearish candles with no top wick.
3. Drawing Lines and Labels: Additionally, the script draws lines extending from the opening price of these candles to the right edge of the screen, visually indicating the duration of these patterns. It also adds a label "Compensation" next to each line.
Percentage GridPercentage Grid Indicator
Description:
The Percentage Grid indicator is designed to assist traders in identifying significant support and resistance levels based on yearly percentage changes. This indicator plots horizontal lines on the chart from the start of the year, allowing you to customize how much percentage each line represents. Currently, you can set up to 5 horizontal lines, each representing a different percentage change from the beginning of the year.
For instance, when applied to the SBI Bank stock, you can customize the lines to display various percentage changes from the start of the year, such as 20%, 25%, and up to 35%, as the SBIN stock is currently trading around these levels. This visualization helps traders to easily identify key levels where price action tends to react, providing valuable insights for making trading decisions.
Principles of Trading Technical Analysis:
The Percentage Grid indicator is grounded in the principle of support and resistance levels, which are fundamental concepts in technical analysis. These levels are specific price points on a chart that tend to act as barriers, preventing the price from getting pushed in a certain direction. The indicator helps in:
Identifying Support Levels: Price levels where a downtrend can be expected to pause due to a concentration of buying interest.
Identifying Resistance Levels: Price levels where an uptrend can be expected to pause due to a concentration of selling interest.
By customizing and plotting percentage-based horizontal lines, the indicator highlights these critical levels based on the percentage change from the start of the year.
How to Use:
Add the Indicator to Your Chart:
Search for "Percentage Grid" in the TradingView indicator library and add it to your chart.
Customize Percentage Levels:
Access the indicator settings to customize the percentage change each line represents.
You can set up to 5 different percentage levels. For example, you can set lines at 20%, 25%, 30%, 35%, and 40%.
Interpret the Grid Lines:
The plotted lines will represent the specified percentage changes from the start of the year.
Use these lines to identify potential support and resistance levels where price action is likely to react.
Practical Application:
Look for price bounces or reversals around these levels, which can indicate strong support or resistance.
Combine the Percentage Grid with other technical analysis tools, such as moving averages or trend lines, to confirm potential trading opportunities.
Example:
In the accompanying screenshot, the Percentage Grid is applied to the SBI Bank stock. The lines are set to display 20%, 25%, 30%, 35%, and 40% changes from the start of the year. Notice how the price action respects these levels, providing clear areas where support and resistance are evident.
By incorporating the Percentage Grid into your trading strategy, you can enhance your ability to identify key price levels and make more informed trading decisions.
Happy Trading!
Gap Finder by DarkoexeThis indicator plots labels that indicate gaps whenever the open price and the previous bar close price have a significant gap.
To determine the size the gap has to be before it is labeled at a specific point in time on the chart. The gap needs to be larger or equal to a factor of an ATR value. For example, if the ATR gap factor is 0.25, the gap between the open and the previous close price must be greater than 0.25*ATR of the ATR length specified for the gap to be plotted on the chart.
Note: If you don't know what the ATR or average true range is, search for "ATR" in indicators. It is one of Trading View's most fundamental indicators.
Comprehensive Correlation Meter with Multiple MarketsThe Comprehensive Correlation Meter is designed to provide traders and investors with insights into the relationships between multiple financial instruments. This script expands upon an existing idea on TradingView about correlation by introducing the ability to analyze the correlation between three markets, offering deeper insights into market relationships. It helps users understand how these markets move in relation to each other, aiding in risk management and portfolio diversification.
Key Features:
Multiple Market Analysis: This script allows you to analyze the correlation between your primary market and two other selected markets.
Customizable Inputs: Users can select any symbols for the reference and third markets, and these selections must be confirmed before use.
Correlation Coefficients: Calculates and plots the correlation coefficients for:
Current Market vs. Reference Market
Third Market vs. Reference Market
Current Market vs. Third Market
An average correlation of all three markets combined.
Visual Aids: Plots reference lines at +1, 0, and -1 to indicate maximum positive correlation, no correlation, and maximum negative correlation.
How It Works:
Input Symbols: Select the symbols for the reference and third markets. The current market is based on the chart you are viewing.
Data Collection: The script collects the closing prices of the selected markets and calculates the percentage changes.
Correlation Calculation: Using the collected data, the script computes the covariance and standard deviations to determine the correlation coefficients.
Visualization: The correlation coefficients and covariances are plotted for visual analysis.
How to Use:
Select Symbols:
Use the input fields to specify the reference and third market symbols. Confirm your selections to proceed.
Customize Display:
Choose whether to display the covariance, reference market, current market, and third market.
Select which correlation coefficients to display.
Interpret Results:
A correlation coefficient close to +1 indicates a strong positive correlation.
A coefficient close to -1 indicates a strong negative correlation.
A coefficient around 0 indicates little to no correlation.
Use these insights to manage risk and diversify your portfolio effectively.
Example Use Case:
Suppose you are trading the S&P 500 and want to understand its correlation with the NASDAQ 100 and a particular stock, such as Apple. By setting the S&P 500 as the reference market, the NASDAQ 100 as the third market, and observing the current market (Apple), you can see how these instruments move in relation to each other. This can help you decide on hedging strategies or identify opportunities for diversification. However this is Not a Financial advise
Normalized Performance ComparisonThis script visualizes the relative performance of a primary asset against a benchmark composed of three reference assets. Here's how it works:
User Inputs:
- Users specify ticker symbols for three reference assets (default: Platinum, Palladium, Rhodium).
Data Retrieval:
- Fetches closing prices for the primary asset (the one the script is applied to) and the three reference assets.
Normalization:
- Each asset's price is normalized by dividing its current price by its initial price at the start of the chart. This allows for performance comparison on a common scale.
Benchmark Creation:
- The normalized prices of the three reference assets are combined to create a composite benchmark.
Ratio Calculation:
- Computes the ratio of the normalized primary asset price to the combined normalized benchmark price, highlighting relative performance.
Plotting:
- Plots this ratio as a blue line on the chart, showing the primary asset's performance relative to the benchmark over time.
This script helps users quickly assess how well the primary asset is performing compared to a set of reference assets.
ATH/ATL Tracker [LuxAlgo]The ATH/ATL Tracker effectively displays changes made between new All-Time Highs (ATH)/All-Time Lows (ATL) and their previous respective values, over the entire history of available data.
The indicator shows a histogram of the change between a new ATH/ATL and its respective preceding ATH/ATL. A tooltip showing the price made during a new ATH/ATL alongside its date is included.
🔶 USAGE
By tracking the change between new ATHs/ATLs and older ATHs/ATLs, traders can gain insight into market sentiment, breadth, and rotation.
If many stocks are consistently setting new ATHs and the number of new ATHs is increasing relative to old ATHs, it could indicate broad market participation in a rally. If only a few stocks are reaching new ATHs or the number is declining, it might signal that the market's upward momentum is decreasing.
A significant increase in new ATHs suggests optimism and willingness among investors to buy at higher prices, which could be considered a positive sentiment. On the other hand, a decrease or lack of new ATHs might indicate caution or pessimism.
By observing the sectors where stocks are consistently setting new ATHs, users can identify which sectors are leading the market. Sectors with few or no new ATHs may be losing momentum and could be identified as lagging behind the overall market sentiment.
🔶 DETAILS
The indicator's main display is a histogram-style readout that displays the change in price from older ATH/ATLs to Newer/Current ATH/ATLs. This change is determined by the distance that the current values have overtaken the previous values, resulting in the displayed data.
The largest changes in ATH/ATLs from the ticker's history will appear as the largest bars in the display.
The most recent bars (depending on the selected display setting) will always represent the current ATH or ATL values.
When determining ATH & ATL values, it is important to filter out insignificant highs and lows that may happen constantly when exploring higher and lower prices. To combat this, the indicator looks to a higher timeframe than your chart's timeframe in order to determine these more significant ATHs & ATLs.
For Example: If a user was on a 1-minute chart and 5 highs-new highs occur across 5 adjacent bars, this has the potential to show up as 5 new ATHs. When looking at a higher timeframe, 5 minutes, only the highest of the 5 bars will indicate a new ATH. To assist with this, the indicator will display warnings in the dashboard when a suboptimal timeframe is selected as input.
🔹 Dashboard
The dashboard displays averages from the ATH/ATL data to aid in the anticipation and expectations for new ATH/ATLs.
The average duration is an average of the time between each new ATH/ATL, in this indicator it is calculated in "Days" to provide a more comprehensive understanding.
The average change is the average of all change data displayed in the histogram.
🔶 SETTINGS
Duration: The designated higher timeframe to use for filtering out insignificant ATHs & ATLs.
Order: The display order for the ATH/ATL Bars, Options are to display in chronological (oldest to newest) or reverse chronological order (newest to oldest).
Bar Width: Sets the width for each ATH/ATL bar.
Bar Spacing: Sets the # of empty bars in between each ATH/ATL bar.
Dashboard Settings: Parameters for the dashboard's size and location on the chart.
Chuck Dukas Market Phases of Trends (based on 2 Moving Averages)This script is based on the article “Defining The Bull And The Bear” by Chuck Duckas, published in Stocks & Commodities V. 25:13 (14-22); (S&C Bonus Issue, 2007).
The article “Defining The Bull And The Bear” discusses the concepts of “bullish” and “bearish” in relation to the price behavior of financial instruments. Chuck Dukas explains the importance of analyzing price trends and provides a framework for categorizing price activity into six phases. These phases, including recovery, accumulation, bullish, warning, distribution, and bearish, help to assess the quality of the price structure and guide decision-making in trading. Moving averages are used as tools for determining the context preceding the current price action, and the slope of a moving average is seen as an indicator of trend and price phase analysis.
The six phases of trends
// Definitions of Market Phases
recovery_phase = src > ma050 and src < ma200 and ma050 < ma200 // color: blue
accumulation_phase = src > ma050 and src > ma200 and ma050 < ma200 // color: purple
bullish_phase = src > ma050 and src > ma200 and ma050 > ma200 // color: green
warning_phase = src < ma050 and src > ma200 and ma050 > ma200 // color: yellow
distribution_phase = src < ma050 and src < ma200 and ma050 > ma200 // color: orange
bearish_phase = src < ma050 and src < ma200 and ma050 < ma200 // color red
Recovery Phase : This phase marks the beginning of a new trend after a period of consolidation or downtrend. It is characterized by the gradual increase in prices as the market starts to recover from previous losses.
Accumulation Phase : In this phase, the market continues to build a base as prices stabilize before making a significant move. It is a period of consolidation where buying and selling are balanced.
Bullish Phase : The bullish phase indicates a strong upward trend in prices with higher highs and higher lows. It is a period of optimism and positive sentiment in the market.
Warning Phase : This phase occurs when the bullish trend starts to show signs of weakness or exhaustion. It serves as a cautionary signal to traders and investors that a potential reversal or correction may be imminent.
Distribution Phase : The distribution phase is characterized by the market topping out as selling pressure increases. It is a period where supply exceeds demand, leading to a potential shift in trend direction.
Bearish Phase : The bearish phase signifies a strong downward trend in prices with lower lows and lower highs. It is a period of pessimism and negative sentiment in the market.
These rules of the six phases outline the cyclical nature of market trends and provide traders with a framework for understanding and analyzing price behavior to make informed trading decisions based on the current market phase.
60-period channel
The 60-period channel should be applied differently in each phase of the market cycle.
Recovery Phase : In this phase, the 60-period channel can help identify the beginning of a potential uptrend as price stabilizes or improves. Traders can look for new highs frequently in the 60-period channel to confirm the trend initiation or continuation.
Accumulation Phase : During the accumulation phase, the 60-period channel can highlight that the current price is sufficiently strong to be above recent price and longer-term price. Traders may observe new highs frequently in the 60-period channel as the slope of the 50-period moving average (SMA) trends upwards while the 200-period moving average (SMA) slope is losing its downward slope.
Bullish Phase : In the bullish phase, the 60-period channel showing a series of higher highs is crucial for confirming the uptrend. Additionally, traders should observe an upward-sloping 50-period SMA above an upward-sloping 200-period SMA for further validation of the bullish phase.
Warning Phase : When in the warning phase, the 60-period channel can provide insights into whether the current price is weaker than recent prices. Traders should pay attention to the relationship between the price close, the 50-period SMA, and the 200-period SMA to gauge the strength of the phase.
Distribution Phase : In the distribution phase, traders should look for new lows frequently in the 60-period channel, hinting at a weakening trend. It is crucial to observe that the 50-period SMA is still above the 200-period SMA in this phase.
Bearish Phase : Lastly, in the bearish phase, the 60-period channel reflecting a series of lower lows confirms the downtrend. Traders should also note that the price close is below both the 50-period SMA and the 200-period SMA, with the relationship of the 50-period SMA being less than the 200-period SMA.
By carefully analyzing the 60-period channel in each phase, traders can better understand market trends and make informed decisions regarding their investments.
Market Slayer (i)Market Slayer (i)
This script is designed to provide insights into market trends and generate trading signals based on a combination of moving average crossovers and trend confirmation. It aims to assist traders in identifying potential entry and exit points in the market.
Input Parameters:
Trend Timeframe: Allows the user to specify the timeframe for trend analysis. Default is set to W (weekly).
Trend Value: Defines the sensitivity of the trend detection algorithm.
Short SMA Length: Length of the short-term Simple Moving Average (SMA).
Long SMA Length: Length of the long-term Simple Moving Average (SMA).
Bullish Color: Color representation for bullish signals.
Bearish Color: Color representation for bearish signals.
Take Profit Color: Color representation for take profit events.
Simple Moving Average (SMA) Logic:
Two SMAs are calculated based on the provided lengths: one short-term and one long-term.
Short-term SMA values are plotted with a semi-transparent bearish color.
Long-term SMA values are plotted with a semi-transparent bullish color.
Trend Logic:
The script employs a modified SSL (Schaff Trend Cycle) indicator to determine the trend direction.
Trend direction is determined based on whether the closing price is above or below the SSL (Schaff Trend Cycle) indicator.
Trend changes are detected by comparing the current trend direction with the previous two trend directions.
Signal Logic:
Buy signals are generated when the short-term SMA crosses above the long-term SMA and the trend is bullish.
Sell signals are generated when the short-term SMA crosses below the long-term SMA and the trend is bearish.
Signals are confirmed only if there is no open position.
Take Profit Logic:
Take profit events are triggered when the trend changes direction after a position has been opened.
Take profit events are confirmed only if there is an open position.
Alerts:
Various alerts are included to notify traders of different events such as signal generation, take profit opportunities, and trend changes.
Usage of lookahead:
Within the script, the lookahead argument is utilized in the request.security() function to control how much historical data should be loaded for trend analysis.
Setting lookahead=barmerge.lookahead_on enables the script to consider future price movements when calculating trend conditions.
This functionality can enhance the accuracy of trend detection by incorporating future bars into the analysis.
Usage:
Traders can use this script on the TradingView platform to visualize market trends, identify potential entry and exit points, and receive timely alerts for trading opportunities.
HTF Descending TriangleHTF Descending Triangle aims at detecting descending triangles using higher time frame data, without repainting nor misalignment issues.
Descending triangles are defined by a falling upper trend line and an horizontal lower trend line. It is a chart pattern used in technical analysis to predict the continuation of a downtrend.
This indicator can be useful if you, like me, believe that higher time frames can offer a broader perspective and provide clearer signals, smoothing out market noise and showing longer-term trends.
You can change the indicator settings as you see fit to tighten or loosen the detection, and achieve the best results for your use case.
Features
It draws the detected descending triangle on the chart.
It supports alerting when a detection occurs.
It allows for setting the higher time frame to run the detection on.
It allows for setting the minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
It allows for setting a low factor detection criteria to apply on higher time frame bars low as a proportion of the distance between the reference bar low and open/close.
It allows for turning on an adjustment of the triangle using highest/lowest values within valid higher time frame bars.
Settings
Higher Time Frame dropdown: Selects higher time frame to run the detection on. It must be higher than, and a multiple of, the chart's timeframe.
Valid Bars Minimum field: Sets minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
Low Factor checkbox: Turns on/off low factor detection criteria.
Low Factor field: Sets low factor to apply on higher time frame bars low as a proportion of the distance between the reference bar low and open/close.
Adjust Triangle checkbox: Turns on/off triangle adjustment using highest/lowest values within valid higher time frame bars.
Detection Algorithm Notes
The detection algorithm recursively selects a higher time frame bar as reference. Then it looks at the consecutive higher time frame bars (as per the requested number of minimum valid bars) as follows:
High must be lower than previous bar.
Open/close min value must be higher than reference bar low.
When low factor criteria is turned on, low must be lower than reference bar open/close min value minus low factor proportion of the distance between reference bar low and open/close min value.
EMA Crossover with RSI
ChatGPT
Certainly! Here's a TradingView Pine Script that combines EMA crossover with RSI to generate buy and sell signals. The script will give a buy signal when the 20 EMA crosses above the 50 EMA and the RSI is below a certain threshold (indicating it's not overbought). Similarly, it will give a sell signal when the 20 EMA crosses below the 50 EMA and the RSI is above a certain threshold (indicating it's not oversold).
pinescript
Copy code
//@version=5
indicator("EMA Crossover with RSI", overlay=true)
// Input for EMAs
ema20_length = input.int(20, title="20 EMA Length")
ema50_length = input.int(50, title="50 EMA Length")
// Input for RSI
rsi_length = input.int(14, title="RSI Length")
rsi_overbought = input.int(70, title="RSI Overbought Level")
rsi_oversold = input.int(30, title="RSI Oversold Level")
// Calculating EMAs
ema20 = ta.ema(close, ema20_length)
ema50 = ta.ema(close, ema50_length)
// Calculating RSI
rsi = ta.rsi(close, rsi_length)
// Plotting EMAs
plot(ema20, title="20 EMA", color=color.blue, linewidth=2)
plot(ema50, title="50 EMA", color=color.red, linewidth=2)
// Conditions for buy and sell signals
buy_condition = ta.crossover(ema20, ema50) and rsi < rsi_overbought
sell_condition = ta.crossunder(ema20, ema50) and rsi > rsi_oversold
// Plotting buy and sell signals on the chart
plotshape(series=buy_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sell_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Adding background color to highlight buy and sell zones
bgcolor(buy_condition ? color.new(color.green, 90) : na, title="Buy Background Highlight")
bgcolor(sell_condition ? color.new(color.red, 90) : na, title="Sell Background Highlight")
Explanation:
Input Parameters:
ema20_length and ema50_length to set the lengths for the EMAs.
rsi_length for the length of the RSI calculation.
rsi_overbought and rsi_oversold to set the levels for overbought and oversold conditions respectively.
Calculations:
ema20 and ema50 are calculated using ta.ema.
rsi is calculated using ta.rsi.
Conditions:
buy_condition checks for the crossover of ema20 above ema50 and that the RSI is below the overbought threshold.
sell_condition checks for the crossover of ema20 below ema50 and that the RSI is above the oversold threshold.
Plotting:
The EMAs are plotted on the chart.
Buy and sell signals are plotted using plotshape.
Background colors are added to highlight the buy and sell zones for better visual interpretation.
Wolf DCA CalculatorThe Wolf DCA Calculator is a powerful and flexible indicator tailored for traders employing the Dollar Cost Averaging (DCA) strategy. This tool is invaluable for planning and visualizing multiple entry points for both long and short positions. It also provides a comprehensive analysis of potential profit and loss based on user-defined parameters, including leverage.
Features
Entry Price: Define the initial entry price for your trade.
Total Lot Size: Specify the total number of lots you intend to trade.
Percentage Difference: Set the fixed percentage difference between each DCA point.
Long Position: Toggle to switch between long and short positions.
Stop Loss Price: Set the price level at which you plan to exit the trade to minimize losses.
Take Profit Price: Set the price level at which you plan to exit the trade to secure profits.
Leverage: Apply leverage to your trade, which multiplies the potential profit and loss.
Number of DCA Points: Specify the number of DCA points to strategically plan your entries.
How to Use
1. Add the Indicator to Your Chart:
Search for "Wolf DCA Calculator" in the TradingView public library and add it to your chart.
2. Configure Inputs:
Entry Price: Set your initial trade entry price.
Total Lot Size: Enter the total number of lots you plan to trade.
Percentage Difference: Adjust this to set the interval between each DCA point.
Long Position: Use this toggle to choose between a long or short position.
Stop Loss Price: Input the price level at which you plan to exit the trade to minimize losses.
Take Profit Price: Input the price level at which you plan to exit the trade to secure profits.
Leverage: Set the leverage you are using for the trade.
Number of DCA Points: Specify the number of DCA points to plan your entries.
3. Analyze the Chart:
The indicator plots the DCA points on the chart using a stepline style for clear visualization.
It calculates the average entry point and displays the potential profit and loss based on the specified leverage.
Labels are added for each DCA point, showing the entry price and the lots allocated.
Horizontal lines mark the Stop Loss and Take Profit levels, with corresponding labels showing potential loss and profit.
Benefits
Visual Planning: Easily visualize multiple entry points and understand how they affect your average entry price.
Risk Management: Clearly see your Stop Loss and Take Profit levels and their impact on your trade.
Customizable: Adapt the indicator to your specific strategy with a wide range of customizable parameters.