FuTech : IPO Lock-in Ends FuTech: Lock-in Ends - First ever unique Indicator on the TradingView platform
Hello Everyone !
Introducing the first-ever unique indicator on the TradingView platform to track the lock-in period expiry dates for IPOs.
The FuTech Lock-in Ends Indicator is specifically designed to assist traders and investors in identifying the key dates when lock-in periods for IPO shares come to an end.
This provides an edge in preparing for potential market movements driven by buying or selling pressures associated with significant share volumes.
=============================================================
Key Features:
1. Tracks Multiple Lock-in Periods:
- Identifies dates when the 30 days, 90 days, 6 months, and 18 months lock-in periods for IPO shares expire.
- Helps traders anticipate potential market action driven by share releases.
2. IPO Lock-in Ends dates as per Compliance with SEBI Guidelines:
- SEBI (Securities and Exchange Board of India) mandates lock-in periods for IPO shares based on investor categories:
- A) Promoters:
- Lock-in period reduced to 18 months for up to 20% of post-issue paid-up capital (previously 3 years).
- For shareholding exceeding 20%, the lock-in period is further reduced to 6 months (previously 1 year).
- B) Anchor Investors:
- 50% of allotted shares: Lock-in period of 90 days from the date of allotment.
- Remaining 50% of shares: Lock-in period of 30 days from the date of allotment.
- C) Non-promoters:
- Lock-in period reduced to 6 months (previously 1 year).
After these lock-in periods end, investors may buy / sell their shares, which can result in significant market activity.
3. Visual Indicator on Charts:
- The indicator draws vertical lines on the TradingView chart at the respective lock-in expiry dates.
- Alerts users in advance about potential market activity due to the release of locked shares.
- Traders can use these alerts to prepare for positions or adjust their existing holdings accordingly.
4. Customizable Settings:
- Users can modify the color of the labels and width of the lines to suit their preferences and enhance chart visibility.
5. User-defined Allotment Dates:
- If the allotment date is known, users can input this information directly. The indicator will then calculate the lock-in period dates based on the provided allotment date, ensuring precise results.
- If no allotment date is entered, the default calculation assumes the allotment date to be three trading days prior to the listing date .
=============================================================
Important Notes:
- Allotment Date Calculation:
- In the absence of user-defined allotment dates, the indicator estimates the allotment date as three trading days prior to the listing date .
- This approximation may deviate by one to two days from the actual event for certain IPOs.
- Proactive Alerts:
- Most dates are intentionally marked 1-2 days in advance to give traders sufficient time to act, whether for taking new positions or squaring off existing ones to avoid unfavorable losses.
=============================================================
The FuTech Lock-in Ends Indicator is a must-have tool for IPO traders and investors looking to stay ahead of market movements. Use it to track key dates and plan your trading strategy effectively with FuTech : Chart is Art.
=============================================================
Thank you !
Jai Swaminarayan Dasna Das !
He Hari ! Bas Ek Tu Raji Tha !
Indicadores y estrategias
M2 Global Liquidity Index - Time-Shift - KHM2 Global Liquidity Index - Enhanced Time-Shift Indicator
Based on original work by @Mik3Christ3ns3n
Enhanced with advanced time-shift functionality and overlay capabilities.
Description:
This indicator tracks and visualizes the global M2 money supply from five major economies, allowing precise time-shift analysis for correlation studies. All values are converted to USD in real-time and aggregated to provide a comprehensive view of global liquidity conditions.
Key Features:
- Advanced time-shift capability (-1000 to +1000 days) with shape preservation
- Real-time currency conversion to USD
- Overlay functionality with main chart
- Right-scale display for better comparison
- Full historical data preservation during time shifts
Components Tracked:
- US M2 Money Supply (USM2)
- China M2 Money Supply (CNM2)
- Eurozone M2 Money Supply (EUM2)
- Japan M2 Money Supply (JPM2)
- UK M2 Money Supply (GBM2)
Primary Use Cases:
1. Correlation Analysis:
- Compare global liquidity trends with asset prices
- Identify leading/lagging relationships through time-shift
- Study monetary policy impacts across different time periods
2. Market Analysis:
- Track global liquidity conditions
- Monitor central bank policy effects
- Identify potential macro trend changes
Settings:
- Time Offset: Shift the M2 data backwards or forwards (-1000 to +1000 days)
- Positive values: Move M2 data into the future
- Negative values: Move M2 data into the past
- Zero: Current alignment
Technical Notes:
- Data updates follow central banks' M2 publication schedules
- All currency conversions performed in real-time
- Historical shape preservation during time-shifts
- Enhanced data consistency through lookahead mechanism
Credits:
Original concept and base code by @Mik3Christ3ns3n
Enhanced version includes advanced time-shift capabilities and shape preservation
License:
Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
#M2 #GlobalLiquidity #MoneySupply #Macro #CentralBanks #MonetaryPolicy #TimeShift #Correlation #TradingIndicator #MacroAnalysis #LiquidityAnalysis #MarketIndicator
MFS-3 Bars Pattern Strategy3 Bar Pattern Strategy
Detects an Ignite Candle followed by a Pullback Candle followed by a Confirmation Candle.
A Box will be drawn around the setup and three arrows will identify I, P, C (Ignite, Pullback, Confirmation) the setup.
The strategy will calculate a Stop Loss below the Low Price of the Ignite candle and a Take Profit at 2 times the Stop Loss giving a Risk to Reward Ratio of 1:2.
Extra conditions are included to reduce false triggers:
- A down trend must be detected using 3 SMA (Long, Medium, Short) that should be aligned from Long to Short one above the other.
- The Ignite Candle's body must be BELOW the Short SMA
An input form is available to adjust some strategy parameters.
Performance Note
----------------------
Trading conditions are very strict, so most of the time, no signals will be detected in the Strategy window.
This strategy should only be one of many strategies used for trade setups.
Hope you enjoy it.
Intrabar DistributionThe Intrabar Distribution publication is an extension of the Intrabar BoxPlot publication. Besides a boxplot, it showcases price and volume distribution using intrabar Lower Timeframe (LTF) values (close) which can be displayed on the chart or in a separate pane.
🔶 USAGE
Intrabar Distribution has several features, users can display:
Recent candle for comparison against the other features
Boxplot of recent candle
Price distribution (optionally displayed as a curve)
Volume distribution
🔹 Recent candle / Boxplot
The middle 50% intrabar close values (Interquartile range, or IQR) are shown as a box, where the upper limit is percentile 75 (p75), and the lower limit is percentile 25 (p25). The dashed lines show the addition/subtraction of 1.5*IQR. All values out of range are considered outliers. They are displayed as white dots within the IQR*1.5 range or white X's when beyond the IQR*3 range (extreme outliers).
By showing the middle 50% intrabar values through a box, we can more easily see where the intrabar activity is mainly situated.
Note in the example above an upward-directed candle with a negative volume delta, displayed as a red box and dot (see further).
As seen in the following example, compared against the recent candle (grey candle at the left), most of the intrabar activity lies just beneath the opening price.
Note that results will be more accurate when more data is available, which can be done by making the difference between the current timeframe and the intrabar timeframe large enough.
🔹 Price / Volume distribution
The price and volume distribution can be helpful for highlighting areas of interest.
Here, we can see two areas where intrabar closing prices are mainly positioned.
The following example shows three successive bars. The recent bar is displayed on the left side, together with the volume distribution. The boxplot and price distribution are displayed on the right.
You can see the difference between volume and price distribution.
At the first bar, most price activity is at the top, while most of the volume was generated at the bottom; in other words, the price got briefly in the bottom region, with high volume before it returned.
At the second bar, price and volume are relatively equally distributed, which fits for indecisiveness.
The third bar shows more volume at a higher region; most intrabar closing prices are above the closing price.
Following example shows the same with 'Curve shaped' enabled (Settings: 'Price Distribution')
When 'Curve shaped' is enabled, lines/labels are shown with the standard deviation distance.
A blue 'guide line' can be enabled for easier interpretation.
🔹 Volume Delta
When there is a discrepancy between the delta volume and direction of the candle, this will be displayed as follows:
Red candle: when the sum of the volume of green intrabars is higher than the sum of the volume of red intrabars, the 'mean dot' will be coloured green.
Green candle: when the sum of the volume of red intrabars is higher than the sum of the volume of green intrabars, the 'mean dot' will be coloured red.
🔶 DETAILS
The intrabar values are sorted and split in parts/sections. The number of values in each section is displayed as a white line
The same principle applies to volume distribution, where the sum of volume per section is displayed as an orange area.
The boxplot displays several price values
Last close price
Highest / lowest intrabar close price
Median
p25 / p75
🔹 LTF settings
When 'Auto' is enabled (Settings, LTF), the LTF will be the nearest possible x times smaller TF than the current TF. When 'Premium' is disabled, the minimum TF will always be 1 minute to ensure TradingView plans lower than Premium don't get an error.
Examples with current Daily TF (when Premium is enabled):
500 : 3 minute LTF
1500 (default): 1 minute LTF
5000: 30 seconds LTF (1 minute if Premium is disabled)
🔶 SETTINGS
Location: Chart / Pane (when pane is opted, move the indicator to a separate pane as well)
Parts: divides the intrabar close values into parts/sections
Offset: offsets every drawing at once
Width: width of drawings, only applicable on "location: chart"
Label size: size of price labels
🔹 LTF
LTF: LTF setting
Auto + multiple: Adjusts the initial set LTF
Premium: Enable when your TradingView plan is Premium or higher
🔹 Current Bar
Display toggle + color setting
Offset: offsets only the 'Current Bar' drawing
🔹 Intrabar Boxplot
Display toggle + Colors, dependable on different circumstances.
Up: Price goes up, with more bullish than bearish intrabar volume.
Up-: Price goes up, with more bearish than bullish intrabar volume.
Down: Price goes down, with more bearish than bullish intrabar volume.
Down+: Price goes down, with more bullish than bearish intrabar volume.
Offset: offsets only the 'Boxplot' drawing
🔹 Price distribution
Display toggle + Color.
Curve Shaped
Guide Lines: Display 2 blue lines
Display Price: Show price of 'x' standard deviation
Offset: offsets only the 'Price distribution' drawing
Label size: size of price labels (standard deviation)
🔹 Volume distribution
Display toggle + Color.
Offset: offsets only the 'Volume distribution' drawing
🔹 Table
Show TF: Show intrabar Timeframe.
Textcolor
Size Table: Text Size
Intrabar BoxPlotThe Intrabar BoxPlot publication highlights an uncommon technique by displaying statistical intrabar Lower Timeframe (LTF) values on the chart.
🔶 USAGE
🔹 Middle 50% Boxes
By showing the middle 50% intrabar values through a box, we can more easily see where the intrabar activity is mainly situated.
The middle 50% intrabar values are referred to from here on as Interquartile range (IQR).
In this example, the successive IQRs form a channel where the price eventually breaks out.
Disproportionately distributed values can give insights which can be used to find potential support/resistance areas.
IQR gaps can give valuable information as well. Potentially, the price can return to these gaps.
Seeing the IQR areas against regular candles gives an alternative image of the underlying price movements.
🔹 Highest volume Price level
The script displays the price level with the highest volume situated, dependable on the user's source setting. Setting the source at 'close' will only display intrabar close values; the same goes for high, low, ...
As seen in the above example, the volume levels can aid in finding support/resistance.
🔹 Median
The location of the median off all intrabar values is displayed as a coloured dot: green when the close price is higher than the opening price and red if otherwise. The median can give valuable insights into price movements.
🔹 Outliers
Medium (white dots) and extreme (white X) outliers, in combination with the IQR box, can help identify potential areas of interest.
🔹 Volume Delta
When there is a discrepancy between the delta volume and direction of the candle, this will be displayed as follows:
Green candle: when the sum of the volume of red intrabars is higher than the sum of the volume of green intrabars, the candle will be coloured orange.
Red candle: when the sum of the volume of green intrabars is higher than the sum of the volume of red intrabars, the candle will be coloured blue.
🔹 Highlight Boxplot only
Probably the easiest way to display boxplot only is by changing the Bar's style to Bars .
🔶 DETAILS
All intrabar values (Lower TimeFrame - LTF) are sorted and evaluated. Values can be close , high , low , ... by selecting this in Settings ( source ).
The middle 50% of all values are displayed as a box; this contains the values between percentile 25 (p25) and percentile 75 (p75). The value of percentile rank 75 means 75% of all values are lower. The value of percentile rank 25 means 25% of all values are lower, or 75% is higher.
The difference between p75 and p25 is also known as Interquartile range (IQR)
IQR is used to check for outliers.
Wiki: Boxplot , Interquartile range
Extreme high: maximum value, higher than p75 + IQR*3
Max outlier high: maximum value, higher than p75 + IQR*1.5 but lower than p75 + IQR*3
Max: maximum value, lower than p75 + IQR*1.5
Min: minimum value, higher than p25 - IQR*1.5
Min outlier low: minimum value, lower than p25 - IQR*1.5 but higher than p25 - IQR*3
Extreme low: minimum value, lower than p25 - IQR*3
Max and min must not be interpreted with the current candle high/low.
🔹 Example: Length of chart-puppets
The following example can make it easier to digest. Forty "chart-puppets" are sorted by their length.
The p25 value is 97
The p50 value is 120
The p75 value is 149
75% of all "chart-puppets" are smaller than p75, and 25% is larger than p75.
50% of all "chart-puppets" are smaller than p50, and 50% is larger than p50 (= median).
25% of all "chart-puppets" are smaller than p25, and 75% is larger than p25.
IQR = 149 - 97 = 52
Extreme outlier limit max: p75 + IQR*3 = 149 + 52*3 = 305
Mild outlier limit max: p75 + IQR*1.5 = 149 + 52*1.5 = 227
Mild outlier limit min: p25 - IQR*1.5 = 97 - 52*1.5 = 19
Extreme outlier limit min: p25 - IQR*3 = 97 - 52*3 = -59
In this example there are no outliers to be found, all values are located between p25 - IQR*1.5 (19) and p75 + IQR*1.5. (227)
🔹 Source settings
Note that results are dependable on the chosen source (settings). When, for example, close is chosen as the source, only intrabar close prices are included. This means a low or high can stretch further then the min or max.
Here we can see different results with different source settings
🔹 LTF settings
When 'Auto' is enabled (Settings, LTF), the LTF will be the nearest possible x times smaller TF than the current TF. When 'Premium' is disabled, the minimum TF will always be 1 minute to ensure TradingView plans lower than Premium don't get an error.
Examples with current Daily TF (when Premium is enabled):
500 : 3 minute LTF
1500 (default): 1 minute LTF
5000: 30 seconds LTF (1 minute if Premium is disabled)
🔶 SETTINGS
Source: Set source at close, high, low,...
🔹 LTF
LTF: LTF setting
Auto + multiple: Adjusts the initial set LTF
Premium: Enable when your TradingView plan is Premium or higher
🔹 Intrabar Delta : Colors, dependable on different circumstances.
Up: Price goes up, with more bullish than bearish intrabar volume.
Up-: Price goes up, with more bearish than bullish intrabar volume.
Down: Price goes down, with more bearish than bullish intrabar volume.
Down+: Price goes down, with more bullish than bearish intrabar volume.
🔹 Table
Show table: Show details at the top right corner
Show TF: Show LTF at the bottom right corner
Text color/table size
See DETAILS for more information
Relative Price Position Flow (RPPF)Market work by short and long players positions. By commodities, players buy or sell positions based in market expectations. The volume of negotiations defines the optimum point to buy or sell. It means how much more volume in a price line, much of the players thinking this is the real value. So, in this indicator I calculate the volume of trades for some price line. And divide it to the total volume, to define whats the historical price line optimum. The diference between the actual price to the historical optimum trade, define some directions of the market. Some times the price is bigger, and sometimes it is smaller.
By experience, after some times the price is deviated to the flow price, it will search a compensation, starting a reversion movement.
Future Interest Indexed by AssetEste script em Pine Script calcula e exibe o índice dos juros futuros (DI1) em relação ao preço de um ativo, utilizando o preço de fechamento do ativo e a taxa de juros futuros (DI1). O cálculo é realizado dividindo a taxa de juros pelos preços do ativo, resultando no índice indice_juros. Para evitar a divisão por zero, o script verifica se o preço do ativo é válido e não nulo. O índice calculado é então plotado em um painel inferior no gráfico, representado por uma linha azul, permitindo aos usuários observar a relação entre a taxa de juros futuros e o preço do ativo de forma clara e intuitiva.
This Pine Script script calculates and displays the future interest rate (DI1) in relation to the price of an asset, using the asset's closing price and the future interest rate (DI1). The calculation is carried out by dividing the interest rate by the asset prices, resulting in the index_interest index. To avoid division by zero, the script checks that the asset's price is valid and not null. The calculated index is then plotted in a lower panel on the chart, represented by a blue line, allowing users to observe the relationship between the future interest rate and the asset price clearly and intuitively.
Asset Indexed by Future Interest
Este script em Pine Script calcula e exibe o índice de um ativo em relação à taxa de juros futuros (DI1) em um painel inferior. Ele obtém o preço de fechamento do ativo e a taxa de juros futuros DI1!, e em seguida, calcula o índice do ativo dividindo o preço do ativo pela taxa de juros futuros. Para evitar a divisão por zero, o script realiza uma validação para garantir que o valor da taxa de juros não seja nulo ou zero. O índice calculado é então plotado no painel inferior, em uma linha verde, permitindo que os usuários visualizem a relação entre o preço do ativo e os juros futuros de curto prazo. Esse índice pode ser útil para analisar como a taxa de juros influencia o comportamento do ativo.
This script in Pine Script calculates and displays the ratio of an asset to the future interest rate (DI1) in a lower panel. It obtains the asset's closing price and the future interest rate DI1!, and then calculates the asset index by dividing the asset price by the future interest rate. To avoid division by zero, the script performs validation to ensure that the interest rate value is not null or zero. The calculated index is then plotted in the bottom panel, in a green line, allowing users to visualize the relationship between the asset's price and short-term future interest. This index can be useful for analyzing how the interest rate influences the asset's behavior.
Adjust Asset for Future Interest (Brazil)Este script foi criado para ajustar o preço de um ativo com base na taxa de juros DI11!, que reflete a expectativa do mercado para os juros futuros. O objetivo é mostrar como o valor do ativo seria influenciado se fosse diretamente ajustado pela variação dessa taxa de juros.
Como funciona?
Preço do Ativo
O script começa capturando o preço de fechamento do ativo que está sendo visualizado no gráfico. Esse é o ponto de partida para o cálculo.
Taxa de Juros DI11!
Em seguida, ele busca os valores diários da taxa DI11! no mercado. Esta taxa é uma referência de juros de curto prazo, usada para ajustes financeiros e projeções econômicas.
Fator de Ajuste
Com a taxa de juros DI11!, o script calcula um fator de ajuste simples:
Fator de Ajuste
=
1
+
DI11
100
Fator de Ajuste=1+
100
DI11
Esse fator traduz a taxa percentual em um multiplicador aplicado ao preço do ativo.
Cálculo do Ativo Ajustado
Multiplica o preço do ativo pelo fator de ajuste para obter o valor ajustado do ativo. Este cálculo mostra como o preço seria se fosse diretamente influenciado pela variação da taxa DI11!.
Exibição no Gráfico
O script plota o preço ajustado do ativo como uma linha azul no gráfico, com maior espessura para facilitar a visualização. O resultado é uma curva que reflete o impacto teórico da taxa de juros DI11! sobre o ativo.
Utilidade
Este indicador é útil para entender como as taxas de juros podem influenciar ativos financeiros de forma hipotética. Ele é especialmente interessante para analistas que desejam avaliar a relação entre o mercado de renda variável e as condições de juros no curto prazo.
This script was created to adjust the price of an asset based on the DI11! interest rate, which reflects the market's expectation for future interest rates. The goal is to show how the asset's value would be influenced if it were directly adjusted by the variation of this interest rate.
How does it work?
Asset Price
The script starts by capturing the closing price of the asset that is being viewed on the chart. This is the starting point for the calculation.
DI11! Interest Rate
The script then searches for the daily values of the DI11! rate in the market. This rate is a short-term interest reference, used for financial adjustments and economic projections.
Adjustment Factor
With the DI11! interest rate, the script calculates a simple adjustment factor:
Adjustment Factor
=
1
+
DI11
100
Adjustment Factor=1+
100
DI11
This factor translates the percentage rate into a multiplier applied to the asset's price.
Adjusted Asset Calculation
Multiplies the asset price by the adjustment factor to obtain the adjusted asset value. This calculation shows how the price would be if it were directly influenced by the variation of the DI11! rate.
Display on the Chart
The script plots the adjusted asset price as a blue line on the chart, with greater thickness for easier visualization. The result is a curve that reflects the theoretical impact of the DI11! interest rate on the asset.
Usefulness
This indicator is useful for understanding how interest rates can hypothetically influence financial assets. It is especially interesting for analysts who want to assess the relationship between the equity market and short-term interest rate conditions.
12 Month Difference - YoY ComparisonEste script foi desenvolvido para calcular e exibir a variação percentual do preço de um ativo nos últimos 12 meses, de forma simples e visual. Ele utiliza dados históricos de preços e apresenta o resultado diretamente no gráfico, permitindo ao usuário acompanhar a relação entre o valor atual e o valor de 12 meses atrás.
O cálculo é baseado em um período de 12 meses, que equivale a 252 dias úteis no mercado financeiro. O script primeiro identifica o preço atual do ativo e o compara com o preço registrado há exatamente 252 dias úteis. A diferença entre esses dois valores é transformada em uma variação percentual, o que facilita a análise de desempenho do ativo ao longo do período.
Além disso, o script define uma cor para destacar o resultado:
Verde, se a variação percentual for positiva (indicando crescimento).
Vermelho, se a variação for negativa (indicando queda).
O valor calculado é exibido de forma prática no canto inferior direito do gráfico, como uma tabela flutuante. Essa tabela contém o texto "Relação 12M" e o valor percentual correspondente, permitindo uma leitura rápida.
Embora o resultado seja calculado para todos os momentos no gráfico, ele é mostrado apenas como uma tabela no último ponto confirmado da série histórica, ou seja, no momento mais recente com dados disponíveis. Além disso, o script inclui o valor da relação na legenda do gráfico, mas ele está oculto visualmente para evitar sobrecarregar o layout.
Esse indicador é útil para analisar rapidamente o desempenho de um ativo ao longo de um ano, ajudando investidores e analistas a entenderem tendências e mudanças no mercado.
This script was developed to calculate and display the percentage change in the price of an asset over the last 12 months, in a simple and visual way. It uses historical price data and displays the result directly on the chart, allowing the user to monitor the relationship between the current value and the value from 12 months ago.
The calculation is based on a 12-month period, which is equivalent to 252 business days in the financial market. The script first identifies the current price of the asset and compares it with the price recorded exactly 252 business days ago. The difference between these two values is transformed into a percentage change, which makes it easier to analyze the asset's performance over the period.
In addition, the script defines a color to highlight the result:
Green, if the percentage change is positive (indicating growth).
Red, if the change is negative (indicating a decline).
The calculated value is displayed conveniently in the bottom right corner of the chart, as a floating table. This table contains the text "12M Ratio" and the corresponding percentage value, allowing for quick reading.
Although the result is calculated for all points in time on the chart, it is only displayed as a table at the last confirmed point in the historical series, i.e. the most recent point in time with available data. In addition, the script includes the ratio value in the chart legend, but it is visually hidden to avoid cluttering the layout.
This indicator is useful for quickly analyzing the performance of an asset over a year, helping investors and analysts understand trends and changes in the market.
Brazil Real Interest RateEste script foi criado para calcular e exibir a Taxa de Juros Real, permitindo compreender o impacto da inflação sobre os juros nominais do mercado. Ele utiliza dois indicadores principais: a taxa de juros nominal, que reflete os juros antes de considerar a inflação, e a taxa de inflação anual, que mede o aumento dos preços em um ano.
O script funciona da seguinte forma: ele obtém diariamente os dados da taxa de juros nominal (representada pelo contrato futuro DI1) e da inflação anual (indicada pelo BRIRYY). Esses valores são processados para calcular a taxa de juros real, utilizando a fórmula de Fisher, que ajusta os juros nominais ao descontar o efeito da inflação. O resultado é uma medida mais precisa do retorno ou custo real, considerando o poder de compra.
Depois de realizar o cálculo, o script exibe a Taxa de Juros Real diretamente no gráfico, representada por uma linha verde. Isso permite acompanhar, de forma clara e visual, como a inflação e os juros afetam o cenário econômico ao longo do tempo.
This script was created to calculate and display the Real Interest Rate, allowing us to understand the impact of inflation on nominal market interest rates. It uses two main indicators: the nominal interest rate, which reflects interest rates before considering inflation, and the annual inflation rate, which measures the increase in prices over a year.
The script works as follows: it obtains daily data on the nominal interest rate (represented by the DI1 futures contract) and annual inflation (indicated by BRIRYY). These values are processed to calculate the real interest rate, using the Fisher formula, which adjusts nominal interest rates by discounting the effect of inflation. The result is a more accurate measure of real return or cost, considering purchasing power.
After performing the calculation, the script displays the Real Interest Rate directly on the graph, represented by a green line. This allows you to monitor, clearly and visually, how inflation and interest rates affect the economic scenario over time.
Visible and Anchored OTE chart [SYNC & TRADE]Thanks for the start @twingall
Visible and Anchored OTE chart
Indicator for visualizing price levels and optimal trading zones (OTE - Optimal Trading Entry) using Fibonacci levels.
Main features
Visualization of price ranges using two OTE zones:
OTE 70% (79-62 Fibonacci levels)
OTE 30% (21-38 Fibonacci levels)
Setting up time periods:
Ability to use a custom date range
Option to work with a higher time frame
Flexible display settings:
Choose between using candle bodies or the full range for binding
Customizable appearance of OTE boxes
Customizable text labels
Additional levels:
Middle line (50.5%)
Optional levels of 29.5%, 70.5% and 88%
Customizable Fibonacci extensions
Indicator settings
Main parameters
Use Custom Dates - enable a custom date range
Start Date/End Date - set a time range
Use Higher Timeframe - use a higher time frame
Higher Timeframe - select a higher timeframe
Setting up OTE zones
Show Fib Box - displaying OTE zones
Enable Fib Box 79-62 - enabling OTE zone 70%
Enable Fib Box 21-38 - enabling OTE zone 30%
Show Text - displaying text labels in zones
Visual design
Text Size - text size (tiny/small/medium/large)
Text Color - text color
Text Alignment - text alignment
Line Thickness - line thickness (1-4)
Line Style - line style (Solid/Dashed/Dotted)
Fibonacci levels
High/Low Lines - displaying extreme levels
Midline - displaying the middle line (50.5%)
Show 29.5 Line - additional level 29.5%
Show 70.5 Line - additional level 70.5%
Show 88 Line - additional level 88%
Extensions Fibonacci
There are 6 customizable extension levels available:
Ext#1 (default 1.0)
Ext#2 (default 1.27)
Ext#3 (default 1.62)
Ext#4 (default 2.0)
Ext#5 (default 2.62)
Ext#6 (default 3.62)
For each level, you can configure:
On/Off
Color
Meaning
Alerts
The indicator provides the following types of alerts:
Entering/Exiting OTE Zones:
Entering 70% OTE Zone
Exiting 70% OTE Zone
Entering 30% OTE Zone
Exiting 30% OTE Zone
Crossing Additional Levels:
Crossing 29.5% Level
Crossing 70.5% Level
Crossing 88% Level
Reaching Extension Levels Fibonacci:
Alerts for each configured extension level
Support for both positive and negative extensions
Usage
Add the indicator to the chart
Configure the required display parameters
Set alerts if necessary
Use OTE zones to identify potential entry points into the market
Notes
The indicator automatically updates when the visible area of the chart changes
When using a custom date range, make sure the selected period contains data
For correct operation with a higher time frame, make sure that historical data is available
Visible and Anchored OTE chart
Индикатор для визуализации ценовых уровней и зон оптимальной торговли (OTE - Optimal Trading Entry) с использованием уровней Фибоначчи.
Основные возможности
Визуализация ценовых диапазонов с помощью двух OTE зон:
OTE 70% (79-62 уровни Фибоначчи)
OTE 30% (21-38 уровни Фибоначчи)
Настройка временных периодов:
Возможность использования пользовательского диапазона дат
Опция работы с высшим таймфреймом
Гибкая настройка отображения:
Выбор между использованием тел свечей или полного диапазона для привязки
Настраиваемый внешний вид боксов OTE
Настраиваемые текстовые метки
Дополнительные уровни:
Средняя линия (50.5%)
Опциональные уровни 29.5%, 70.5% и 88%
Настраиваемые расширения Фибоначчи
Настройка индикатора
Основные параметры
Use Custom Dates - включение пользовательского диапазона дат
Start Date/End Date - установка временного диапазона
Use Higher Timeframe - использование высшего таймфрейма
Higher Timeframe - выбор высшего таймфрейма
Настройка OTE зон
Show Fib Box - отображение зон OTE
Enable Fib Box 79-62 - включение зоны OTE 70%
Enable Fib Box 21-38 - включение зоны OTE 30%
Show Text - отображение текстовых меток в зонах
Визуальное оформление
Text Size - размер текста (tiny/small/medium/large)
Text Color - цвет текста
Text Alignment - выравнивание текста
Line Thickness - толщина линий (1-4)
Line Style - стиль линий (Solid/Dashed/Dotted)
Уровни Фибоначчи
High/Low Lines - отображение крайних уровней
Midline - отображение средней линии (50.5%)
Show 29.5 Line - дополнительный уровень 29.5%
Show 70.5 Line - дополнительный уровень 70.5%
Show 88 Line - дополнительный уровень 88%
Расширения Фибоначчи
Доступно 6 настраиваемых уровней расширения:
Ext#1 (по умолчанию 1.0)
Ext#2 (по умолчанию 1.27)
Ext#3 (по умолчанию 1.62)
Ext#4 (по умолчанию 2.0)
Ext#5 (по умолчанию 2.62)
Ext#6 (по умолчанию 3.62)
Для каждого уровня можно настроить:
Включение/выключение
Цвет
Значение
Оповещения
Индикатор предоставляет следующие типы оповещений:
Вход/выход из зон OTE:
Вход в зону OTE 70%
Выход из зоны OTE 70%
Вход в зону OTE 30%
Выход из зоны OTE 30%
Пересечение дополнительных уровней:
Пересечение уровня 29.5%
Пересечение уровня 70.5%
Пересечение уровня 88%
Достижение уровней расширения Фибоначчи:
Оповещения для каждого настроенного уровня расширения
Поддержка как положительных, так и отрицательных расширений
Использование
Добавьте индикатор на график
Настройте необходимые параметры отображения
При необходимости установите оповещения
Используйте зоны OTE для определения потенциальных точек входа в рынок
Примечания
Индикатор автоматически обновляется при изменении видимой области графика
При использовании пользовательского диапазона дат убедитесь, что выбранный период содержит данные
Для корректной работы с высшим таймфреймом убедитесь в доступности исторических данных
Intraday Volume### Intraday Volume Indicator Explanation
--- this was Mostly created by OpenAI ChatGPT --- it's pretty good!
--- My Commentary: One of the problems I find is with Volume is - it is skewed by the overwhelming volume around the Open and Close. So, as an experiment, I asked ChatGPT to create an indicator to plot the volume everywhere BUT the open.
I added in the CandleColor() function and set the times.
I also changed the Intraday Volume calculation from Cumulative to live.
still Chat GPT - did about 90% of the heavy lift! And, wrote the summary !
----
The "Intraday Volume" indicator is a custom script designed for use on the TradingView platform. It provides a visual representation of the total accumulated trading volume during the intraday trading session, specifically between the market open and close times. Below is a detailed explanation of its functionality:
#### **Key Features:**
1. **Session Times:**
- The indicator defines the intraday session as the period between 9:30 AM EST (market open) and 4:00 PM EST (market close).
- It uses the `timestamp` function to set these times dynamically for each trading day.
2. **Intraday Volume Calculation:**
- During the defined intraday session, the indicator accumulates the trading volume from each bar (candlestick).
- Outside the intraday session, the volume is reset to `na` (not available) to ensure only intraday data is plotted.
3. **Plotting the Volume:**
- The accumulated intraday volume is plotted as a blue column chart in a separate pane below the price chart.
- This provides a clear visualization of how the trading volume evolves throughout the trading session.
4. **Horizontal Reference Line:**
- A horizontal line is added at zero as a visual reference, making it easier to interpret the volume data.
#### **Use Cases:**
- **Volume Analysis:**
- Traders can use the indicator to identify periods of high or low trading activity during the intraday session.
- Peaks in the volume chart may correspond to key market events, such as news releases or significant price movements.
- **Trend Confirmation:**
- Comparing intraday volume with price action can help traders confirm the strength of a trend or the likelihood of a reversal.
- **Custom Time Frames:**
- Although this script is tailored for regular U.S. market hours, it can be adapted for other markets or time zones by modifying the session times.
#### **Customization:**
- **Colors and Styles:**
- The plot color (blue) and style (columns) can be customized to suit user preferences.
- **Session Times:**
- Users can change the session start and end times to match their trading needs or regional market hours.
This indicator is especially useful for intraday traders seeking insights into trading volume dynamics within the trading day. By visualizing the intraday volume, traders can gain a deeper understanding of market behavior and make informed decisions.
Volume Delta Candles HTF [TradingFinder] LTF Volume Candles 🔵 Introduction
In financial markets, understanding the concepts of supply and demand and their impact on price movements is of paramount importance. Supply and demand, as fundamental pillars of economics, reflect the interaction between buyers and sellers.
When buyers' strength surpasses that of sellers, demand increases, and prices tend to rise. Conversely, when sellers dominate buyers, supply overtakes demand, causing prices to drop. These interactions play a crucial role in determining market trends, price reversal points, and trading decisions.
Volume Delta Candles offer traders a practical way to visualize trading activity within each candlestick. By integrating data from lower timeframes or live market feeds, these candles eliminate the need for standalone volume indicators.
They present the proportions of buying and selling volume as intuitive colored bars, making it easier to interpret market dynamics at a glance. Additionally, they encapsulate critical metrics like peak delta, lowest delta, and net delta, allowing traders to grasp the market's internal order flow with greater precision.
In financial markets, grasping the interplay between supply and demand and its influence on price movements is crucial for successful trading. These fundamental economic forces reflect the ongoing balance between buyers and sellers in the market.
When buyers exert greater strength than sellers, demand dominates, driving prices upward. Conversely, when sellers take control, supply surpasses demand, and prices decline. Understanding these dynamics is essential for identifying market trends, pinpointing reversal points, and making informed trading decisions.
Volume Delta Candles provide an innovative method for evaluating trading activity within individual candlesticks, offering a simplified view without relying on separate volume indicators. By leveraging lower timeframe or real-time data, this tool visualizes the distribution of buying and selling volumes within a candle through color-coded bars.
This visual representation enables traders to quickly assess market sentiment and understand the forces driving price action. Buyer and seller strength is a critical concept that focuses on the ratio of buying to selling volumes. This ratio not only provides insights into the market's current state but also serves as a leading indicator for detecting potential shifts in trends.
Traders often rely on volume analysis to identify significant supply and demand zones, guiding their entry and exit strategies. Delta Candles translate these complex metrics, such as Maximum Delta, Minimum Delta, and Final Delta, into an easy-to-read visual format using Japanese candlestick structures, making them an invaluable resource for analyzing order flows and market momentum.
By merging the principles of supply and demand with comprehensive volume analysis, tools like the indicator introduced here offer unparalleled clarity into market behavior. This indicator calculates the relative strength of supply and demand for each candlestick by analyzing the ratio of buyers to sellers.
🔵 How to Use
The presented indicator is a powerful tool for analyzing supply and demand strength in financial markets. It helps traders identify the strengths and weaknesses of buyers and sellers and utilize this information for better decision-making.
🟣 Analyzing the Highest Volume Trades on Candles
A unique feature of this indicator is the visualization of price levels with the highest trade volume for each candlestick. These levels are marked as black lines on the candles, indicating prices where most trades occurred. This information is invaluable for identifying key supply and demand zones, which often act as support or resistance levels.
🟣 Trend Confirmation
The indicator enables traders to confirm bullish or bearish trends by observing changes in buyer and seller strength. When buyer strength increases and demand surpasses supply, the likelihood of a bullish trend continuation grows. Conversely, decreasing buyer strength and increasing seller strength may signal a potential bearish trend reversal.
🟣 Adjusting Timeframes and Calculation Methods
Users can customize the indicator's candlestick timeframe to align with their trading strategy. Additionally, they can switch between moving average and current candle modes to achieve more precise market analysis.
This indicator, with its accurate and visual data display, is a practical and reliable tool for market analysts and traders. Using it can help traders make better decisions and identify optimal entry and exit points.
🔵 Settings
Lower Time Frame Volume : This setting determines which timeframe the indicator should use to identify the price levels with the highest trade volume. These levels, displayed as black lines on the candlesticks, indicate prices where the most trades occurred.
It is recommended that users align this timeframe with their primary chart’s timeframe.
As a general rule :
If the main chart’s timeframe is low (e.g., 1-minute or 5-minute), it is better to keep this setting at a similarly low timeframe.
As the main chart’s timeframe increases (e.g., daily or weekly), it is advisable to set this parameter to a higher timeframe for more aligned data analysis.
Cumulative Mode :
Current Candle : Strength is calculated only for the current candlestick.
EMA (Exponential Moving Average) : The strength is calculated using an exponential moving average, suitable for identifying longer-term trends.
Calculation Period : The default period for the exponential moving average (EMA) is set to 21. Users can modify this value for more precise analysis based on their specific requirements.
Ultra Data : This option enables users to view more detailed data from various market sources, such as Forex, Crypto, or Stocks. When activated, the indicator aggregates and displays volume data from multiple sources.
🟣 Table Settings
Show Info Table : This option determines whether the information table is displayed on the chart. When enabled, the table appears in a corner of the chart and provides details about the strength of buyers and sellers.
Table Size : Users can adjust the size of the text within the table to improve readability.
Table Position : This setting defines the table’s placement on the chart.
🔵 Conclusion
The indicator introduced in this article is designed as an advanced tool for analyzing supply and demand dynamics in financial markets. By leveraging buyer and seller strength ratios and visually highlighting price levels with the highest trade volume, it aids traders in identifying key market zones.
Key features, such as adjustable analysis timeframes, customizable calculation methods, and precise volume data display, allow users to tailor their analyses to market conditions.
This indicator is invaluable for analyzing support and resistance levels derived from trade volumes, enabling traders to make more accurate decisions about entering or exiting trades.
By utilizing real market data and displaying the highest trade volume lines directly on the chart, it provides a precise perspective on market behavior. These features make it suitable for both novice and professional traders aiming to enhance their analysis and trading strategies.
With this indicator, traders can gain a better understanding of supply and demand dynamics and operate more intelligently in financial markets. By combining volume data with visual analysis, this tool provides a solid foundation for effective decision-making and improved trading performance. Choosing this indicator is a significant step toward refining analysis and achieving success in complex financial markets.
[blackcat] L2 Six Round Positioning█ OVERVIEW
The script is an indicator designed to plot the direction (up, down, no change) of several moving averages (MA) on a separate chart, without overlaying the price data. It calculates Simple Moving Averages (SMA) for 3, 5, 8, 34, 60, 120, and 250 periods and uses conditional logic to determine the color and position of the plotted columns based on whether each MA is increasing, decreasing, or unchanged.
█ LOGICAL FRAMEWORK
The script is structured into three main sections:
1 — Input Parameters: None explicitly defined, but the script uses default settings for the indicator function.
2 — Calculations: Computes Simple Moving Averages (SMA) for seven different periods.
3 — Plotting: Uses conditional logic to plot columns representing the direction of each MA, with positions and colors indicating whether the MA is increasing, decreasing, or unchanged.
The flow of data is straightforward: the script calculates the SMAs, determines their direction, sets the appropriate color, and then plots the columns.
█ CUSTOM FUNCTIONS
• No custom functions are defined in this script. All calculations and plotting are done using built-in Pine Script functions such as ta.sma for SMA calculation and plot for plotting.
█ KEY POINTS AND TECHNIQUES
• Use of ta.sma: The script effectively uses the ta.sma function to calculate Simple Moving Averages for different periods.
• Conditional Logic: The script employs conditional logic (ternary operators) to determine the color and position of the plotted columns based on the direction of each MA.
• Plotting with plot: The plot function is used extensively to display the direction of each MA with different colors and positions.
• Color Transparency: The use of color.new with transparency (e.g., color.new(color.green, 50)) allows for visually distinct colors that are not too overpowering.
█ EXTENDED KNOWLEDGE AND APPLICATIONS
• Modifications: The script could be enhanced by adding input parameters to allow users to customize the periods of the moving averages, colors, and transparency levels.
• Extensions: Similar techniques could be applied to other types of moving averages (e.g., EMA, WMA) or to other technical indicators.
• Strategy Development: This indicator could serve as a component in a larger trading strategy by providing insights into the overall trend direction across multiple timeframes.
• Related Concepts: Understanding of moving averages, conditional logic, and plotting techniques in Pine Script would be beneficial for further development and customization of this script.
Support/Resistance
Custom Moving Average Indicator with MACD, RSI, and Support/Resistance
This indicator is designed to help traders make informed trading decisions by integrating several technical indicators, including moving averages, the Relative Strength Index (RSI), and the Moving Average Convergence Divergence (MACD).
Key Features:
Moving Averages:
This indicator uses simple moving averages (SMAs) for several periods (4, 18, 66, 89, 632, 1000, 1500, 2000, and 3000 bars). This helps to identify the overall trend of the price and potential support and resistance levels.
The color of each moving average line is dynamically changed based on the closing price's position relative to the average; it turns red if the price is above the average and green if the price is below.
Relative Strength Index (RSI):
The RSI is calculated for a 14-bar period, which is a measure of overbought or oversold conditions.
An RSI value above 70 indicates an overbought condition, while a value below 30 indicates an oversold condition.
MACD:
The MACD is calculated using a fast length of 12, a slow length of 26, and a signal length of 9. Crossovers between the MACD line and the signal line indicate momentum shifts.
A crossover of the MACD line above the signal line suggests a potential buy signal, while a crossover below indicates a potential sell signal.
Buy and Sell Signals:
Buy Signal: Triggered when the MACD line crosses above the signal line, the RSI is below 30, the MACD is above 0, and there is high volume.
Sell Signal: Triggered when the MACD line crosses below the signal line, the RSI is above 70, the MACD is below 0, and there is high volume.
Alerts:
The indicator includes alerts that are triggered when buy and sell signals occur, helping traders respond quickly to market opportunities.
How to Trade Using the Indicator (continued):
Trading on Buy Signals:
Look for buy signals when the MACD line crosses above the signal line. Ensure that the RSI is below 30, indicating there is a potential for price recovery from an oversold condition.
Confirm that the volume is above the average, which indicates strong market participation and adds validity to the trade.
Trading on Sell Signals:
Search for sell signals when the MACD line crosses below the signal line. Check that the RSI is above 70 to confirm an overbought condition, implying the price may decline.
As with buy signals, ensure that volume is high to validate the strength of the sell signal.
Risk Management:
Use stop-loss orders to protect your capital. Establish an initial loss threshold based on your risk management strategy.
Continuously monitor the market and new signals and adjust your approach according to your market analysis.
Conclusion:
This combined indicator helps traders make informed decisions by relying on a set of technical tools. To achieve the best results, ensure you integrate the analysis from these indicators with your trading strategies and other techniques.
Feel free to use this explanation as an introduction or guide to inform traders on how to effectively use the indicator. If you have any more questions or need further details, don't hesitate to ask!
lib_divergenceLibrary "lib_divergence"
offers a commonly usable function to detect divergences. This will take the default RSI or other symbols / indicators / oscillators as source data.
divergence(osc, pivot_left_bars, pivot_right_bars, div_min_range, div_max_range, ref_low, ref_high, min_divergence_offset_fraction, min_divergence_offset_dev_len, min_divergence_offset_atr_mul)
Detects Divergences between Price and Oscillator action. For bullish divergences, look at trend lines between lows. For bearish divergences, look at trend lines between highs. (strong) oscillator trending, price opposing it | (medium) oscillator trending, price trend flat | (weak) price opposite trending, oscillator trend flat | (hidden) price trending, oscillator opposing it. Pivot detection is only properly done in oscillator data, reference price data is only compared at the oscillator pivot (speed optimization)
Parameters:
osc (float) : (series float) oscillator data (can be anything, even another instrument price)
pivot_left_bars (simple int) : (simple int) optional number of bars left of a confirmed pivot point, confirming it is the highest/lowest in the range before and up to the pivot (default: 5)
pivot_right_bars (simple int) : (simple int) optional number of bars right of a confirmed pivot point, confirming it is the highest/lowest in the range from and after the pivot (default: 5)
div_min_range (simple int) : (simple int) optional minimum distance to the pivot point creating a divergence (default: 5)
div_max_range (simple int) : (simple int) optional maximum amount of bars in a divergence (default: 50)
ref_low (float) : (series float) optional reference range to compare the oscillator pivot points to. (default: low)
ref_high (float) : (series float) optional reference range to compare the oscillator pivot points to. (default: high)
min_divergence_offset_fraction (simple float) : (simple float) optional scaling factor for the offset zone (xDeviation) around the last oscillator H/L detecting following equal H/Ls (default: 0.01)
min_divergence_offset_dev_len (simple int) : (simple int) optional lookback distance for the deviation detection for the offset zone around the last oscillator H/L detecting following equal H/Ls. Used as well for the ATR that does the equal H/L detection for the reference price. (default: 14)
min_divergence_offset_atr_mul (simple float) : (simple float) optional scaling factor for the offset zone (xATR) around the last price H/L detecting following equal H/Ls (default: 1)
@return A tuple of deviation flags.
EGARCH Volatility Estimator
EGARCH Volatility Estimator (EVE)
Overview:
The EGARCH Volatility Estimator (EVE) is a Pine Script indicator designed to quantify market volatility using the Exponential Generalized Autoregressive Conditional Heteroskedasticity (EGARCH) model. This model captures both symmetric and asymmetric volatility dynamics and provides a robust tool for analyzing market risk and trends.
Key Features:
Core EGARCH Formula:
ln(σ t 2 )=ω+α(∣ϵ t−1 ∣+γ⋅ϵ t−1 )+β⋅ln(σ t−1 2 )
ω (Omega): Captures long-term baseline volatility.
α (Alpha): Measures sensitivity to recent shocks.
γ (Gamma): Incorporates asymmetric effects (e.g., higher volatility during market drops).
β (Beta): Reflects the persistence of historical volatility.
The formula computes log-volatility, which is then converted to actual volatility for interpretation.
Standardized Returns:
The script calculates daily log-returns and standardizes them to measure deviations from expected price changes.
Percentile-Based Volatility Analysis:
Tracks the percentile rank of current volatility over a historical lookback period.
Highlights high, medium, or low volatility zones using dynamic background colors.
Dynamic Normalization:
Maps volatility into a normalized range ( ) for better visual interpretation.
Uses color gradients (green to red) to reflect changing volatility levels.
SMA Integration:
Adds a Simple Moving Average (SMA) of either EGARCH volatility or its percentile for trend analysis.
Interactive Display:
Displays current volatility and its percentile rank in a table for quick reference.
Includes high (75%) and low (25%) volatility threshold lines for actionable insights.
Applications:
Market Risk Assessment: Evaluate current and historical volatility to assess market risk levels.
Quantitative Strategy Development: Incorporate volatility dynamics into trading strategies, particularly for options or risk-managed portfolios.
Trend and Momentum Analysis: Use normalized or smoothed volatility trends to identify potential reversals or breakouts.
Asymmetric Volatility Detection: Highlight periods where downside or upside volatility dominates.
Visualization Enhancements:
Dynamic colors and thresholds make it intuitive to interpret market conditions.
Percentile views provide relative volatility context for historical comparison.
This indicator is a versatile tool for traders and analysts seeking deeper insights into market behavior, particularly in volatility-driven trading strategies.
First day candle high and low of monthThis script is designed to mark the high and low levels of the first candle of each month on the chart. These levels are often considered significant support and resistance zones, as they can represent key liquidity points in the market.
The idea behind this tool is based on the observation that the low of the first monthly candle can act as a critical support level, especially during a bullish market trend. If the price breaks below this low in a bull market, it may indicate a potential manipulation or stop-loss hunting rather than a genuine shift in trend. Similarly, the high of the first monthly candle may serve as a key resistance level, particularly in consolidating or range-bound markets.
By dynamically plotting these levels, the script provides traders with valuable insights into potential liquidity zones and significant market reactions. It allows for customizable line colors and lengths, making it adaptable to various trading styles and preferences.
This tool is particularly useful for traders who wish to align their strategies with institutional market behaviors, as it highlights areas where liquidity is likely to be targeted. Use it as part of your broader analysis to identify potential trade setups, manage risk effectively, and understand market dynamics more comprehensively.
Support and Resistance TrendlinesStrategy:
Support: Identified as the lowest low over a specific period.
Resistance: Identified as the highest high over a specific period.
Dynamic Trendlines: We’ll use the concept of a rolling window to calculate the highest highs and lowest lows over the last n bars (you can adjust the number of bars for more sensitivity).
Explanation:
Lookback Period (length): The number of bars over which we calculate the support and resistance levels. You can adjust this value depending on the timeframe and the sensitivity you want for the trendlines.
Resistance: This is the highest high over the length of bars. We use ta.highest(high, length) to find the highest high within the specified lookback period.
Support: This is the lowest low over the length of bars. We use ta.lowest(low, length) to find the lowest low within the specified lookback period.
Plotting the Lines:
We plot the support and resistance as horizontal lines on the chart using plot().
Additionally, we create dynamic trendlines that update automatically with each new bar. The line.new function creates lines that can be modified dynamically as new price data comes in.
Line Persistence:
The line functions are used to create horizontal lines that persist across bars. The trendlines adjust their position as the bars move forward.
How It Works:
This indicator will automatically detect the highest and lowest prices over the last n bars and draw support (green line) and resistance (red line) levels on the chart.
The trendlines will adjust as the market evolves and provide visual reference points for potential areas of price reversal.
How to Use This Script:
Copy and paste the Pine Script code into the Pine Script Editor on TradingView.
Save the script, and then add it to your chart.
Adjust the Lookback Period input to suit your trading strategy and timeframe.
The support and resistance levels will be drawn dynamically, and the lines will update as new bars form.
Customizations:
You can modify the number of bars (length) used to calculate support and resistance, depending on the timeframes you're interested in.
If you need more advanced trendline drawing (such as drawing trendlines between significant high/low points or automatic adjustment to more complex patterns), you might need to implement more advanced logic using peaks and valleys or price action patterns.
Let me know if you need any further adjustments!
RSI BB StdDev SignalOverview
The RSI BB StdDev Signal Indicator is a powerful tool designed to enhance your trading strategy by combining the Relative Strength Index (RSI) with Bollinger Bands (BB). This unique combination allows traders to identify potential buy and sell signals more accurately by leveraging the strengths of both indicators. The RSI helps in identifying overbought and oversold conditions, while the Bollinger Bands provide a dynamic range to assess volatility and potential price reversals.
Key Features
— RSI Calculation: The indicator calculates the RSI based on user-defined parameters, allowing for customization to fit different trading styles.
— Bollinger Bands Integration: The RSI values are smoothed using a moving average, and Bollinger Bands are applied to this smoothed RSI to generate buy and sell signals.
— Divergence Detection: The indicator includes an optional feature to detect and alert on bullish and bearish divergences between the RSI and price action.
— Customizable Alerts: Users can set up alerts for buy and sell signals, as well as for divergences, ensuring they never miss a trading opportunity.
— Visual Aids: The indicator plots the RSI, Bollinger Bands, and signals on the chart, making it easy to visualize and interpret the data.
How It Works
1. RSI Calculation:
— The RSI is calculated using the change in the source input (default is close price) over a specified period.
— The RSI values are then plotted on the chart with customizable overbought and oversold levels.
2. Smoothing and Bollinger Bands:
— The RSI values are smoothed using a moving average (SMA, EMA, SMMA, WMA, VWMA) selected by the user.
— Bollinger Bands are applied to the smoothed RSI to create dynamic upper and lower bands.
3. Signal Generation:
—Buy signals are generated when the RSI crosses above the lower Bollinger Band.
—Sell signals are generated when the RSI crosses below the upper Bollinger Band.
—These signals are plotted on both the RSI pane and the main price chart for easy reference.
4. Divergence Detection:
— The indicator can detect and alert on regular bullish and bearish divergences between the RSI and price action.
— Bullish divergences occur when the price makes a lower low, but the RSI makes a higher low.
— Bearish divergences occur when the price makes a higher high, but the RSI makes a lower high.
Usage
1. Setting Up:
— Add the indicator to your TradingView chart.
— Customize the RSI length, source, and other parameters in the settings panel.
— Enable or disable the divergence detection based on your trading strategy.
2. Interpreting Signals:
— Use the buy and sell signals generated by the RSI crossing the Bollinger Bands as potential entry and exit points.
— Pay attention to divergences for additional confirmation of trend reversals.
3. Alerts:
— Set up alerts for buy and sell signals to receive notifications in real-time.
— Enable divergence alerts to be notified of potential trend reversals.
Conclusion
The RSI BB StdDev Signal Indicator is a comprehensive tool that combines the strengths of the RSI and Bollinger Bands to provide traders with more accurate and reliable signals. Whether you are a beginner or an experienced trader, this indicator can enhance your trading strategy by offering clear visual cues and customizable alerts.
Note
This indicator is provided with open-source code, allowing users to understand its logic and customize it further if needed. The detailed description and customizable settings ensure that traders of all levels can benefit from its unique features.
VWAP Direction HistogramThe ** VWAP Direction Histogram ** indicator is a powerful tool for traders looking to gauge the directional bias of the Volume Weighted Average Price (VWAP). VWAP is a critical metric that combines price and volume to provide a weighted average price, often used to identify institutional trading activity and support/resistance levels. This indicator builds upon the traditional VWAP by calculating its directional changes over a customizable lookback period, providing clear visual cues to traders through a color-coded histogram.
By identifying whether VWAP is rising or falling over the specified lookback period, this indicator helps traders determine the prevailing trend bias in the market. A positive VWAP direction suggests upward momentum and a bullish trend bias, while a negative direction indicates downward momentum and bearish sentiment. This information is further reinforced by coloring the chart candles based on the VWAP trend, enabling quick visual analysis and enhancing decision-making for trend-following strategies. Whether you're trading intraday or longer-term, the ** VWAP Direction Histogram ** offers an intuitive and effective way to align your trades with market trends.
QTALibrary "QTA"
This is simple library for basic Quantitative Technical Analysis for retail investors. One example of it being used can be seen here ().
calculateKellyRatio(returns)
Parameters:
returns (array) : An array of floats representing the returns from bets.
Returns: The calculated Kelly Ratio, which indicates the optimal bet size based on winning and losing probabilities.
calculateAdjustedKellyFraction(kellyRatio, riskTolerance, fedStance)
Parameters:
kellyRatio (float) : The calculated Kelly Ratio.
riskTolerance (float) : A float representing the risk tolerance level.
fedStance (string) : A string indicating the Federal Reserve's stance ("dovish", "hawkish", or neutral).
Returns: The adjusted Kelly Fraction, constrained within the bounds of .
calculateStdDev(returns)
Parameters:
returns (array) : An array of floats representing the returns.
Returns: The standard deviation of the returns, or 0 if insufficient data.
calculateMaxDrawdown(returns)
Parameters:
returns (array) : An array of floats representing the returns.
Returns: The maximum drawdown as a percentage.
calculateEV(avgWinReturn, winProb, avgLossReturn)
Parameters:
avgWinReturn (float) : The average return from winning bets.
winProb (float) : The probability of winning a bet.
avgLossReturn (float) : The average return from losing bets.
Returns: The calculated Expected Value of the bet.
calculateTailRatio(returns)
Parameters:
returns (array) : An array of floats representing the returns.
Returns: The Tail Ratio, or na if the 5th percentile is zero to avoid division by zero.
calculateSharpeRatio(avgReturn, riskFreeRate, stdDev)
Parameters:
avgReturn (float) : The average return of the investment.
riskFreeRate (float) : The risk-free rate of return.
stdDev (float) : The standard deviation of the investment's returns.
Returns: The calculated Sharpe Ratio, or na if standard deviation is zero.
calculateDownsideDeviation(returns)
Parameters:
returns (array) : An array of floats representing the returns.
Returns: The standard deviation of the downside returns, or 0 if no downside returns exist.
calculateSortinoRatio(avgReturn, downsideDeviation)
Parameters:
avgReturn (float) : The average return of the investment.
downsideDeviation (float) : The standard deviation of the downside returns.
Returns: The calculated Sortino Ratio, or na if downside deviation is zero.
calculateVaR(returns, confidenceLevel)
Parameters:
returns (array) : An array of floats representing the returns.
confidenceLevel (float) : A float representing the confidence level (e.g., 0.95 for 95% confidence).
Returns: The Value at Risk at the specified confidence level.
calculateCVaR(returns, varValue)
Parameters:
returns (array) : An array of floats representing the returns.
varValue (float) : The Value at Risk threshold.
Returns: The average Conditional Value at Risk, or na if no returns are below the threshold.
calculateExpectedPriceRange(currentPrice, ev, stdDev, confidenceLevel)
Parameters:
currentPrice (float) : The current price of the asset.
ev (float) : The expected value (in percentage terms).
stdDev (float) : The standard deviation (in percentage terms).
confidenceLevel (float) : The confidence level for the price range (e.g., 1.96 for 95% confidence).
Returns: A tuple containing the minimum and maximum expected prices.
calculateRollingStdDev(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling standard deviation of returns.
calculateRollingVariance(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling variance of returns.
calculateRollingMean(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling mean of returns.
calculateRollingCoefficientOfVariation(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling coefficient of variation of returns.
calculateRollingSumOfPercentReturns(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling sum of percent returns.
calculateRollingCumulativeProduct(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling cumulative product of returns.
calculateRollingCorrelation(priceReturns, volumeReturns, window)
Parameters:
priceReturns (array) : An array of floats representing the price returns.
volumeReturns (array) : An array of floats representing the volume returns.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling correlation.
calculateRollingPercentile(returns, window, percentile)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
percentile (int) : An integer representing the desired percentile (0-100).
Returns: An array of floats representing the rolling percentile of returns.
calculateRollingMaxMinPercentReturns(returns, window)
Parameters:
returns (array) : An array of floats representing the returns.
window (int) : An integer representing the rolling window size.
Returns: A tuple containing two arrays: rolling max and rolling min percent returns.
calculateRollingPriceToVolumeRatio(price, volData, window)
Parameters:
price (array) : An array of floats representing the price data.
volData (array) : An array of floats representing the volume data.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the rolling price-to-volume ratio.
determineMarketRegime(priceChanges)
Parameters:
priceChanges (array) : An array of floats representing the price changes.
Returns: A string indicating the market regime ("Bull", "Bear", or "Neutral").
determineVolatilityRegime(price, window)
Parameters:
price (array) : An array of floats representing the price data.
window (int) : An integer representing the rolling window size.
Returns: An array of floats representing the calculated volatility.
classifyVolatilityRegime(volatility)
Parameters:
volatility (array) : An array of floats representing the calculated volatility.
Returns: A string indicating the volatility regime ("Low" or "High").
method percentPositive(thisArray)
Returns the percentage of positive non-na values in this array.
This method calculates the percentage of positive values in the provided array, ignoring NA values.
Namespace types: array
Parameters:
thisArray (array)
_candleRange()
_PreviousCandleRange(barsback)
Parameters:
barsback (int) : An integer representing how far back you want to get a range
redCandle()
greenCandle()
_WhiteBody()
_BlackBody()
HighOpenDiff()
OpenLowDiff()
_isCloseAbovePreviousOpen(length)
Parameters:
length (int)
_isCloseBelowPrevious()
_isOpenGreaterThanPrevious()
_isOpenLessThanPrevious()
BodyHigh()
BodyLow()
_candleBody()
_BodyAvg(length)
_BodyAvg function.
Parameters:
length (simple int) : Required (recommended is 6).
_SmallBody(length)
Parameters:
length (simple int) : Length of the slow EMA
Returns: a series of bools, after checking if the candle body was less than body average.
_LongBody(length)
Parameters:
length (simple int)
bearWick()
bearWick() function.
Returns: a SERIES of FLOATS, checks if it's a blackBody(open > close), if it is, than check the difference between the high and open, else checks the difference between high and close.
bullWick()
barlength()
sumbarlength()
sumbull()
sumbear()
bull_vol()
bear_vol()
volumeFightMA()
volumeFightDelta()
weightedAVG_BullVolume()
weightedAVG_BearVolume()
VolumeFightDiff()
VolumeFightFlatFilter()
avg_bull_vol(userMA)
avg_bull_vol(int) function.
Parameters:
userMA (int)
avg_bear_vol(userMA)
avg_bear_vol(int) function.
Parameters:
userMA (int)
diff_vol(userMA)
diff_vol(int) function.
Parameters:
userMA (int)
vol_flat(userMA)
vol_flat(int) function.
Parameters:
userMA (int)
_isEngulfingBullish()
_isEngulfingBearish()
dojiup()
dojidown()
EveningStar()
MorningStar()
ShootingStar()
Hammer()
InvertedHammer()
BearishHarami()
BullishHarami()
BullishBelt()
BullishKicker()
BearishKicker()
HangingMan()
DarkCloudCover()