DCA Valuation & Unrealized GainsThis Pine Script for TradingView calculates and visualizes the relationship between a Dollar Cost Average (DCA) price and the All-Time High (ATH) price for over 50 different cryptocurrencies. Here's what it does:
1. Inputs for DCA Prices:
- Users can manually input DCA prices for specific cryptocurrencies (e.g., BTC, ETH, BNB).
2. Dynamic ATH Calculation:
- Dynamically calculates the ATH price for the current asset using the highest price in the chart's loaded data and persists this value across bars.
3. Percentage Change from DCA to ATH:
- Computes the percentage gain from the DCA price to the ATH price.
4. Visualizations:
- Draws a line at the DCA price and the ATH price, both extended to the right.
- Adds an arrow pointing from the DCA price to the ATH, offset by 10 bars into the future.
- Displays labels for:
- The percentage gain from DCA to ATH.
- "No DCA Configured" if no valid DCA price is set for the asset.
5. Color Coding:
- Labels and arrows are color-coded to indicate positive or negative percentage changes:
- Green for gains.
- Red for losses.
6. Adaptability:
- The script dynamically adjusts to the current asset based on its ticker and uses the corresponding DCA price.
This functionality provides traders with clear insights into their investment's performance relative to its ATH, aiding in decision-making.
-----
To add a new asset to the script:
1. Define the DCA Input: Add a new input for the asset's DCA price using the `input.float` function. For example:
dcaPriceNEW = input.float(title="NEW DCA Price", defval=0.1, tooltip="Set the DCA price for NEW")
2. Add the Asset Logic: Include a conditional check for the new asset in the ticker matching logic:
if str.contains(currentAsset, "NEW") and dcaPriceNEW != 0
dcaPrice := dcaPriceNEW
Where NEW is the ticker symbol of the asset you're adding.
NOTE: SOLO had to be put before SOL because otherwise the indicator was pulling the DCA price from SOL even on the SOLO chart. If you have a similar issue, try that fix.
Adding an asset requires only these two changes. Once done, the script dynamically incorporates the new asset into its calculations and visualizations.
Alltimehigh
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.
ATH Distance HeatmapThe "ATH Distance Heatmap" is a powerful visualization tool designed for traders and investors who seek to quickly assess the relative performance of assets against their All-Time Highs (ATH). By mapping the percentage distance of current prices from their historical peaks, this script provides a unique perspective on market sentiment, potential recovery opportunities, and overvaluation risks.
Key Features:
Visual Clarity: Utilize a color-coded heatmap to instantly recognize which assets are near or far from their ATHs. Colors transition smoothly from cool to warm tones, indicating smaller to larger distances respectively.
Real-Time Updates: The script updates dynamically with live market data, ensuring you have the most current information at your fingertips.
Versatile Application: Whether you're tracking stocks, cryptocurrencies, commodities, or indices, the "ATH Distance Heatmap" adapts to a wide array of assets, making it a versatile tool for your trading arsenal.
Insightful Analysis: Beyond mere visualization, this tool can help identify potential buying opportunities in assets that are significantly below their ATHs, or highlight caution for those nearing their peaks.
How to Use:
Configure Your Assets: Start by selecting the assets you wish to track. The script can be customized to monitor a broad market range or a specific segment.
Interpret the Colors: Use the color gradient to gauge the distance of each asset from its ATH. Cooler colors indicate assets closer to their ATH, while warmer colors highlight those further away.
Ideal for:
Traders looking for a quick visual guide to market trends and asset performance.
Investors aiming to capitalize on recovery opportunities or to evaluate entry and exit points.
Market analysts interested in a concise overview of asset health relative to historical performance.
All Time High (ATH) Levels [LuxAlgo]The All Time High (ATH) Levels indicator displays a user-set amount of historical all-time high levels made on the user's chart, highlighting potential key price levels.
Displayed levels can be filtered out based on their duration, as well as their relative distance from each other.
The script also evaluates the role a level might have as a support or resistance using a percentage, classifying ATH levels as either support or resistance depending on the result.
🔶 USAGE
On certain assets market participants give a high level of attention to all-time highs made by an asset, with the most pertinent example being Bitcoin.
Previous all-time highs can play important roles as psychological price levels, with the most recent ones often offering major resistance points, and older ones being used as support.
Users can filter out temporary ATHs using the ATH Minimum Duration setting, removing any ATH that lasts less than the user-specified number of bars. Higher values of this setting effectively preserve ATHs that become distinguishable peaks. These can offer more significant support/resistance levels.
When displaying each historical level some of them can be very close to each other. Users can use the "Minimum Distance Between ATH" setting to filter out levels too close to each other, with higher values of this setting returning more spaced levels. Distances are first evaluated from the most recent ATH. Note that this setting can cause repainting.
🔹 SR Classification
The script evaluates the ability of an ATH level to act as a support or resistance since its occurrence, and measures its strength as a percentage, with higher percentage values suggesting a stronger support or resistance.
Levels classified with "R" suggest that the price was located below the level most of the time, indicative of a resistance, while a level classified with "S" suggests that the price was located above the level most of the time, indicative of a support.
Percentages between 99% to 50% are often indicative of supports/resistances being tested, while values below 50% reflect more centered levels. A value of 100% suggests that an ATH level was not tested enough. users can filter out any level with a percentage below the "Minimum %" setting.
🔶 SETTINGS
Show Last ATH: Specify the amount of most recent ATH's to display.
ATH Minimum Duration: Minimum duration (in bars) of an ATH, that is the minimum number of bars that must elapse before another ATH can be made.
Minimum Distance Between ATH: Minimum distance between displayed ATH levels, starting from the most recent ATH. This distance is a multiple of the average true range.
🔹 SR Classification
Show SR%: Show percentage as well as ATH level classification.
Minimum %: Minimum percentage values required to display an ATH level.
[ChasinAlts] All-Timers [MO]*** PLEASE NOTE: THIS SCRIPT WILL MAKE TV's SERVERS FLEX IT'S MUSCLES SO IT WILL SLOW DOWN OTHER PROCESSES WITHIN TV (HIDE THEM IF NECESSARY TO REGAIN THE SPEED/FUNCTION...OR DELETE THEM...WHAT DO I CARE???) ESP IF YOU HAVE 3-4 ITERATIONS AS I DO TO SHOW THE WHOLE KUCOIN MARGIN MARKET ***
G'day Tradeurs, Hope everyone is having a FAN-FRIGGIN-TASTIC DAY!!! Right now (November 2nd, 2022) is a GREAT time to look for coins that are near their ALL-Time Low
due to the incoming bull market rearing its head around the corner (I'd wait for ONE MORE big dump to be safe though). And how GREAT would it be to even have
$50 of a coin with 10X leverage (I wouldn't suggest this to others though) at the near bottom said market? That is the reason for me publishing this.
This is a quick little scanner script thats part of my "Market Overview" series. Nothing monumental or advanced regarding the ATH/ATL calculations.
Perhaps one thing slightly different here than others is both the % from ATH and % from ATL is calculated and the result is the % that the price is between it's ATH/ATL.
So, it will show the All Time High/All Time Low BUT ONLY to the extent that the TF will allow. Ie. For the Free Planned Users, they can only get data as far back as
5,000 bars would provide. Thus, the ATH/ATL will not show the ACTUAL ATH/ATL but the highest high/lowest low within the last 5,000 bars. So if you want to get more
granular then I suggest you going with a Lower TF but if you want to see the ACTUAL ATH/ATL then the Daily TF or higher is what you're looking for. Make sure to note
that when a coin's plot is staying even with the 0 or 100 line(0 being the ATL within the TF and vise versa) that means the coin is pushing the ATH/ATL further than it
previously was, Also, as with many of my other scripts, I've included a coin filter that will either allow or disallow the plot to be printed depending on if the
"Printed Bar Count" is selected and if it's % is above the threshold (set by the user). This filter will pretty much be useless on the higher TF so don't expect a change
in the data output if you're using a HTF and have that filter selected for use. Elaboration on the inner-workings of MOST inputs can be found in the tooltips provided
along side it and viewed within the settings menu by hovering your curser over the little circled "i" next to the appropriate setting (or near it if the tooltips are
referencing each other or other inputs around itself). May the force be with your trades (in my best Darth Vader voice). Toodles. -ChasinAlts
Percent Off All-time High (% Off High)Percent Off All-time High tracks the percentage difference between the previous day’s closing price and the All-Time high price of the security’s entire price history.
This metric tells you how far the price has deviated from/converged on the all-time high price.
All-Time High with Percentage Drops for ETF's and Large CapsPlots the percentage drop levels from the All-Time High of any ticker. You can use this within a pullback trading system. For example, if you historically look at the average pullback of large cap stocks and ETF's, you can use this indicator to plot the levels it could pullback to for an entry to go long. It can be used as potential targets when trading a ticker short. Another use for this is to backtest the set percentage targets using TradingView's bar replay feature to see how ETF's and large cap stocks have reacted at these levels.
Currently percentage levels are statically set to 1, 2, 3, 5, 7, 10, & 20% levels below the All-Time High.
*Not financial advice but in my opinion the current percentage levels set (see above) are best used for ETF's and Large Cap Stocks.
All-Time High/Low WidgetIt's a pretty simple widget to track all-time high and all-time low values.
You can plot the levels and display some stats when all-time happened and how far away are we at this moment.
Also, you can create alerts to get notified on ATH/ATL breakout.
Thanks to @Verleiht for helping me with the code.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Drawdown over Window (in percentage)Unlike other scripts, which compare against the all time high, this allows you to specify the window over which the high should be searched.
If you want to compare against the all time high, just choose a long enough window.
Ath Atl Fibonacci Pivot Points [xaurr]This script draws fibonacci support and ressistance lines according to all time high and low values.
Distance from the ATH priceThis indicator shows us the distance (in %) between the current price and the ATH price.
The closer the price is to the ATH the higher the percentage.
100% means we reached the ATH price.
HOW TO USE:
No special input necessary.
Markets:
It can be used to all markets.
NOTE:
Some Exchanges don't go very far back in the past and for this reason this may have impact on this Indicator.
ALL TIME HIGH/LOW AND 52 WEEKS HIGH/LOWThis script show:
1. All time high/low line shown in maroon color
2. 52weeks high/low line shown in red color
3. 25% below 52wh and 30% upper 52wl as per Mark Minervini suggset in his book "Trade Like a Stock Market Wizard: How to Achieve Super Performance in Stocks in Any
Market"
Thats all, hope benefit tou you all.
Thank you.
inwCoin Percent from all-time highSimple study to show the fact to some newbies in the market that it is VERY HARD to make a profit and get your portfolio back to all-time high if you don't know how to stop loss...
Some people think "Oh, ez if you down -90% you need only +90% to get 100% of your capital again"
But... actually....if your portfolio down -90% you need to go 1000% from current price to reach your start capital!!!!
This study will show
- Current symbol detail
- Percent down from All-time High ( ATH )
- Percent up from current price to reach ATH again
10/20 MA Cross-Over with Heikin-Ashi Signals by SchobbejakThe 10/20 MA Heikin-Ashi Strategy is the best I know. It's easy, it's elegant, it's effective.
It's particularly effective in markets that trend on the daily. You may lose some money when markets are choppy, but your loss will be more than compensated when you're aboard during the big moves at the beginning of a trend or after retraces. There's that, and you nearly eliminate the risk of losing your profit in the long run.
The results are good throughout most assets, and at their best when an asset is making new all-time highs.
It uses two simple moving averages: the 10 MA (blue), and the 20 MA (red), together with heikin-ashi candles. Now here's the great thing. This script does not change your regular candles into heikin-ashi ones, which would have been annoying; instead, it subtly prints either a blue dot or a red square around your normal candles, indicating a heikin-ashi change from red to green, or from green to red, respectively. This way, you get both regular and heikin ashi "candles" on your chart.
Here's how to use it.
Go LONG in case of ALL of the below:
1) A blue dot appeared under the last daily candle (meaning the heikin-ashi is now "green").
2) The blue MA-line is above the red MA-line.
3) Price has recently breached the blue MA-line upwards, and is now above.
COVER when one or more of the above is no longer the case. This is very important. You want to keep your profit.
Go SHORT in case of ALL of the below:
1) A red square appeared above the last daily candle (meaning the heikin-ashi is now "red").
2) The red MA-line is above the blue MA-line.
3) Price has recently breached the blue MA-line downwards, and is now below.
Again, COVER when one or more of the above is no longer the case. This is what gives you your edge.
It's that easy.
Now, why did I make the signal blue, and not green? Because blue looks much better with red than green does. It's my firm believe one does not become rich using ugly charts.
Good luck trading.
--You may tip me using bitcoin: bc1q9pc95v4kxh6rdxl737jg0j02dcxu23n5z78hq9 . Much appreciated!--