Bitcoin Price Based On ElectricityThis script Calculates the price of Bitcoin solely on the hashrate and the cost of electricity.
The calculation is quite conservative considering its based on the average cost of electricity globally and we are assuming that everyone is running the latest mining hardware, which is the most efficient and cost effective.
Under both of these assumptions the calculation for bitcoins price is almost identical to the price we are seeing now.
If we change the reward rate to 3.125 (Aprils reward amount) then the price of one bitcoin per cost of work will be around 100k.
I am sure I am missing some important numbers in this calculation, fees, start up costs etc. However, it is very interesting to see that the price of Bitcoin can be calculated almost perfectly based on the hashrate and cost of electricity.
PROOF OF WORK
Cycles
PS January Barometer BacktesterPS January Barometer Backtester (PS JBB)
The PS January Barometer Backtester (PS JBB) is a simple strategy designed to test the "January Effect" hypothesis in financial markets. This effect theorizes that stock market performance in January can predict the trend for the rest of the year. The script operates on a monthly timeframe, focusing on capturing and analyzing the price movements in January and their subsequent influence on the market until the end of each year.
User Input:
January Trifecta Selectors
These are user-selectable options allowing traders to incorporate additional criteria into their market analysis.
The Santa Claus Rally refers to a stock market increase typically seen in the last week of December through the first two trading days in January.
The First Five Days Indicator assesses market performance during the initial five days of the year.
Script Operation:
The script automatically detects the start of each year, tracks January's high, and signals entry and exit points for trades based on the strategy's logic. It's an excellent tool for traders and investors looking to explore the January Effect's validity and its potential impact on their trading decisions.
In essence, the "PS January Barometer Backtester" is designed to exploit specific seasonal market trends, particularly focusing on the early part of the year, by analyzing and acting upon defined market movements. This strategy is ideal for traders who focus on yearly cyclical patterns and seek to incorporate historical trends into their trading decisions.
Note: This script is intended for educational and research purposes and should not be construed as financial advice. Always conduct your own due diligence before making trading/investment decisions.
Test - Most correlated assetThis is a simple test to find the most and least correlated assets in a list.
Time Range zoneThis TradingView script displays two time zones on the chart. The first zone starts at 8:00 AM and ends at 1:00 PM, while the second zone starts at 5:00 PM and ends at 10:00 PM. If the current time is within either of these two zones, a green or red background is drawn on the chart, respectively. This script is set by default for my personal XRP strategy.
Central Banks Balance Sheets ROI% ChangeIntroducing the "Central Banks Balance Sheets ROI% Change" indicator, a tool designed to offer traders and analysts an understanding of global liquidity dynamics.
This indicator tracks the Return on Investment (ROI) percentage changes across major central banks' balance sheets, providing insights into shifts in global economic liquidity not tied to cumulative figures but through ROI calculations, capturing the pulse of overall economic dynamics.
Key Enhancements:
ROI Period Customization: Users can now adjust the ROI calculation period, offering flexibility to analyze short-term fluctuations or longer-term trends in central bank activities, aligning with their strategic time horizons.
Chart Offset Feature: This new functionality allows traders to shift the chart view, aiding in the alignment of data visualization with other indicators or specific analysis needs, enhancing interpretive clarity.
Central Bank Selection: With options to include or exclude data from specific central banks among the world's top 15 economies (with the exception of Mexico and the consolidation of the EU's central bank data), traders can tailor the analysis to their regional focus or diversification strategies.
US M2 Option: Recognizing the significance of the M2 money supply as a liquidity metric, this indicator offers an alternative view focusing solely on the US M2, allowing for a concentrated analysis of the US liquidity environment.
Comprehensive Coverage: The tool covers a wide array of central banks, including the Federal Reserve, People's Bank of China, European Central Bank, and more, ensuring a broad and inclusive perspective on global liquidity.
Visualization Enhancements: A histogram plot vividly distinguishes between positive and negative ROI changes, offering an intuitive grasp of liquidity expansions or contractions at a glance.
This indicator is a strategic tool designed for traders who seek to understand the undercurrents of market liquidity and its implications on global markets.
Whether you're assessing the impact of central bank policies, gauging economic health, or identifying investment opportunities, the "Central Banks Balance Sheets ROI% Change" indicator offers a critical lens through which to view the complex interplay of global liquidity factors.
Election Year GainsShows the yearly gains of the chart in U.S. Election years.
Use the options to turn on other years in the cycle.
For use with the 12M chart.
Will show non-sensical data with other intervals.
ATR MACD - a comparable MACD [Rise Sense]ATR MACD - a comparable MACD 是一位名为tonyblackwhite在知乎上发表的关于MACD的文章启发下制作的指标。这个指标克服了MACD在多个方面的痛点,例如时间变化、跨市场对比和MACD动量生命周期等问题。通过在基础上引入新功能,该指标不仅解决了这些问题,还使用户能够更轻松地比较不同时间级别和商品。
这一创新不仅提高了MACD的使用体验,而且为用户提供更便捷的获取所需信息的途径。通过解决原有MACD存在的限制,ATR MACD - a comparable MACD 为使用者提供了更为全面和灵活的分析工具,有望在MACD的应用中发挥更大的作用。
ATR MACD - a comparable MACD is an indicator created after reading an article on MACD by the author tonyblackwhite on Zhihu. This indicator overcomes various pain points of MACD, such as the MACD time change issue, cross-market MACD issue, MACD momentum lifecycle issue, and more. Building upon this foundation, it directly incorporates features that allow for comparing different timeframes and commodities, aiming to enhance users' experience in utilizing MACD and helping them effortlessly obtain desired information.
This innovation not only improves the user experience with MACD but also provides a more user-friendly way for users to compare different timeframes and commodities. By addressing the limitations of the original MACD, ATR MACD - a comparable MACD offers users a more comprehensive and flexible analytical tool, potentially playing a greater role in the application of MACD.
Gains CorrelationsScript Description: This script is to tie the major futures indexes together at a macro level with the normal relationships (i.e. 10YR Yield, DXY, VIX inversely related to Equities) and determine how strong the correlation is between them using a 20 period average. For example, a move up in the 10YR yield while having a strong inverse covariance with equities should signal a downward move for equities. In addition, if ES and NQ are going down, and the Dow and RTY have a strong covariance, the probability of them going down as well is strong. Overall, it's a macro indicator on broad market movements.
Originality & Usefulness: The script functions by tying 7 major indexes together using correlation strength relative to the currently selected ticker. The user can change the tickers and also invert if needed. This is different from the single correlation script by adding in several as they track in tandem. The chart used is to illustrate periods where correlations are tight with equities and the lines are clustered towards the top range of strong covariance. It also highlights when Equities are far out of line with others like gold (GC). A loose covariance would mean the relationship is weak and this indicator would show a divergence in price action between them. The overall intent is to show that most indexes rise and fall together but sometimes they move faster together.
Ichimoku BalaIndicator Overview
The Ichimoku Bala indicator is a modification of the traditional Ichimoku Kinko Hyo indicator that aims to improve its effectiveness in identifying trend reversals and potential trading opportunities. It incorporates additional lines, such as the Senkou Span B--0 line, to provide more nuanced insights into price movements.
Input Parameters
The indicator has several input parameters that allow you to customize its appearance and behavior:
enableReplay: Whether to enable replay mode, which allows you to analyze historical data.
i_date: The date to start replaying historical data.
chiko2: The period for the Chikou Span 78 line.
TenkanShift: The offset for the Tenkan-Sen line.
KinjunShift: The offset for the Kinjun-Sen line.
KumoShift: The offset for the Kumo (Senkou Span A and Senkou Span B) lines.
ChikouSpanShift: The offset for the Chikou Span line.
TenkanPeriods: The period for the Tenkan-Sen line.
KinjunPeriods: The period for the Kinjun-Sen line.
SenkouSpanBPeriods: The period for the Senkou Span B line.
senkouSpanBPeriod: The period for the Senkou Span B--0 line.
AddbasePeriods1: The period for the Direction Line.
DirectionLineShift: The offset for the Direction Line.
AddbasePeriods2: The period for the Quality Line.
QualityLineShift: The offset for the Quality Line.
offset_colour_candle: The offset for coloring the previous candle before the flat start.
Indicator Calculations
The indicator calculates the following lines:
TenkanSen: A moving average of the highest and lowest prices over 9 periods.
KinjunSen: A moving average of the Tenkan-Sen line over 26 periods.
Senkou Span A: The average of the Tenkan-Sen and Kinjun-Sen lines shifted 26 periods forward.
Senkou Span B: The average of the highest and lowest prices over 52 periods shifted 26 periods forward.
Senkou Span B--0: The average of the highest and lowest prices over 52 periods.
It also determines the flatness of the Tenkan-Sen, Kinjun-Sen, and Senkou Span B lines and identifies the start of a flat period.
Indicator Visualizations
The indicator plots the following lines:
TenkanSen: A blue line.
KinjunSen: A red line.
Chikou Span: A green line shifted one period forward.
Senkou Span A: A green line.
Senkou Span B: A red line.
Senkou Span B--0: A gray line.
Direction Line: A blue line.
Quality Line: A red line.
It also colors the previous candle before the flat start according to the type of flat detected:
candleColor: Purple for a flat involving the Tenkan-Sen and Kinjun-Sen lines.
candleColor2: Yellow for a flat involving the Senkou Span B line.
candleColor3: Gray for a flat involving all three lines.
Modifications by Seyedbala
The provided code includes additional modifications by Seyedbala, including:
Adding a parameter offset_colour_candle to control the offset for coloring the previous candle before the flat start.
Modifying the color of the fill between the Tenkan-Sen and Kinjun-Sen lines to #23dde0 for flatStart and color.purple for all other cases.
Modifying the color of the fill between the Senkou Span B line and Kinjun-Sen lines to yellow for flatStart2 and color.yellow for all other cases.
Modifying the color of the fill between the Tenkan-Sen and Senkou Span B lines to gray for flatStart3 and color.gray for all other cases.
These modifications aim to enhance the visual representation of the flat areas and make it easier to identify the different types of flat patterns.
Overall, the Ichimoku Bala indicator is a valuable tool for analyzing price movements and identifying potential trading opportunities. Its modifications by Seyedbala further enhance its capabilities and provide more nuanced insights into market trends.
Sessions [TradingFinder] New York, London, Tokyo & Sydney ForexTiming is one of the influential factors in a trader's position. This indicator categorizes transactions into three sessions (Asia, Europe, and America). Five significant trading cities (New York, London, Frankfurt, Tokyo, and Sydney) are selectable.
I recommend using the tool on a 5-minute time frame, but it is usable on all time frames.
Settings:
• Trading sessions: Display or hide each trading session as needed.
• Color: Change the color of each box.
• Session time intervals: The default is based on the main working hours for each time interval and can be adjusted.
• Information table: Delete or display additional information table.
Information Table:
• Trading sessions
• Opening and closing times of each trading session
How to Use:
Initiating trading sessions involves entering with increased liquidity, and the market usually experiences significant movements. Many trading strategies are based on "time" and "session openings." This tool empowers traders to focus intensely on each time interval.
These trading sessions are crucial for all Forex, stock, and index traders:
The total price ceiling and floor in the Asia session (Tokyo and Sydney) are crucial for traders in the European session.
The European session starts with Frankfurt, and an hour later, London begins, collectively forming the European session.
The dashboard provides additional information, displaying hours based on UTC.
Customization options are considered in all sections so that everyone can apply their own settings.
Important: Default times are the most accurate for each region, and in most indicators, this time is not correctly selected. Therefore, the level of influence and time intervals are specified at the beginning of each session. If you are using another indicator, match its default time to the announced time and share the results with me in the comments.
Crypto USD LiquidityThe "Crypto USD Liquidity " indicator is designed to offer a comprehensive analysis of liquidity dynamics within the cryptocurrency market, specifically focusing on various stablecoins. This versatile tool allows users to tailor their analysis by adjusting key parameters such as the Rate of Change (ROC) length and the smoothing rate.
The indicator incorporates a user-friendly interface with options to selectively display the supply data for major stablecoins, including USDT, BUSD, USDC, DAI, and TUSD . Users can toggle these options to observe and compare the liquidity trends of different stablecoin assets.
The total liquidity is computed as the summation of the selected stablecoin supplies, providing a holistic view of the overall crypto market liquidity. The Rate of Change (ROC) and its smoothing are then applied to the aggregated liquidity data. This process helps users identify trends and potential turning points in the liquidity landscape.
The visual representation on the chart includes a color-coded display: positive changing ROC values are shaded in green, indicating potential increases in liquidity, while negative values are shaded in red, suggesting potential decreases. This color scheme enhances the user's ability to quickly interpret the changing dynamics of stablecoin liquidity.
Moreover, the script includes a Zero Line for reference and overlays the raw ROC values for additional insight. The resulting chart not only serves as a powerful analytical tool for traders and investors but also contributes to a deeper understanding of the nuanced movements within the broader cryptocurrency market.
In summary, the "Crypto USD Liquidity" Pine Script indicator empowers users with a customizable and visually informative tool for analyzing and interpreting the complex dynamics of stablecoin liquidity, facilitating more informed decision-making in the realm of cryptocurrency trading and investment.
Cycles 90mThe cycles are separated by vertical lines. The first cycle (Q1) is marked with a red line because it is a manipulative cycle where you should not open positions. Other cycles are green (Q2, Q3, Q4).
You can add the time of the current candle, its size and position on the chart in the settings
The time is highlighted in red in the timeframes 9:30-9:40, 10:00-10:10, 11:00-11:30, 15:30-15:40, 16:00-16:10, 17:00-17:10, 17:30-17:40, as price movements are most often expected during these timeframes.
The cycle lines automatically disappear if you open a timeframe above M15
Cast ForwardThis indicator will not forecast price action. It will not predict price movement nor will it in any way predict the outcome of any trade you may take. This is not a signal for buying or selling. You must do your own back testing and analysis for trading.
Time and price are the two most important components of market data. Where was price at what time? To help visualize this question I created this indicator. It allows for the previous session data to be overlayed onto the chart offset forward 24 hours. What this means is that you have the high, (high/low)/2, and low of each candle plotted on top of your chart for the time frame of the current chart, but offset so that the data from the current candle has the data from the corresponding candle 24 hours prior lined up on the x-axis.
SMA Logic: I used the SMA (Simple Moving Average) function with a length of 1 to plot the data points without any smoothing to give the true values of the data.
For Intraday Charting
For Electronic Trading Hours:
In order to line up the data correctly, for intraday charts, I used the current chart timeframe and divided it into 1380 (number of minutes in the 23 hour futures market trading day) to set the data offset. Using the same math logic, this indicator also gives the correct correlated data on the 30 second time frame. If the chart time frame that is currently being used does not allow for correct data correlation (not a factor of 1380) it will not plot the data.
For Regular Trading Hours:
In order to line up the data correctly, for intraday charts, I used the current chart timeframe and divided it into 405 (number of minutes in the 6 hour 45 minutes New York regular session trading day, including the 15 minute settlement time) to set the data offset. This indicator also gives the correct correlated data on the 30 second time frame. If the chart time frame that is currently being used does not allow for correct data correlation (not a factor of 405) it will not plot the data.
For the Daily Chart:
This indicator plots a visualization of the 20-40-60 day IPDA data range; (The IPDA data range helps traders identify liquidity, price gaps, and equilibrium points in the market, providing insights for optimal trade entries and market structure shifts). It does this using the same SMA logic as the intraday plot. What this means is it offsets the historical data of the daily chart 20, 40, or 60 bars forward. You can plot any combination of the three on the chart at one time, but these will not show on the intraday chart. This allows for visualization of where the market will possibly seek liquidity, seek to rebalance, or seek equilibrium in the future.
Live Economic Calendar by toodegrees⚠️ PLEASE READ ⚠️
Although this indicator is accurate in showcasing live and upcoming News Events, checking the original sources is always suggested. This indicator aims to save Time, but due to limitations it may not be 100% correct 100% of the Time.
Description:
The Live Economic Calendar indicator seamlessly integrates with external news sources to provide real-Time, upcoming, and past financial news directly on your Tradingview chart.
By having a clear understanding of when news are planned to be released, as well as their respective impact, analysts can prepare their weeks and days in advance. These injections of volatility can be harnessed by analysts to support their thesis, or may want to be avoided to ensure higher probability market conditions. Fundamentals and news releases transcend the boundaries of technical analysis, as their effects are difficult to predict or estimate.
Designed for both novice and experienced traders, the Live Economic Calendar indicator enhances your analysis by keeping you informed of the latest and upcoming market-moving news.
This is achieved with three different visual components:
News Table: A dedicated News Table shows the Day of the Week, Date, Time of the Day, Currency, Expected Impact, and News Name for each event (in chronological order). Once a news event has occurred, or the day is over, it will be greyed out – helping to focus on the next upcoming news events.
News Lines: Vertical lines plotted in the future help analysts monitor upcoming news events; vertical lines in the past help analysts spot and backtest previous news events that already occurred.
News Labels: Color-coded news labels will plot once the news events have occurred. This not only gives analysts a minimalistic visual cue, but also retains the information of which news were released at that Time in their tooltips.
Forex Factory Calendar News Feed:
The Forex Factory Data Feed includes news events from January 2007 to the present. The data is updated daily. Please see the Technical Description below for more information.
Forex Factory provides news for all major currencies and markets:
Australia (AUD)
Canada (CAD)
Switzerland (CHF)
China (CNY)
European Union (EUR)
United Kingdom (GBP)
Japan (JPY)
New Zealand (NZD)
United States of America (USD)
Further, there are four types of news impact, defined by respective color-coding which is retained to avoid confusion:
⚪ Holiday
🟡 Low Impact
🟠 Medium Impact
🔴 High Impact
News' Time of the day data is in 24H format, and 'All Day' news are marked at Daily candle open.
⚠️ Original Release Notes ⚠️
The original release of this indicator supports the Forex Factory News Calendar in EST (New York Time). Future updates will include multiple news sources, as well as supporting different Timezones.
Given Data limitations, the Daily chart can omit some data due to the market being close on some days. This will be fixed in the future once an efficient solution is implemented.
Key Features:
Impact-Based News Filtering: Filter news items based on their expected impact (holiday, low, medium, high) to focus on the most market-critical information.
Symbol-Specific News: Automatically filter news to display only what's relevant to the currency pair or trading symbol you are analyzing.
Custom Currency News: Want to see more than the news relevant to the current symbol? Toggle which markets' news you are most interested in.
Chart History: Keep your charts clean by displaying only the drawings of Today's news, or This Week's news.
Custom Lookback: Look further back in Time by choosing a custom number of Lookback Days, allowing you to backtest and keep in mind salient news events from the past.
Line and Label Customization: Both the News Lines and Labels are highly customizable (except the colors), allowing you to make the indicator yours.
Table History: Choose whether to focus on Today's news only, or the news for This Week.
Table Customization: The table colors and position are highly customizable, allowing you to make it fit your visual preference and your layouts' aesthetic.
"Wondering how it's done? 👇"
Technical Description:
This script utilizes Pine Seeds , a service integrated with TradingView for importing custom data. This stunning feature enables users to upload and access custom End Of Day (EOD) data, which can be updated as frequently as five times daily.
This data can be imported in one of two formats:
Single Value: integer or float
Candle Data: open, high, low, close, volume
Upon encountering Pine Seeds, I recognized its potential for importing financial news events. Given that Forex Factory is a primary source of financial news in my personal analysis, integrating it into my layouts seemed like an exciting opportunity. This integration is expected to provide significant value to users looking to integrate additional news feeds all in one place.
Development Challenges:
Format Limitations: News events must be converted into numerical values for import, due to the required Pine Seeds format.
Amount of Data: With all currencies considered, the system may encounter over 40 news events in a single day.
Data Availability: The reliance on End Of Day (EOD) data means that information for the current day is displayed with a delay, and accessing future data is not possible.
Solutions:
Encoding: Each news event is encoded as an integer in the "DCHHMMITYP" format.
D = day of the week
C = currency
HHMM = Time of day
I = news impact
TYP = event ID (see Event Library A and Event Library B )
To ensure data assignment for each candle across the open, high, low, close, and volume series, the value "999" is used as a placeholder:
Importing: Utilizing the encoding system, up to five news events per day can be imported for a singular Pine Seeds custom symbol.
By creating multiple custom Pine Seeds Symbols, efficient imports of a larger number of events is then easily achievable. Nine unique symbols have been established, accommodating up to 45 news events per day.
These symbols are searchable, and accessible as " TOODEGREES_FOREX_FACTORY_SLOT_N " where N ranges from 1 to 9.
The Pine Seeds data feed appears as follows:
Uploading Schedule: To ensure analysts are informed about current and upcoming week's news, events are uploaded one week in advance.
This approach is vital for preparing for potential market impacts across various asset classes and currencies, allowing visibility of an entire week's news ahead of Time.
Data Scraping:
Unfortunately Forex Factory doesn't offer an API to fetch their news feed.
Hence an ad hoc python scraper was developed to read and save news events from January 2007 till the present leveraging Selenium. The scraper algorithm is part of a larger script responsible for scraping data, formatting data, and creating all necessary datasets.
The pseudo-code for the python script is as follows:
Read and save news event data on Forex Factory
Format day of the week, currency, Time of the day, and impact data for the Encoding
Encode and save News Event IDs – Event ID dataset is created
Format news data for Pine Seeds (roll-back date by one week, assign news to open, high, low, close, and volume values)
Create Pine Seeds Datasets
This script is ran everyday at Futures market close (16:00 EST) to update the last part of the each dataset, ensuring accuracy, and taking into account last-minute news additions or revisions.
Once the data (next week's news) is imported by the Live Economic Calendar indicator, it's immediately decoded by leveraging the Forex Factory Decoding Library , and saved into an array.
Upon a new week open, the decoded data is used to plot news events on the chart and in the news table.
See the inner workings of these processes in the Forex Factory Utility Library .
Although these libraries are specifically built for this indicator, feel free to use them to create your own scripts. Looking forward to see what the Pine Script community comes up with!
Thank you for making it this far. Enjoy!
Ciao,
toodegrees
This tool is available ONLY on the TradingView platform.
Terms and Conditions
Our charting tools are provided for informational and educational purposes only and do not constitute financial, investment, or trading advice. Our charting tools are not designed to predict market movements or provide specific recommendations. Users should be aware that past performance is not indicative of future results and should not be relied upon for making financial decisions. By using our charting tools, the user agrees that Toodegrees and the Toodegrees Team are not responsible for any decisions made based on the information provided by these charting tools. The user assumes full responsibility and liability for any actions taken and the consequences thereof, including any loss of money or investments that may occur as a result of using these products. Hence, by using these charting tools, the user accepts and acknowledges that Toodegrees and the Toodegrees Team are not liable nor responsible for any unwanted outcome that arises from the development, or the use of these charting tools. Finally, the user indemnifies Toodegrees and the Toodegrees Team from any and all liability.
By continuing to use these charting tools, the user acknowledges and agrees to the Terms and Conditions outlined in this legal disclaimer.
Sunday Vertical Lines (00:00 NY)Short Description:
Experience enhanced chart clarity with our "Sunday Midnight Vertical Lines" indicator. This tool elegantly marks every Sunday at 00:00 New York time, providing traders with a clear reference point for weekly market resets and potential strategy adjustments.
Detailed Description:
Purpose:
The "Sunday Midnight Vertical Lines" indicator is designed to help traders and market analysts visually segment their charts based on weeks. By clearly demarcating the start of each trading week, this tool aids in performing weekly analyses, understanding market rhythms, and preparing for the week ahead.
Key Features:
Automatic Time Zone Adjustment: The indicator adjusts for New York time, ensuring accuracy regardless of the user's local time zone.
Visual Clarity: Draws a distinct red vertical line at 00:00 each Sunday, offering a stark contrast against typical chart elements.
Performance Optimized: Efficiently coded to maintain chart performance, even on data-rich interfaces.
User-Friendly: No complex settings required. The tool works immediately upon addition to the chart, facilitating ease of use for traders of all skill levels.
Use Cases:
Weekly Market Analysis: Ideal for traders who conduct weekly market reviews, as it visually segments the chart at the beginning of each trading week.
Strategic Planning: Useful for planning and adjusting weekly trading strategies.
Historical Reference: Assists in historical market analysis by providing clear reference points for the start of each week.
Conclusion:
Whether you're a day trader, swing trader, or long-term investor, the "Sunday Midnight Vertical Lines" indicator is a simple yet powerful tool to enhance your chart analysis. It offers a clear, visual reference point for the start of each trading week, aiding in strategy development and market understanding.
MVRV Z-ScoreThe MVRV ratio was created by Murad Mahmudov & David Puell. It simply compares Market Cap to Realised Cap, presenting a ratio (MVRV = Market Cap / Realised Cap). The MVRV Z-Score is a later version, refining the metric by normalising the peaks and troughs of the data.
X% Drop in X Days, sold X Days afterIt identifies potential buy signals based on a specified percentage drop in price over a set number of days and calculates the total profit or loss (P/L) over a predefined period. Here's a breakdown of the script and its key parameters:
Script Description:
Indicator Name: "X% Drop in X Days, sold X Days after"
Functionality:
The script signals a buy opportunity when the price of an asset drops by a certain percentage (percentage_drop) within a specified length (length) in days.
It calculates the profit or loss percentage after a set number of days (hold_days) from the buy signal.
The script also displays the cumulative total profit or loss over a specified time frame, from a start date (start_period) to an end date (end_period), which is by default set to the current date.
Display:
Buy signals are marked on the chart.
The profit or loss for each trade after the hold period is displayed.
A label showing the total cumulative profit or loss, along with the start and end dates, is displayed on the chart.
Key Parameters:
percentage_drop (10.0% by default) : The percentage decrease in price that triggers a buy signal. It represents the threshold for the price drop to consider a buying opportunity.
length (3 days by default): The period over which the drop in price is considered. It's the timeframe used to evaluate the percentage drop.
hold_days (30 days by default) : The duration for holding the asset after the buy signal before selling. This parameter defines the time after which the profit or loss is calculated.
start_period (Set to "2022-11-21" by default): The beginning date for calculating the cumulative total profit or loss. This parameter allows the user to define a specific starting point for the analysis.
end_period (Set to the current date by default): The end date for the cumulative total profit or loss calculation. It defaults to the current date but can be set to a specific date for backtesting purposes.
Script Mechanics:
Buy Signal Logic: A buy signal is generated when the closing price is below the highest price of the last 'length' days, adjusted by the 'percentage_drop'.
Profit/Loss Calculation: For each buy signal, the script calculates the profit or loss percentage after 'hold_days' from the purchase. This is displayed on the chart for each trade.
Total P/L Display: The script calculates and displays the cumulative total profit or loss in the defined period (from 'start_period' to 'end_period') in a label on the chart.
Usage:
This script is useful for traders who follow a strategy based on buying assets after significant price drops and holding for a predetermined period. It automates the detection of potential buy opportunities and the calculation of profit or loss, aiding in decision-making and performance analysis.
Forecast: PastFluxDelta PredictionThe theory is that time periods and the conditions during these periods repeat themselves. Especially if it is the same day of the week in the past, there is a high probability that price fluctuations will roughly repeat themselves.
Eternal return (or eternal recurrence) is a philosophical concept which states that time repeats itself in an infinite loop, and that exactly the same events will continue to occur in exactly the same way, over and over again, for eternity.
History does repeat itself.
The stock market is a manifest example.
Chief market strategist at Miller Tabak + Co. Matt Maley pointed out the strong resemblance between the stock market recently and that in the past.
Various scientific studies and articles show that there could be something to this theory
Most of the investors are ignoring the parallels between stocks today and "heady" years 1929, 1999 and 2007…
Post Labor Day sees investors returning to the S&P 500 near all-time highs and some dark economic shadows lurking …
So how should we regard these inescapable results?
Nietzsche said we should embrace them, accept them, and love them. Once they stop, expect them to start again.
But remember that the future is fundamentally uncertain and that past results are by no means a guarantee of future performance.
Based on this, this indicator uses historical trading data from a year, a week or a day ago and compares price fluctuations in the past with current conditions.
"Bars to predict" can be used to indicate how far into the future the indicator is looking.
"Amount of bars to show" determines how many bars are generally displayed. A high value allows you to see how accurate the method was in the past.
Market Health MonitorThe Market Health Monitor is a comprehensive tool designed to assess and visualize the economic health of a market, providing traders with vital insights into both current and future market conditions. This script integrates a range of critical economic indicators, including unemployment rates, inflation, Federal Reserve funds rates, consumer confidence, and housing market indices, to form a robust understanding of the overall economic landscape.
Drawing on a variety of data sources, the Market Health Monitor employs moving averages over periods of 3, 12, 36, and 120 months, corresponding to quarterly, annual, three-year, and ten-year economic cycles. This selection of timeframes is specifically chosen to capture the nuances of economic movements across different phases, providing a balanced view that is sensitive to both immediate changes and long-term trends.
Key Features:
Economic Indicators Integration: The script synthesizes crucial economic data such as unemployment rates, inflation levels, and housing market trends, offering a multi-dimensional perspective on market health.
Adaptability to Market Conditions: The inclusion of both short-term and long-term moving averages allows the Market Health Monitor to adapt to varying market conditions, making it a versatile tool for different trading strategies.
Oscillator Thresholds for Recession and Growth: The script sets specific thresholds that, when crossed, indicate either potential economic downturns (recessions) or periods of growth (expansions), allowing traders to anticipate and react to changing market conditions proactively.
Color-Coded Visualization: The Market Health Monitor employs a color-coding system for ease of interpretation:
-- A red background signals unhealthy economic conditions, cautioning traders about potential risks.
-- A bright red background indicates a confirmed recession, as declared by the NBER, signaling a critical time for traders to reassess risk exposure.
-- A green background suggests a healthy market with expected economic expansion, pointing towards growth-oriented opportunities.
Comprehensive Market Analysis: By combining various economic indicators, the script offers a holistic view of the market, enabling traders to make well-informed decisions based on a thorough understanding of the economic environment.
Key Criteria and Parameters:
Economic Indicators:
Labor Market: The unemployment rate is a critical indicator of economic health.
High or rising unemployment indicates reduced consumer spending and economic stress.
Inflation: Key for understanding monetary policy and consumer purchasing power.
Persistent high inflation can lead to economic instability, while deflation can signal weak
demand.
Monetary Policy: Reflected by the Federal Reserve funds rate.
Changes in the rate can influence economic activity, borrowing costs, and investor
sentiment.
Consumer Confidence: A predictor of consumer spending and economic activity.
Reflects the public’s perception of the economy
Housing Market: The housing market often leads the economy into recession and recovery.
Weakness here can signal broader economic problems.
Market Data:
Stock Market Indices: Reflect overall investor sentiment and economic
expectations. No gains in a stock market could potentially indicate that economy is
slowing down.
Credit Conditions: Indicated by the tightness of bank lending, signaling risk
perception.
Commodity Insight:
Crude Oil Prices: A proxy for global economic activity.
Indicator Timeframe:
A default monthly timeframe is chosen to align with the release frequency of many economic indicators, offering a balanced view between timely data and avoiding too much noise from short-term fluctuations. Surely, it can be chosen by trader / analyst.
The Market Health Monitor is more than just a trading tool—it's a comprehensive economic guide. It's designed for traders who value an in-depth understanding of the economic climate. By offering insights into both current conditions and future trends, it encourages traders to navigate the markets with confidence, whether through turbulent times or in periods of growth. This tool doesn't just help you follow the market—it helps you understand it.
Whalemap [BigBeluga]The Whalemap indicator aims to spot big buying and selling activity represented as big orders for a possible bottom or top formation on the chart.
🔶 CALCULATION
The indicator uses volume to spot big volume activity represented as big orders in the market.
for i = 0 to len - 1
blV.vol += (close > close ? volume : 0)
brV.vol += (close < close ? volume : 0)
When volume exceeds its own threshold, it is a sign that volume is exceeding its normal value and is considered as a "Whale order" or "Whale activity," which is then plotted on the chart as circles.
🔶 DETAILS
The indicator plots Bubbles on the chart with different sizes indicating the buying or selling activity. The bigger the circle, the more impact it will have on the market.
On each circle is also plotted a line, and its own weight is also determined by the strength of its own circle; the bigger the circle, the bigger the line.
Old buying/selling activity can also be used for future support and resistance to spot interesting areas.
The more price enters old buying/selling activity and starts producing orders of the same direction, it might be an interesting point to take a closer look.
🔶 EXAMPLES
The chart above is showing us price reacting to big orders, finding good bottoms in price and good tops in confluence with old activity.
🔶 SETTINGS
Users will have the options to:
Filter options to adjust buying and selling sensitivity.
Display/Hide Lines
Display/Hide Bubbles
Choose which orders to display (from smallest to biggest)
Rotation Cycles GraphRotation Cycles Graph Indicator
Overview:
The Rotation Cycles Graph Indicator is designed to visualize rotation cycles in financial markets. It aims to provide insights into shifts between various market phases, including growth, weakening, recovery, and contraction, allowing traders to potentially identify changing market dynamics.
Key Components:
Z-Score Calculation:
The indicator employs Z-score calculation to normalize data and identify deviations from the mean. This is instrumental in understanding the current state of the market relative to its historical behavior.
Ehlers Loop Visualization:
The Ehlers Loop function generates a visual representation of rotation cycles. It utilizes x and y coordinates on the chart to represent market conditions. These coordinates determine the position and categorization of the market state.
Table Visualization:
At the bottom of the chart, a table categorizes market conditions based on x and y values. This table serves as a reference to understand the current market phase.
Customizable Parameters:
The indicator offers users the flexibility to adjust several parameters:
Length and Smoothness: Users can set the length and smoothness parameters for the Z-score calculation, allowing for customization based on the market's volatility.
Graph Settings: Parameters such as bar scale, graph position, and the length of the tail for visualization can be fine-tuned to suit individual preferences.
Understanding Coordinates:
The x and y coordinates plotted on the chart represent specific market conditions. Interpretation of these coordinates aids in recognizing shifts in market behavior.
This screenshot shows visual representation behind logic of X and Y and their rotation cycles
Here is an example how rotation marker moved from growing to weakening and to the contraction quad, during a big market crush:
Note:
This indicator is a visualization tool and should be used in conjunction with other analytical methods for comprehensive market analysis.
Understanding the context and nuances of market dynamics is essential for accurate interpretation of the Rotation Cycles Graph Indicator.
Big thanks to @PineCodersTASC for their indicator, what I used as a reference
ka66: Enhanced MACDThis is a more configurable MACD:
Allows various moving averages (EMA, SMA, Hull, WMA) instead of just EMA.
Better color coding for MACD line, rising vs. falling
Optional Normalised Scale; my pet peeve with standard MACD, that we can't really easily compare it across instruments. Taking a page from the ATR Percent indicator, we allow for normalising the MACD and Signal lines relative to Close: MACD / Close x 100. Ditto for the Signal line. This is really useful for reversal type scenarios, and to avoid ranging markets.
Threshold horizontal line markers to further support the use of the Normalised Scale. Simply configure this via the Style Settings.
Period SeparatorA useful indicator designed to display vertical line separators at specified periods, for example every hour or every 4 hours.
To use this indicator, you must be in a timeframe lower than the specified timeframe on the indicator.
I haven't found any other scripts that allow for custom time frames so I created my own :)
Let me know if you have any suggestions.