MTF Stationary Extreme IndicatorThe Multiple Timeframe Stationary Extreme Indicator is designed to help traders identify extreme price movements across different timeframes. By analyzing extremes in price action, this indicator aims to provide valuable insights into potential overbought and oversold conditions, offering opportunities for trading decisions.
The indicator operates by calculating the difference between the latest high/low and the high/low a specified number of periods back. This difference is expressed as a percentage, allowing for easy comparison and interpretation. Positive values indicate an increase in the extreme, while negative values suggest a decrease.
One of the unique features of this indicator is its ability to incorporate multiple timeframes. Traders can choose a higher timeframe to analyze alongside the current timeframe, providing a broader perspective on market dynamics. This feature enables a comprehensive assessment of extreme price movements, considering both short-term and longer-term trends.
By observing extreme movements on different timeframes, traders can gain deeper insights into market conditions. This can help in identifying potential areas of confluence or divergence, supporting more informed trading decisions. For example, when extreme movements align across multiple timeframes, it may indicate a higher probability of a significant price reversal or continuation.
To use the Multiple Timeframe Stationary Extreme Indicator effectively, traders should consider a few key points:
- Choose the Timeframes : Select the appropriate timeframes based on your trading strategy and objectives. The current timeframe represents the focus of your analysis, while the higher timeframe provides a broader context. Ensure the chosen timeframes align with your trading style and the asset you are trading.
- Interpret Extreme Movements : Pay attention to extreme movements that breach certain levels. Values above zero indicate a rise in the extreme, potentially signaling overbought conditions. Conversely, values below zero suggest a decrease, potentially indicating oversold conditions. Use these extreme movements as potential entry or exit signals, in conjunction with other indicators or confirmation signals.
- Validate with Price Action : Confirm the extreme movements observed on the indicator with price action. Look for confluence between the indicator's extreme levels and key support or resistance levels, trendlines, or chart patterns. This can provide added confirmation and increase the reliability of the signals generated by the indicator.
- Consider Volatility Filters : The indicator can be enhanced by incorporating volatility filters. By adjusting the sensitivity of the extreme differences calculation based on market volatility, traders can adapt the indicator to different market conditions. Higher volatility may require a longer lookback period, while lower volatility may call for a shorter one. Experiment with volatility filters to fine-tune the indicator's performance.
- Combine with Other Analysis Techniques : The Multiple Timeframe Stationary Extreme Indicator is most effective when used as part of a comprehensive trading strategy. Combine it with other technical analysis tools, such as trend indicators, oscillators, or chart patterns, to form a well-rounded approach. Consider risk management techniques and money management principles to optimize your trading strategy.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Remember that trading indicators, including the Multiple Timeframe Stationary Extreme Indicator, should not be used in isolation. They serve as tools to assist in decision-making, but they require proper context, analysis, and confirmation. Always conduct thorough analysis and consider market conditions, news events, and other relevant factors before making trading decisions.
It's recommended to backtest the indicator on historical data to assess its performance and effectiveness for your trading approach. This will help you understand its strengths and limitations, allowing you to refine and optimize your usage of the indicator.
Statistics
Correlation Coefficient - DXY & XAUPublishing my first indicator on TradingView. Essentially a modification of the Correlation Coefficient indicator, that displays a 2 ticker symbols' correlation coefficient vs, the chart presently loaded.. You can modify the symbols, but the default uses DXY and XAU, which have been displaying strong negative correlation.
As with the built-in CC (Correlation Coefficient) indicator, readings are taken the same way:
Positive Correlation = anything above 0 | stronger as it moves up towards 1 | weaker as it moves back down towards 0
Negative Correlation = anything below 0 | stronger moving down towards -1 | weaker moving back up towards 0
This is primarily created to work with the Bitcoin weekly chart, for comparing DXY and Gold (XAU) price correlations (in advance, when possible). If you change the chart timeframe to something other than weekly, consider playing with the Length input, which is set to 35 by default where I think it best represents correlations with Bitcoin's weekly timeframe for DXY and Gold.
The intention is that you might be able to determine future direction of Bitcoin based on positive or negative correlations of Gold and/or the US Dollar Index. DXY has been making peaks and valleys prior to Bitcoin since after March 2020 black swan event, where it peaked just after instead. In the future, it may flip over again and Bitcoin may hit major highs or lows prior to DXY, again. So, keep an eye on the charts for all 3, as well as the indicator correlations.
Currently, we've moved back into negative correlation between Bitcoin and DXY, and positive correlation with Bitcoin and Gold:
Negative Correlation b/w Bitcoin and DXY - if DXY moves up, Bitcoin likely moves down, or if DXY moves down, Bitcoin likely moves up (or if Bitcoin were to move first before DXY, as it did on March 2020, instead)
Positive Correlation b/w Bitcoin and Gold - Bitcoin and Gold will likely move up or down with each other.
DXY is represented by the green histogram and label, Gold is represented by the yellow histogram and label. Again, you can modify the tickers you want to check against, and you can modify the colors for their histograms / labels.
The inspiration from came from noticing areas of same date or delayed negative correlation between Bitcoin and DXY, here is one of my most recent posts about that:
Please let me know if you have any questions, or would like to see updates to the indicator to make it easier to use or add more useful features to it.
I hope this becomes useful to you in some way. Thank you for your support!
Cheers,
dudebruhwhoa :)
MA Correlation CoefficientThis script helps you visualize the correlation between the price of an asset and 4 moving averages of your choice. This indicator can help you identify trendy markets as well as trend-shifts.
Disclaimer
Bear in mind that there is always some lag when using Moving-Averages, hence the purpose of this indicator is as a trend identification tool rather than an entry-exit strategy.
Working Principle
The basic idea behind this indicator is the following:
In a trendy market you will find high correlation between price and all kinds of Moving-Averages. This works both ways, no matter bull or bear trend.
In sideways markets you might find a mix of correlations accross timeframes (2018) or high correlation with Low-Timeframe averages and low correlation with High-Timeframe averages (2021/2022).
Trend shifts might be characterised by a 'staircase' type of correlation (yellow), where the asset regains correlation with higher timeframe averages
Indicator Options
1. Source : data used for indicator calculation
1. Correlation Window : size of moving window for correlation calculation
2. Average Type :
Simple-Moving-Average (SMA)
Exponential-Moving-Average (EMA)
Hull-Moving-Average (HMA)
Volume-Weighted-Moving-Average (VWMA)
3. Lookback : number of past candles to calculate average
4. Gradient : modify gradient colors. colors relate to correlation values.
Plot Explanation
The indicator plots, using colors, the correlation of the asset with 4 averages. For every candle, 4 correlation values are generated, corresponding to 4 colors. These 4 colors are stacked one on top of the other generating the patterns explained above. These patterns may help you identify what kind of market you're in.
mrD-Smart RangesmrD-Smart Ranges aims to offer a complete strategy based on Order Blocks. Ranges signals based on order volume are highlighted, from which smart ranges are suggested to provide potential entries.
This script also includes warnings for each signal marked.
🔶 SETTINGS
Pair Strategy: Select the desired from the list. Change the chart to the one specified in the Strategy.
Current TF Order Blocks: Allows the user to select how many most recent Internal Order Blocks appear in the current time frame on the chart.
Order Block Filter: Allows the user to select how the script mitigates an Order Block.
Hide Overlap: Allows the user to display overlapping Order Blocks.
Show Metrics: Allows the user to display volume % metrics within the Order Blocks.
Show Volume Box: Allows the user to display buy/sell activity within Order Blocks.
High Timeframe: Allows the user to choose a higher or lower timeframe to find the Signals.
Show Failed Buy Sell: Allows the user to display the Signals.
Show HTF Box: Allows the user to display a higher or lower timeframe Order Blocks.
🔶 DETAILS
Order blocks are formed after a slight bearish order block, these can provide an opportunity to change polarity, thus acting as a potential support/resistance level.
A retest/retrace on the order block, combined with order volume between the current timeframe and from the higher timeframe will establish the conditions for smart ranges are suggested to provide potential entries.
🔶 USAGE
mrD-Smart Ranges aims to provide users with a minimalistic screen next to the optimal ranges to keep in mind to find trading setups as shown below.
Here we can see a suggested Sell range and display a label to confirm this range
Signal(s) that can be used for potential entries only during range retest are order blocks.
Users can search for more potential entry ranges based on larger timeframes in the settings: High Timeframe
In the image above, we can see that the price has generated potential orange and bearish entry signals. A confirmation signal with a red label is displayed on the chart when the price retests the Sell range.
Note: While range retests can still work well if they occur later in price action, it's best to look for signals only when price retests the range at the outset rather than retesting it. second price.
The logic of generating signal ranges using different rules is described below:
- Define order blocks in the current timeframe.
- Define the order blocks with the largest volume in the current timeframe.
- Define order blocks in larger timeframes in High Timeframe settings
- Define order blocks with the largest volume in larger timeframes in High Timeframe settings
Entry Range: The combination of the highest volume order blocks in the current timeframe and the highest volume order blocks in the larger timeframe.
🔶General disclaimer:
Trading stocks, futures, forex, options, ETFs, cryptocurrency, or any other financial instrument has huge potential rewards and risks.
You must be aware of the risks and willing to accept them to invest in stocks, futures, forex, options, ETFs, or cryptocurrencies.
Don't trade with money you can't afford to lose.
This is not an offer or an offer to Buy/Sell stocks, futures, Forex, options, ETFs, cryptocurrencies, or any other financial instrument.
Do not represent that any account will or is likely to achieve profit or loss of any kind.
The past performance of any trading system or method is not necessarily indicative of future results.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Session KillZones [7Bridges]Session Killzones by 7Bridges indicator display the killzones of asian, LND and NY sessions. There is also a custom session of your choice.
The times of each killzone are GMT time and you can adjust it in the settings.
You have also the beginning of the day, GMT and EST timezones.
By default the killzones are set like that on the GMT/UTC timezone :
-> Asia : 00:00 - 06:00
-> Pre London : 06:00 - 07:00
-> London : 07:00 - 10:00
-> New York : 12:00 - 15:00
-> Custom session : choose your own time
What makes the indicator very different is that the session is not overlapping the price but you have bars below and above the price.
Settings:
-> you can chose to display the Killzones (Asia, pre LND, LND and NY)
-> you can manages the time of the sessions
-> you can chose to display the start of the day (GMT/UTC and EST )
The indicator is displayed by default only for all the timeframes below 60min.
Index Strength Strategy with Signal Using the Index Strength Strategy Indicator for Trading
Introduction:
In this article, we'll explore the Index Strength Strategy Indicator and how it can be used for trading. The Index Strength Strategy Indicator is a technical analysis tool designed to help traders identify trends, determine trend strength, and generate buy and sell signals.
Overview of the Index Strength Strategy Indicator:
The Index Strength Strategy Indicator is based on two moving averages - a fast moving average and a slow moving average - and the Relative Strength Index (RSI). The fast and slow moving averages are used to determine the trend direction, while the RSI is used to calculate the trend strength. The indicator assigns a strength score to the current trend, which is then classified into one of four categories - Very Weak, Weak, Strong, or Very Strong. Traders can use this information to identify the strength of the trend and adjust their trading strategy accordingly.
The indicator also generates buy and sell signals based on a user-defined threshold level. When the strength score crosses above the threshold level, a buy signal is generated, and when the strength score crosses below the threshold level, a sell signal is generated.
Using the Index Strength Strategy Indicator for Trading:
Traders can use the Index Strength Strategy Indicator to identify trends, determine trend strength, and generate buy and sell signals. To use the indicator, traders should first determine the appropriate fast and slow moving average periods and the strength threshold level for their trading style. These input parameters can be adjusted in the indicator's settings.
Once the indicator is added to the chart, traders can use the strength score and trend direction to identify potential trading opportunities. If the trend is classified as Strong or Very Strong, traders may look for opportunities to enter long or short positions in the direction of the trend. If the trend is classified as Very Weak or Weak, traders may look for opportunities to exit or avoid positions.
Traders can also use the buy and sell signals generated by the indicator to enter or exit positions. When a buy signal is generated, traders can enter a long position, and when a sell signal is generated, traders can enter a short position. Traders should set stop-loss and take-profit levels based on their risk management strategy.
Avoiding Mistakes:
To avoid mistakes when using the Index Strength Strategy Indicator, traders should keep the following tips in mind:
Don't rely solely on the indicator - it should be used in conjunction with other technical analysis tools and fundamental analysis.
Use appropriate risk management strategies, including setting stop-loss and take-profit levels.
Adjust the input parameters of the indicator to match your trading style and preferences.
Avoid overtrading and chasing trades - wait for the right opportunities to enter or exit positions.
Trading Strategy Test Results: Time Frame Tested for 15 Mins
To provide an idea of the potential performance of the Index Strength Strategy Indicator, let's look at some recent test results for two popular indices - Bank Nifty and Nifty 50.
From 1-May-2023 to 12-May-2023, using 2 lots of Bank Nifty with the Index Strength Strategy Indicator, a profit of 15,175 was achieved, with a percentage profitable trade rate of 80% and a profit factor of 3.395. The maximum drawdown was 7,000, and the average trade was 3,035.
During the same time period, using 1 lot of Nifty 50 with the Index Strength Strategy Indicator, a profit of 8,187 was achieved
Conclusion:
The Index Strength Strategy Indicator is a useful tool for traders to identify trends, determine trend strength, and generate buy and sell signals. Traders can use the indicator in conjunction with other technical analysis tools and fundamental analysis to make informed trading decisions. By following proper risk management strategies and avoiding common mistakes, traders can use the indicator to improve their trading performance.
Variance WindowsJust a quick trial at using statistical variance/standard deviation as an indicator. The general idea is that higher variance in the short term tends to indicate more volatility/movement. The other thing is that it can help set probabilistic boundaries for movements (e.g., if you set the bars to be 2 standard deviations, you are visualizing a range that denotes a 95% probability window).
I haven't really tried forming any sort of strategies around this indicator, but there are a few potential possibilities for its usability.
Generally speaking, the magnitude of the standard deviation (relative to the price) is small when the market is consolidating. It is larger when the market is trending up or own.
If the long term variance and the short-term variance are close to each other in scale, the trend is strong. Otherwise, the trend is weak. Note that I am only saying that the "trend" is strong , not that it is necessarily positive. this could be an up-trend, down-trend, or a sideways trend.
When the magnitudes of the variances are changing from very similar to very different (usually it's the long-term variance getting much larger than the short-term one), that's an indication that the previous trend is coming to an end.
Typically, it's the long-term variance that is bigger than the short-term. However, when you see them cross where the short-term is bigger or even much bigger than the long-term, it's indicative of a spike event (more often than not, one that is not favorable if you are holding any position on a given security).
Because you have probabilistic windows based on some n standard deviations from the midline (which in this version, I've used a ZLEMA as that midline), those boundaries could possibly be used to set stop-loss limits and the like.
There's nothing too complicated or deep about this particular indicator. All I'm really doing is assuming that we are dealing with a Gaussian random process. I am actually using EMA as my mean computation, even though for a proper Gaussian variance calculation, I should be using SMA. When I used SMA, though, it felt a lot more sensitive to noise, which made it feel less usable. In any case, it's just a simple first trial in many years after not having even looked at Pine Script to finally messing around with it again. Open to a litany of criticisms as I'm sure there will be many that are rightly deserved. Otherwise, happy scalping to thee.
Crypto Correlation MatrixA crypto correlation matrix or table is a tool that displays the correlation between different cryptocurrencies and other financial assets. The matrix provides an overview of the degree to which various cryptocurrencies move in tandem or independently of each other. Each cell represents the correlation between the row and column assets respectively.
The correlation matrix can be useful for traders and investors in several ways:
First, it allows them to identify trends and patterns in the behavior of different cryptocurrencies. By looking at the correlations between different assets, traders can gain insight into the intra-relationships of the crypto market and make more informed trading decisions. For example, if two cryptocurrencies have a high positive correlation, meaning that they tend to move in the same direction, a trader may want to diversify their portfolio by choosing to invest in only one of the two assets.
Additionally, the correlation matrix can help traders and investors to manage risk. By analyzing the correlations between different assets, traders can identify opportunities to hedge their positions or limit their exposure to particular risks. For example, if a trader holds a portfolio of cryptocurrencies that are highly correlated with each other, they may be at greater risk of losses if the market moves against them. By diversifying their portfolio with assets that are less correlated with each other, they can reduce their overall risk.
Some of the unique properties for this specific script are the correlation strength levels in conjunction with the color gradient of cells, intended for clearer readability.
Features:
Supports up to 64 different crypto assets.
Dark/Light mode.
Correlation strength levels and cell coloring.
Adjustable positioning on the chart.
Alerts at the close of a bar. (Daily timeframe or higher recommended)
market sessions by sellstreetIndicator of trading sessions:
Indicator created to track the opening of trading sessions:
Asia, Frankfurt, London, New York.
Tracking the opening of these key levels
- Day Opening (DO), Week Opening (WO), Month Opening (MO).
- New York (NYM) openings display.
- Highs and lows of the previous day (PDH/PDL).
- Day of the week display.
- Formation of the Сentral Bank Dealers Range (CBDR).
Indicator settings.
The open source code will help traders to understand the technical part of the script.
Flexible visual and technical setup of the indicator:
- Ability to enable/disable the display of trading sessions on the history.
- Enabling/disabling the display of the key opening levels on the chart history for a convenient backtest.
- Automatically switch to summer/winter time.
To use this indicator, add it to your favorites after the chart
TradingView must be overloaded to work correctly.
Reverse Repo CorrelationReverse Repo Correlation Indicator
This TradingView indicator calculates the correlation between the current stock's close price and the value of the Reverse Repo Rate (`RRPONTSYD`). It uses the Pearson correlation coefficient to measure the strength and direction of the relationship.
Inputs
- **Correlation Length**: The number of bars used to calculate the correlation.
- **Background Transparency**: The transparency level (0-100) for the background color indicating positive or negative correlation.
### How it works
1. The indicator retrieves the close price of the current stock and assigns it to the `stockClose` variable.
2. The **Correlation Length** input determines the number of bars used to calculate the correlation.
3. The `pearson_corr` function calculates the Pearson correlation between the `stockClose` and `rrpontsydValue` variables over the specified length.
4. The `rrpontsydValue` is retrieved using the `request.economic` function, which fetches the Reverse Repo Rate value (`RRPONTSYD`) for the "US" economic calendar.
5. The correlation value is plotted on the chart as a line, with positive correlations displayed in green and negative correlations in red.
6. The **Background Transparency** input determines the transparency level of the background color, which changes based on the correlation value. Positive correlations have a green background, while negative correlations have a red background.
Adjust the `correlationLength` and `transparency` inputs as needed.
BNF Fri to Thu MovesSimple script which calculates how much bank nifty moved From Friday 10:00 AM till Thursday 3:00 PM. it shows how much point it moved. This will help traders create strategies more efficiently.
Cross Period Comparison IndicatorReally excited to be sharing this indicator!
This is the cross-period comparison indicator, AKA the comparison indicator.
What does it do?
The cross-period comparison indicator permits for the qualitative assessment of two points in time on a particular equity.
What is its use?
At first, I was looking for a way to determine the degree of similarity between two points, such as using Cosine similarity values, Euclidean distances, etc. However, these tend to trigger a lot of similarities but without really any context. Context matters in trading and thus what I wanted really was a qualitative assessment tool to see what exactly was happening at two points in time (i.e. How many buyers were there? What was short interest like? What was volume like? What was the volatility like? RSI? Etc.)
This indicator permits that qualitative assessment, displaying things like total buying volume during each period, total selling volume, short interest via Put to Call ratio activity, technical information such as Stochastics and RSI, etc.
How to use it?
The indicator is fairly self explanatory, but some things require a little more in-depth discussion.
The indicator will display the Max and Min technical values of a period, as well as a breakdown in the volume information and put to call information. The user can then make the qualitative determination of degrees of similarity. However, I have included some key things to help ascertain similarity in a more quantitative way. These include:
1. Adding average period Z-Score
2. Adding CDF probability distributions for each respective period
3. Adding Pearson correlations for each respective period over time
4. Providing the linear regression equation for each period
So let us discuss these 4 quantitative measures a bit more in-depth.
Adding Period Z-Score
For those who do not know, Z-Score is a measure of the distance from a mean. It generally spans 0 (at the mean) to 3 (3 standard deviations away from the mean). Z-Score in the stock market is very powerful because it is actually our indicator of volatility. Z-Score forms the basis of IV for option traders and it generally is the go to, to see where the market is in relation to its overall mean.
Adding Z-Score lets the user make 2 big determinations. First and foremost, it’s a measure of overall volatility during the period. If you are getting a Z-Score that is crazy high (1.5 or greater), you know there was a lot of volatility in that period marked by frequent deviations from its mean (since on average it was trading 1.5 standard deviations away from its mean).
The other thing it tells you is the overall sentiment of that time. If the average Z Score was 1.5 for example, we know that buying interest was high and the sentiment was somewhat optimistic, as the stock was trading, on average, + 1.5 SDs away from its mean.
If, on the other hand, the average was, say, - 1.2, then we know the sentiment was overall pessimistic. There was frequent selling and the stock was frequently being pushed below its mean with heavy selling pressure.
We can also check these assumptions of buying / selling buy verifying the volume information. The indicator will list the Buy to Sell Ratio (number of Buyers to Sellers), as well as the total selling volume and total buying volume. Thus, the user can see, objectively, whether sellers or buyers led a particular period.
Adding CDF Probability
CDF probabilities simply mean the extent a stock traded above or below its normal distribution levels.
To help you understand this, the indicator lists the average close price for a period. Directly below that, it lists the CDF probabilities. What this is telling you, is how often and how likely, during that period, the stock was trading below its average. For example, in the main chart, the average close price for BTC in Period A is 29869. The CDF probability is 0.51. This means, during Period A, 51% of the time, BTC was trading BELOW 29869. Thus, the other 49% of the time it was trading ABOVE 29869.
CDF probabilities also help us to assess volatility, similar to Z-Score. Generally speaking, the CDF should consistently be reading about 0.50 to 0.51. This is the point of an average value, half the values should be above the average and half the values should be below. But in times of heightened volatility, you may actually see the CDF creep up to 0.54 or higher, or 0.48 or lower. This means that there was extremely extensive volatility and is very indicative of true “whipsaw” type price action history where a stock refuses to average itself out in one general area and frequently jumps up and down.
Adding Pearson Correlation
Most know what this is, but just in case, the Pearson correlation is a measure of statistical significance. It ranges from 0 (not significant) to 1 (very significant). It can be positive or negative. A positive signifies a positive relationship (i.e. as one value increases so too does the other value being compared). If it is a negative value, it means an inverse relationship (i.e. one value increases proportionately to the other’s decline).
In this indicator, the Pearson correlation is measured against time. A strong positive relationship (a value of 0.5 or greater) indicates that the stock is trading positive to time. As time goes by, the stock goes up. This is a normal relationship and signifies a healthy uptrend.
Inversely, if the Pearson correlation is negative, it means that as time increases, the stock is going down proportionately. This signifies a strong downtrend.
This is another way for the user to interpret sentiment during a specific period.
IF the Pearson correlation is less than 0.5 or -0.5, this signifies an area of indecision. No real trend formed and there was no real strong relationship to time.
Adding Linear Regression Equation
A linear regression equation is simply the slope and the intercept. It is expressed with the formula y= mx + b.
The indicator does a regression analysis on each period and presents this formula accordingly. The user can see the slope and intercept.
Generally speaking, when two periods share the same slope (m value) but different intercept (b value), it can be said that the relationship to time is identical but the starting point is different.
If the slope and intercept are different, as you see in the BTC chart above, it represents a completely different relationship to time and trajectory.
Indicator Specific Information:
The indicator retains the customizability you would expect. You can customize all of your lengths for technical, change and Z-Score. You can toggle on or off Period data, if you want to focus on a single period. You can also toggle on a difference table that directly compares the % difference between Period A to Period B (see image below):
You will also see on the input menu a input for “Threshold” assessments. This simply modifies the threshold parameters for the technical readings. It is defaulted to 3, which means when two technical (for example Max Stochastics) are within +/- 3 of each other, the indicator will light these up as green to indicate similarities. They just clue the user visually to areas where there are similarities amongst the qualitative technical data.
Timeframes
This is best used on the daily timeframe. You can use it on the smaller timeframe but the processing time may take a bit longer. I personally like it for the Daily, Weekly and 4 hour charts.
And this is the indicator in a nutshell!
I will provide a tutorial video in the coming day on how to use it, so check back later!
As always, leave your comments/questions and suggestions below. I have been slowly modifying stuff based on user suggestions so please keep them coming but be patient as it does take some time and I am by no means a coder or expert on this stuff.
Safe trades to all!
Rate of DeviationThe Rate of Deviation indicator calculates and displays the amount the current price varies above or below the average price over Length bars. A deviation value greater than the base level indicates that the current price is higher than the price average while a deviation less than the base level indicates that the current price is lower than the price average.
StatBox📊 StatBox: A Comprehensive Trading Indicator for RSI, Volume Percent, and ADD 📈💼
Introducing StatBox, the ultimate trading indicator designed to provide traders with a powerful analytical toolset for making informed trading decisions. With StatBox, you gain access to real-time data on Relative Strength Index (RSI), Volume Percent, and ADD (Advance/Decline Differential). This dynamic combination of indicators empowers you to navigate the market with greater precision and confidence. 📊🔍
Key Features of StatBox:
1️⃣ RSI (Relative Strength Index): RSI is a widely recognized momentum oscillator that measures the speed and change of price movements. StatBox displays RSI as a numerical value, ranging from 0 to 100, allowing you to quickly assess whether a security is overbought or oversold. This information is invaluable for identifying potential reversal points and optimizing entry or exit strategies.
2️⃣ Volume Percent: StatBox provides a visual representation of the Volume Percent, which reflects the relative trading volume compared to a specified period. By monitoring volume dynamics, you gain insights into market sentiment and potential price trends. A higher volume percentage often indicates stronger market participation, suggesting increased interest in a particular security.
3️⃣ ADD (Advance/Decline Differential): ADD is a breadth indicator that calculates the difference between advancing (upward moving) and declining (downward moving) securities. StatBox presents ADD as a histogram, enabling you to assess the overall strength or weakness of the market. Positive values indicate bullish sentiment, while negative values suggest bearish sentiment. By tracking ADD, you can identify potential market reversals or confirm existing trends.
With StatBox, you can:
✅ Quickly gauge the overbought or oversold conditions of a security using RSI.
✅ Monitor volume dynamics to assess market sentiment and potential price trends.
✅ Analyze the breadth of the market and identify bullish or bearish signals with ADD.
✅ Make well-informed trading decisions based on a comprehensive view of multiple indicators.
StatBox provides a user-friendly interface, allowing you to seamlessly integrate it into your preferred trading platform or charting software. Its intuitive design and real-time data updates ensure you have the most accurate and up-to-date information at your fingertips.
Upgrade your trading arsenal and unlock the potential of RSI, Volume Percent, and ADD with StatBox. Experience the power of multiple indicators in a single comprehensive tool. Download StatBox today and gain a competitive edge in the dynamic world of trading! 🚀📈
Grid Spot Trading Algorithm V2 - The Quant ScienceGrid Spot Trading Algorithm V2 is the last grid trading algorithm made by our developer team.
Grid Spot Trading Algorithm V2 is a fixed 10-level grid trading algorithm. The grid is divided into an accumulation area (red) and a selling area (green).
In the accumulation area, the algorithm will place new buy orders, selling the long positions on the top of the grid.
BUYING AND SELLING LOGIC
The algorithm places up to 5 limit orders on the accumulation section of the grid, each time the price cross through the middle grid. Each single order uses 20% of the equity.
Positions are closed at the top of the grid by default, with the algorithm closing all orders at the first sell level. The exit level can be adjusted using the user interface, from the first level up to the fifth level above.
CONFIGURING THE ALGORITHM
1) Add it to the chart: Add the script to the current chart that you want to analyze.
2) Select the top of the grid: Confirm a price level with the mouse on which to fix the top of the grid.
3) Select the bottom of the grid: Confirm a price level with the mouse on which to fix the bottom of the grid.
4) Wait for the automatic creation of the grid.
USING THE ALGORITHM
Once the grid configuration process is completed, the algorithm will generate automatic backtesting.
You can add a stop loss that destroys the grid by setting the destruction price and activating the feature from the user interface. When the stop loss is activated, you can view it on the chart.
[MAD] Position starter & calculatorThe tool you're using is a financial instrument trading planner and analyzer.
Here is how to use it:
Trade Planning: You can plan your trade entries and exits, calculating potential profits, losses, and their ratio (P/L ratio).
You can define up to five target closing prices with varying volumes, which can be individually activated or deactivated (volume set to 0%).
Risk Management: There's a stop-loss function to calculate and limit potential losses.
Additionally, it includes a liquidation pre-calculation for adjustable leverages and position maintenance(subject to exchange variation).
Customization: You can customize the tool's appearance with five adjustable color schemes, light and dark.
-----------------
Initiation: This tool functions as an indicator.
To start, add it as an indicator.
Once added, you can close the indicator window.
Now wait, till you'll see a blue box at the bottom of the input window.
Parameter Input:
Enter your parameters (SL, box left, box right, TP1, TP2, TP3, TP4, TP5) in the direction of the desired trade.
Click from top to bottom for a short trade or bottom to top for a long trade.
Adjustment: If you want to move the box in the future, adjust the times in the indicator settings directly as click input is not yet platform-supported.
This tool functions as a ruler and doesn't offer alerts (for now).
Here is another examples of how to set up a Position-calculation but here for a short:
Have fun trading
Position_controlLibrary "Position_control"
This is a library for defining positions and working with them.
f_calculateLeverage(_Leverage, _maintenance, _value, _direction)
Calculate the leverage used in a trade.
@description This function calculates the leverage used in a trade, based on the value of the trade, the maintenance margin, and the direction of the trade.
Parameters:
_Leverage (float) : The leverage used in the trade, as a floating point number.
_maintenance (float) : The maintenance margin percentage, as a floating point number.
_value (float) : The value of the trade, as a floating point number.
_direction (string) : The direction of the trade, either "long" or "short".
Returns: The leverage used in the trade, as a floating point number.
f_calculate_PL(_Position, _max_TP, _Position_index, _show_profit, _i_decimals_contracts, _i_decimals_prercent)
Calculate the profit or loss for a given trade.
@description This function calculates the profit or loss for a given trade, based on the position type, maximum take profit, position index, and whether to show the profit as a percentage or a value.
Parameters:
_Position (t_Position_type ) : An array of position types for the trade.
_max_TP (int) : The maximum take profit for the trade, as an integer value.
_Position_index (int) : The index of the position in the array, as an integer value.
_show_profit (bool) : A boolean value indicating whether to show the profit as a percentage or a value.
_i_decimals_contracts (int)
_i_decimals_prercent (int)
Returns: The profit or loss for the trade, as a floating point number.
f_drawposition(_Position, _Parameters, _Position_index)
draws a position on the chart
@description via sending in a typo of Position this function is able to drawout Stoploss, Entrybox, Takeprofits and the required labels with information
Parameters:
_Position (t_Position_type ) : array of type t_Position_type containing the position information.
_Parameters (t_drawing_parameters)
_Position_index (int) : the index of the current position.
Returns: None but boxes / lines / labels on the chart itself
t_TP_Variant
Fields:
TP_Type (series__string)
TP_Parameter_1 (series__integer)
TP_Parameter_2 (series__integer)
TP_Parameter_3 (series__float)
TP_Parameter_4 (series__float)
t_TPs
Fields:
TP_Price (series__float)
TP_Lot (series__float)
TP_Variant (|t_TP_Variant|#OBJ)
TP_Active (series__bool)
t_SLs
Fields:
SL_Price (series__float)
SL_Lot (series__float)
SL_Active (series__bool)
t_Position_type
Fields:
Lot (series__float)
Leverage (series__float)
Maintenance (series__float)
Starttime (series__integer)
Entry_Start (series__float)
Stoptime (series__integer)
Entry_Stop (series__float)
Entryprice (series__float)
TPs (array__|t_TPs|#OBJ)
SLs (array__|t_SLs|#OBJ)
t_drawing_parameters
Fields:
ShowPos (series__bool)
ShowLIQ (series__bool)
A_Colors (array__color)
Prolong_lines (series__bool)
Str_fontsize (series__string)
Textshift (series__integer)
Decimals_contracts (series__integer)
Decimals_price (series__integer)
Decimals_percent (series__integer)
bartime (series__integer)
Metrics using Alternative Portfolio TheoryLibrary "APT_Metrics"
Portfolio metrics using alternative portfolio theory
metrics(init, cur, start, end, alpha)
Calculates APT metrics
Parameters:
init (float) : Starting Equity (strategy.initial)
cur (float)
start (int) : Start date (UNIX)
end (int) : End Date (UNIX)
alpha (float) : Confidence interval for DaR/CDaR. Defval = 0.05
Returns: Plots table with APT metrics
The metrics are shown in the bottom pane being applied to a buy-and-hold strategy.
PLEASE NOTE: This is the first draft of the library. Some calculations may be incorrect. If you spot any mistakes then please let me know and I will correct them as soon as possible. I am also open to suggestions on how to improve this.
At the moment this only works on the daily timeframe until I can find a way to universally calculate annualized volatility.
See inside Candles: Directionality %; Constituent Bars & GapsSee inside candles based on user-input LTF setting: get data on 'Directionality' of your candle; Gaps (total and Sum; UP and DOWN); Number of Bull or Bear constituent candles
//Features:
-DIRECTIONALITY: compare length of the 'zig-zag' random walk of lower time frame constituent candles, to the full height of the current candle. Resulting % I refer to as 'directionality'.
-GAPs: what i refer to as 'gaps' are also known as Volume imbalances: the gap between previous candles close and current candle's open (if there is one).
--Gaps total (up vs down gaps). Number of Up gaps printed above bar in green, down gaps printed below bar in red.
--Gaps Sum (total summed UP gap, total summed down gaps. Sum of Up gaps printed above bar in green, Sum of down gaps printed below bar in red.
-Candles Total: Numer of LTF up vs down candles within current timeframe candle. Number of up candles printed above bar in green, Number of down candles printed below bar in red.
//USAGE:
-Primary purpose in this was the Directionality aspect. Wanted to get a measure of how choppy vs how directional the internals of a candle were. Idea being that a candle with high % directionality (approaching 100) would imply trending conditions; while a candle which was large range and full bodies but had a low % directionality would imply the internals were back-and-forth and => rebalanced, potentially indicating price may not need to retrace back into it and rebalance further. All rather experimental, please treat it as such: have a play around with it.
-Number of gaps, Sums of up and down gaps, ratio of up and down constituent candles also intended to serve a similar purpose as the above.
-Set the input lower timeframe; this must obviously be lower then your current timeframe. You will significant differences in results depending on the ratio your timeframes (chart timeframe vs user-input timeframe).
//User Inputs:
-Lower timeframe input (setting child candle size within current chart parent candle).
-Choose function from the four listed above.
-typical formating options: Bull color/bear color txt for gaps functions.
-display % unit or not.
-display vertical or horizontal text.
-Set min / max directionality thresholds; and color code results.
-Toggle on/off 'hide results outside of threshold' to declutter the chart.
-choose label style.
//NOTES:
-Directionality thresholds can be set manually; Max and Min thresholds can be set to filter out 'non-extreme' readings.
-Note that directionality % can sometimes exceed 100%, in cases where price trends very strongly and gaps up continuously such that sum of constituent candles is less than total range of parent candle.
-Personally i like the idea of seeking bold, large-range, full bodied candles, with a lower than typical directionality %; indicating that a price move is both significant and it's already done it's rebalancing; I would see this as potentially favourable for continuation (obviously depending on context).
---- Showcase of the other functions beyond Directionality percentage ----
Candles Total (bull vs Bear). ES1! Hourly; ltf = 5min: Candles total: LTF up candles and LTF down candles making up the current HTF candle (constituent number of UP candles printed above in green, Down candles printed below in red):
Gaps SUM. SPX hourly, ltf = 5min. Sum of 'UP' gaps within candle printed above in green, sum of 'DOWN' gaps printed below in red:
Gaps TOTAL: SPX hourly, ltf = 1min. Simply the total of 'up' gaps vs 'down' gaps withing our candle; based on the user input constituent candles within:
SPX ES SpreadA very simple indicator to display the spread between ES and SPX. The table by default displays in the upper right corner of the chart. If you are on the chart for SPX, it will show the current price of ES, as well as the difference in points between the two. Similarly, if on the chart for ES, it will show the price for SPX as well as the difference in points between the two. The table does not appear at all if the chart symbol is anything other than ES or SPX. The specific symbols used can be defined by the user.
PSESS1 - Learn PineScript InputsThis is a script written exclusively for people who are trying to learn Pine Script.
PSESS stands for "Pine Script Educational Script Series" which is a series of scripts that helps Pine Script programmers in 2 ways:
1. Learn Pine Script at more depth by an interactive environment where they can immediately see the effects of any change in the pre-written code and also comparing different lines code having tiny differences so they can grasp the details.
2. Have this script open while coding in order to copy the line they find useful
Pine Script Library couldn't be used for this purpose since this script has educational aspect and needs to be executable individually.
This is Script 1 of PSESS and focuses on inputs in Pine Script.
The script is densly commented in order to make it understandable. here is the outline of the script:
1. Inputs that can be received through the indicator() function
2. 12 possible types of input
3. Input() function arguments: defval - title - tooltip - inline - group - confirm
4. The different display of tooltip when inputs are inline
5. Multiple price and time inputs (on single request or multiple requests)
6. What happens when title argument is not specified
7. References and key points from them
Expected VolatilityExpected Volatility
Hello and welcome to my first indicator! I'm publishing this indicator as free to use and modify because I think it's a great place to learn and I hope I can teach you something.
There are some terms which you need to understand before I begin explaining this indicator and what it does for you:
Daily Settlement - The price at which a market closes when the trading day closes (RTH or Regular Trading Hours close)
Standard Deviation - A measure in statistics that declares how far away a data point is from the mean when compared with all the data points before it to an extent
Now for the history behind this indicator:
Rule of 16. This goes back to the VIX, or S&P 500 volatility index. The idea behind the volatility index is to determine what magnitude of movement could be expected from the market the following day based on recent movement. The rule of 16 is an easier way to refer to the square root of the number of trading days in a year. There are 252 trading days in a year and the square root of 252 is approximately 15.87. We estimate it to be 16 because it's easier to talk about when it's easier to say and therefore easier to remember.
The relevance of this rule is that when the VIX is at 16, we can expect a market movement of 1% or so unless some special circumstances overrule this estimate. To get the expected market movement, we take 16 and divide by 16 and get 1, or 1%. If the VIX is trading at 24, we get 24/16 or 1.5 which is 1.5% movement. This indicator seeks to simplify the math and lay it out in a visual way to show the highest probability of range the market is expected to trade.
Thanks for taking the time to read my description, I hope you like my indicator.
Special thanks to my trading friends and coaches for helping me complete this indicator.
Statistical Arbitrage Right LegStatistical Arbitrage, this is the right leg strategy signal.
You should find "Statistical Arbitrage Left Leg (Symbol 1)" this strategy for the opposite leg (Left Leg),
In order to full hedge the position exposure risk, and profit on the spread convergence.
Statistical arbitrage is a quantitative trading strategy that seeks to exploit pricing discrepancies in financial markets based on statistical models and analysis. It involves using mathematical models and statistical techniques to identify and take advantage of mispricings between related financial assets.
In statistical arbitrage, traders use sophisticated algorithms to identify pairs or groups of financial assets that are expected to move in tandem based on historical correlations. They then look for deviations from these historical patterns in order to generate profitable trades. For example, a trader might identify a pair of stocks that have historically moved together, but are currently priced such that one is significantly cheaper than the other. The trader would then buy the cheaper stock and simultaneously sell the more expensive one, hoping to profit when the prices converge.
Statistical arbitrage is a popular trading strategy among hedge funds and other institutional investors, who have access to large amounts of data and the computational resources necessary to analyze it. However, it requires significant expertise in statistics, mathematics, and programming, as well as access to advanced analytical tools and data sources.