RSI Candle with Advanced RSI fomulaRSI Advanced
As the period value is longer than 14, the RSI value sticks to the value of 50 and becomes useless.
Also, when the period value is less than 14, it moves excessively, so it is difficult for us to see the movement of the RSI.
So, using the period value and the RSI value as variables, I tried to make it easier to identify the RSI value through a new function expression.
This is how RSI Advanced was developed.
Period values below 14 reduce the volatility of RSI, and period values greater than 14 allow wider fluctuations, allowing overbought and oversold zones to work properly and give you a better view of the trend.
I also changed the RSI by applying the appropriate function expression so that the RSI with a period value of 168 (=14*12) on a 5 minute timeframe has the same value as the RSI on a 60 minute timeframe with a period value of 14.
As another example, an RSI with a period value of 56 (=14*4) in a 15-minute time frame has the same value as an RSI with a period value of 14 in a 60-minute time frame.
Compare the difference in the RSI with a period value of 200 in the snapshot.
------------------------------------------------------------------------------------------
RSI Candlestick
RSI derives its value using only the closing price as a variable. I solved the RSI equation in reverse and tried to include the high and low prices of candlesticks in the equation.
As a result, 'if the high or low was the closing price, the value of RSI would be like this' was implemented. Just like when a candle comes down after setting a high price, an upper tail is formed when RSI Candle goes down after setting a high price!!
In divergence, we had to look only at the relationship between closing prices, but if we use RSI candles, we can find divergences in highs and highs, and lows and lows.
Then enjoy my RSI!
----------------------------------------------------------------------------------------
RSI Advanced
기간값이 14보다 길어질수록 RSI값은 50값에 달라붙게되어서 쓸모가 없어집니다.
또 기간값이 14보다 줄어들수록 과도하게 움직여서 우리는 RSI의 움직임을 보기가 힘듭니다.
그래서 기간 값과 RSI 값을 변수로 사용하여 새로운 함수 식을 통해 RSI 값을 식별하기 편하도록 해보았습니다.
이렇게 RSI Advanced가 개발되었습니다.
기간값이 14보다 낮으면 rsi의 변동폭이 줄어들고, 기간값이 14보다 크면 변동폭이 넓어져 과매수 및 과매도 영역이 제대로 작동하여 추세를 더 잘 볼 수 있습니다.
또한 저는 5분 타임프레임의 기간값이 168(=14*12)인 RSI가 주기 값이 14인 60분 타임프레임의 RSI와 동일한 값을 갖도록 적절한 함수 표현식을 적용하여 RSI를 변경했습니다.
다른 예로, 15분 시간 프레임에서 기간값이 56(=14*4)인 RSI는 60분 시간 프레임의 기간값이 14인 RSI와 동일한 값을 갖습니다.
기간값이 200인 RSI의 차이를 스냅샷에서 비교해보십시오.
-----------------------------
RSI Candlestick
RSI는 종가만을 변수로 사용하여 값을 도출해냅니다. 저는 RSI 식을 역으로 풀어내어서 캔들스틱의 고가와 저가를 식에 포함시켜보았습니다.
결과적으로, '만약 고가나 저가가 종가였다면 RSI의 값이 이럴것이다'를 구현해내었습니다. 캔들이 고가를 찍고 내려오면 윗꼬리가 생기듯 RSI Candle에서도 고가를 찍고 내려오면 윗꼬리가 생기는겁니다!!
다이버전스 또한 원래는 종가끼리의 관계만 봐야했지만 RSI 캔들을 이용한다면 고가와 고가, 저가와 저가에서도 다이버전스를 발견할 수 있습니다.
그럼 잘 사용해주십시오!!!
Komut dosyalarını "市值60亿的股票" için ara
Modified RSI Multi-Time Frame (HM)Effective RSI with Multi-Timeframe with Hilema - Milega(HM) concept (HM=WMA -EMA). RSI Script is included with WMA and EMA band for RSI1 and it works very simple
i) When the RSI band turns to Green its a Buy signal. Normally whenever Bearish strength weakens and move towards the Bullish area, the WMA and EMA cross each other and that tends to provide a possible trend change. A trade at crossover normally provides a very good trading oppertunity. One can combine with some other Price action if needed for double confirmation.
ii)When RSI band turns to RED its a Sell signal. As explained in the point 1 , its a vice-versa where a crossover of WMA and EMA is perfect entry to get a good swing trade. Once can combine this tool with Price action for double confirmation.
iii) Using the Multi timeframe user could able to find the trend at higher timeframe to take double confirm on the trend strength and take a perfect oppertunity to take the trade.
By default, script uses the RSI with length 14, WMA 21 and EMA 3 which perfectly working for Index in NSE. Please change as per your requirement.
Apart from the above band, RSI is not have the different levels like 20/ 40 /50/60/80
Multi-timeframes currently set as
RSI1 - Same as Chart
RSI2 - 15 Min
RSI3 - 60 Min
RSI4 - Daily
Script has enabled the option to change the values for these timeframes as per the user requirement.
These ranges can be interpreted and acts as a probable swing points based on the trend and momentum.
40-60 - Neutral Range or Sideways
20 - 60 Bearish range
40 - 70 - Bullish range
Below 20 -- Over Sold Zone
Above 80 - over Bought zone
Also, the crossovers of the WMA and EMA on the RSI gives a very good momentum towards that trend.
[kai]Futility RatioAn indicator that measures movement inefficiency
Inefficient movement, that is, the range market becomes a high number, the limit is reached at about 60 and a trend occurs
When the range breaks and a trend occurs, the inefficiency drops to about 40 and many trends end.
The full-scale trend goes down further and goes down to about 25, which is evaluated as an efficient movement, the limit is reached and the trend ends.
As for how to use this Inge, the direction of the trend needs to be considered in other ways.
Create a position when you reach 60
Position closed or contrarian at 40 or 25
I assume the usage
動きの非効率性を測定するインジケーターです
非効率な動きをするつまりレンジ相場は高い数字になって、60程度で限界が訪れてトレンドが発生します
レンジがブレイクしトレンドが発生すると40程度まで非効率性は下がりって多くのトレンドは終了します
本格的なトレンドはさらに下がっていって効率的な動きと評価される25程度まで下がって限界が訪れてトレンドが終了します
このインジの使い方はトレンドの方向は他の方法で考える必要がありますが
60まで上がったときにポジション作成
40又は25でポジションクローズ又は逆張り
という使い方を想定しています
Waindrops [Makit0]█ OVERALL
Plot waindrops (custom volume profiles) on user defined periods, for each period you get high and low, it slices each period in half to get independent vwap, volume profile and the volume traded per price at each half.
It works on intraday charts only, up to 720m (12H). It can plot balanced or unbalanced waindrops, and volume profiles up to 24H sessions.
As example you can setup unbalanced periods to get independent volume profiles for the overnight and cash sessions on the futures market, or 24H periods to get the full session volume profile of EURUSD
The purpose of this indicator is twofold:
1 — from a Chartist point of view, to have an indicator which displays the volume in a more readable way
2 — from a Pine Coder point of view, to have an example of use for two very powerful tools on Pine Script:
• the recently updated drawing limit to 500 (from 50)
• the recently ability to use drawings arrays (lines and labels)
If you are new to Pine Script and you are learning how to code, I hope you read all the code and comments on this indicator, all is designed for you,
the variables and functions names, the sometimes too big explanations, the overall structure of the code, all is intended as an example on how to code
in Pine Script a specific indicator from a very good specification in form of white paper
If you wanna learn Pine Script form scratch just start HERE
In case you have any kind of problem with Pine Script please use some of the awesome resources at our disposal: USRMAN , REFMAN , AWESOMENESS , MAGIC
█ FEATURES
Waindrops are a different way of seeing the volume and price plotted in a chart, its a volume profile indicator where you can see the volume of each price level
plotted as a vertical histogram for each half of a custom period. By default the period is 60 so it plots an independent volume profile each 30m
You can think of each waindrop as an user defined candlestick or bar with four key values:
• high of the period
• low of the period
• left vwap (volume weighted average price of the first half period)
• right vwap (volume weighted average price of the second half period)
The waindrop can have 3 different colors (configurable by the user):
• GREEN: when the right vwap is higher than the left vwap (bullish sentiment )
• RED: when the right vwap is lower than the left vwap (bearish sentiment )
• BLUE: when the right vwap is equal than the left vwap ( neutral sentiment )
KEY FEATURES
• Help menu
• Custom periods
• Central bars
• Left/Right VWAPs
• Custom central bars and vwaps: color and pixels
• Highly configurable volume histogram: execution window, ticks, pixels, color, update frequency and fine tuning the neutral meaning
• Volume labels with custom size and color
• Tracking price dot to be able to see the current price when you hide your default candlesticks or bars
█ SETTINGS
Click here or set any impar period to see the HELP INFO : show the HELP INFO, if it is activated the indicator will not plot
PERIOD SIZE (max 2880 min) : waindrop size in minutes, default 60, max 2880 to allow the first half of a 48H period as a full session volume profile
BARS : show the central and vwap bars, default true
Central bars : show the central bars, default true
VWAP bars : show the left and right vwap bars, default true
Bars pixels : width of the bars in pixels, default 2
Bars color mode : bars color behavior
• BARS : gets the color from the 'Bars color' option on the settings panel
• HISTOGRAM : gets the color from the Bearish/Bullish/Neutral Histogram color options from the settings panel
Bars color : color for the central and vwap bars, default white
HISTOGRAM show the volume histogram, default true
Execution window (x24H) : last 24H periods where the volume funcionality will be plotted, default 5
Ticks per bar (max 50) : width in ticks of each histogram bar, default 2
Updates per period : number of times the histogram will update
• ONE : update at the last bar of the period
• TWO : update at the last bar of each half period
• FOUR : slice the period in 4 quarters and updates at the last bar of each of them
• EACH BAR : updates at the close of each bar
Pixels per bar : width in pixels of each histogram bar, default 4
Neutral Treshold (ticks) : delta in ticks between left and right vwaps to identify a waindrop as neutral, default 0
Bearish Histogram color : histogram color when right vwap is lower than left vwap, default red
Bullish Histogram color : histogram color when right vwap is higher than left vwap, default green
Neutral Histogram color : histogram color when the delta between right and left vwaps is equal or lower than the Neutral treshold, default blue
VOLUME LABELS : show volume labels
Volume labels color : color for the volume labels, default white
Volume Labels size : text size for the volume labels, choose between AUTO, TINY, SMALL, NORMAL or LARGE, default TINY
TRACK PRICE : show a yellow ball tracking the last price, default true
█ LIMITS
This indicator only works on intraday charts (minutes only) up to 12H (720m), the lower chart timeframe you can use is 1m
This indicator needs price, time and volume to work, it will not work on an index (there is no volume), the execution will not be allowed
The histogram (volume profile) can be plotted on 24H sessions as limit but you can plot several 24H sessions
█ ERRORS AND PERFORMANCE
Depending on the choosed settings, the script performance will be highly affected and it will experience errors
Two of the more common errors it can throw are:
• Calculation takes too long to execute
• Loop takes too long
The indicator performance is highly related to the underlying volatility (tick wise), the script takes each candlestick or bar and for each tick in it stores the price and volume, if the ticker in your chart has thousands and thousands of ticks per bar the indicator will throw an error for sure, it can not calculate in time such amount of ticks.
What all of that means? Simply put, this will throw error on the BITCOIN pair BTCUSD (high volatility with tick size 0.01) because it has too many ticks per bar, but lucky you it will work just fine on the futures contract BTC1! (tick size 5) because it has a lot less ticks per bar
There are some options you can fine tune to boost the script performance, the more demanding option in terms of resources consumption is Updates per period , by default is maxed out so lowering this setting will improve the performance in a high way.
If you wanna know more about how to improve the script performance, read the HELP INFO accessible from the settings panel
█ HOW-TO SETUP
The basic parameters to adjust are Period size , Ticks per bar and Pixels per bar
• Period size is the main setting, defines the waindrop size, to get a better looking histogram set bigger period and smaller chart timeframe
• Ticks per bar is the tricky one, adjust it differently for each underlying (ticker) volatility wise, for some you will need a low value, for others a high one.
To get a more accurate histogram set it as lower as you can (min value is 1)
• Pixels per bar allows you to adjust the width of each histogram bar, with it you can adjust the blank space between them or allow overlaping
You must play with these three parameters until you obtain the desired histogram: smoother, sharper, etc...
These are some of the different kind of charts you can setup thru the settings:
• Balanced Waindrops (default): charts with waindrops where the two halfs are of same size.
This is the default chart, just select a period (30m, 60m, 120m, 240m, pick your poison), adjust the histogram ticks and pixels and watch
• Unbalanced Waindrops: chart with waindrops where the two halfs are of different sizes.
Do you trade futures and want to plot a waindrop with the first half for the overnight session and the second half for the cash session? you got it;
just adjust the period to 1860 for any CME ticker (like ES1! for example) adjust the histogram ticks and pixels and watch
• Full Session Volume Profile: chart with waindrops where only the first half plots.
Do you use Volume profile to analize the market? Lucky you, now you can trick this one to plot it, just try a period of 780 on SPY, 2760 on ES1!, or 2880 on EURUSD
remember to adjust the histogram ticks and pixels for each underlying
• Only Bars: charts with only central and vwap bars plotted, simply deactivate the histogram and volume labels
• Only Histogram: charts with only the histogram plotted (volume profile charts), simply deactivate the bars and volume labels
• Only Volume: charts with only the raw volume numbers plotted, simply deactivate the bars and histogram
If you wanna know more about custom full session periods for different asset classes, read the HELP INFO accessible from the settings panel
EXAMPLES
Full Session Volume Profile on MES 5m chart:
Full Session Unbalanced Waindrop on MNQ 2m chart (left side Overnight session, right side Cash Session):
The following examples will have the exact same charts but on four different tickers representing a futures contract, a forex pair, an etf and a stock.
We are doing this to be able to see the different parameters we need for plotting the same kind of chart on different assets
The chart composition is as follows:
• Left side: Volume Labels chart (period 10)
• Upper Right side: Waindrops (period 60)
• Lower Right side: Full Session Volume Profile
The first example will specify the main parameters, the rest of the charts will have only the differences
MES :
• Left: Period size: 10, Bars: uncheck, Histogram: uncheck, Execution window: 1, Ticks per bar: 2, Updates per period: EACH BAR,
Pixels per bar: 4, Volume labels: check, Track price: check
• Upper Right: Period size: 60, Bars: check, Bars color mode: HISTOGRAM, Histogram: check, Execution window: 2, Ticks per bar: 2,
Updates per period: EACH BAR, Pixels per bar: 4, Volume labels: uncheck, Track price: check
• Lower Right: Period size: 2760, Bars: uncheck, Histogram: check, Execution window: 1, Ticks per bar: 1, Updates per period: EACH BAR,
Pixels per bar: 2, Volume labels: uncheck, Track price: check
EURUSD :
• Upper Right: Ticks per bar: 10
• Lower Right: Period size: 2880, Ticks per bar: 1, Pixels per bar: 1
SPY :
• Left: Ticks per bar: 3
• Upper Right: Ticks per bar: 5, Pixels per bar: 3
• Lower Right: Period size: 780, Ticks per bar: 2, Pixels per bar: 2
AAPL :
• Left: Ticks per bar: 2
• Upper Right: Ticks per bar: 6, Pixels per bar: 3
• Lower Right: Period size: 780, Ticks per bar: 1, Pixels per bar: 2
█ THANKS TO
PineCoders for all they do, all the tools and help they provide and their involvement in making a better community
scarf for the idea of coding a waindrops like indicator, I did not know something like that existed at all
All the Pine Coders, Pine Pros and Pine Wizards, people who share their work and knowledge for the sake of it and helping others, I'm very grateful indeed
I'm learning at each step of the way from you all, thanks for this awesome community;
Opensource and shared knowledge: this is the way! (said with canned voice from inside my helmet :D)
█ NOTE
This description was formatted following THIS guidelines
═════════════════════════════════════════════════════════════════════════
I sincerely hope you enjoy reading and using this work as much as I enjoyed developing it :D
GOOD LUCK AND HAPPY TRADING!
EulerMethod: DeltaEN
Shows the Integral Volume Delta (IVD)
It is a detailed OBV. Each bar sums up the volume for bars of a shorter timeframe.
For example, inside a 1M bar, every 12h bar is added up, and inside a 1h bar, every 1min bar is added. Thus, a conditional volume delta inside the bar is obtained.
The indicator for each bar shows the volume of purchases (positive), sales (negative) and the difference — IVD
The delta histogram is thicker than the volume histograms
Settings detalisation
M — 6 hours, 12 hours and 1 day for the M timeframe (720 by default)
W — 4 hours, 6 hours and 12 hours for the W timeframe (240 by default)
D — 30 minutes, 1 hour and 2 hours for the D timeframe (60 by default)
H — 1 minute, 5 minutes and 15 minutes for timeframes [1h, D) (default is 1)
For timeframes of 15m and less, the calculation is carried out by minute bars
VSA mode
The classic OBV adds volume to the cumulative sum under the condition Сlose (n) > Close (n-1) and subtracts it under the condition Close (n) < Close (n-1)
When VSA mode is disabled, all volumes are summed up under these conditions.
When the VSA approximation is turned on, the volume per bar of detail is divided by the factor (Close - Low) / (High - Low)
That is, it takes into account the spread per bar and closing relative to the spread. VSA is enabled by default
A/D mode
Shows the cumulative Accumulation / Distribution Index
The delta of the detail bar is multiplied by (High + Low + Close) / 3 bars, the result is added to the cumulative sum
No additional price conversions required due to integral summation
Index line view is customizable
EM Delta does not receive intermediate values in real time.
To see the result, wait until the bar closes or switch to a smaller timeframe
RU
Показывает Интегральную Дельту Объёма (ИДО)
Представляет собой детализированный OBV. В каждом баре суммируется объём за бары меньшего таймфрейма.
Например, внутри 1М-бара суммируется каждый 12h-бар, а внутри 1h — каждый 1m-бар. Таким образом получается условная дельта объёма внутри бара
Индикатор на каждый бар показывает объём покупок (положительный), объём продаж (отрицательный) и разницу — ИДО
Гистограмма дельты толще гистограмм объёмов
Настройки детализации внутри бара
M — 6 часов, 12 часов и 1 день для таймфрейма M (по-умолчанию 720)
W — 4 часа, 6 часов и 12 часов для таймфрейма W (по-умолчанию 240)
D — 30 минут, 1 час и 2 часа для таймфрейма D (по-умолчанию 60)
H — 1 минута, 5 минут и 15 минут для таймфреймов [1h, D) (по-умолчанию 1)
Для таймфреймов 15m и меньше расчёт ведётся по минутным барам
Режим VSA
Классический OBV прибавляет объём к кумулятивной сумме при условии Сlose(n) > Close(n-1) и отнимает при условии Close(n) < Close(n-1)
При отключении режима VSA все объёмы суммируются по этим условиям
При включённой VSA-аппроксимации объём за бар детализации делится по фактору (Close - Low) / (High - Low)
То есть учитывает спред за бар и закрытие относительно спреда. По-умолчанию режим VSA включен
Режим A/D
Показывает кумулятивный индекс Накопления/Распределения
Дельта бара детализации умножается на (High + Low + Close) / 3 бара, результат прибавляется к кумулятивной сумме
Дополнительные преобразования цены не требуются ввиду интегрального суммирования
Вид линии индекса настраивается
EM Delta не получает промежуточные значения в реальном времени.
Чтобы увидеть результат, дождитесь закрытия бара или перейдите на меньший таймфрейм
ICHIMOKU MTFMultiple Time Frame Version of Ichimoku Kinko Hyo Indicator.
Created in 1940's by Goichi Hosoda withe the help of University students in Japan.
Ichimoku is one of the best trend following indicators that works nearly perfect in all markets and time frames.
Ichimoku is originally an built in indicator in Tradingview but there are some problems like:
the indicator hast 5 lines but you can change only 4 parameters in the settings menu of Tradingview Charts which you could only control 3 of the lines effectively. A second problem is that Tradingview preferred to use English titles for the ICHIMOKU lines instead of giving them the most common original Japanese ones. (So I rewrite the indicator)
Kijun Sen (blue line): Also called standard line or base line, this is calculated by averaging the highest high and the lowest low for the past 26 periods.
Tenkan Sen (red line): This is also known as the turning line and is derived by averaging the highest high and the lowest low for the past nine periods.
Chikou Span (Plum line): This is called the lagging line. It is today’s closing price plotted 26 periods behind.
Senkou SpanA (green line): The first Senkou line is calculated by averaging the Tenkan Sen and the Kijun Sen and plotted 26 periods ahead.
Senkou SpanB (purple line):
The second Senkou line is determined by averaging the highest high and the lowest low for the past 52 periods and plotted 26 periods ahead.
PERSONALLY I ADVISE YOU TO USE ICHIMOKU WITH DEAFULT LENGTHS (9,26,26,52,26) IN ORDER FOR STOCK MARKETS AND FOREX MARKETS
FOR CRYPTO YOU'D BETTER USE:
10,30,30,60,30 OR 20,60,60,120,60
THE TRICKY THING IS THAT KEEPING THE 1-3-3-6-3 RATIO CONSTANT IS NECESSARY
Here's a link of my Youtube video explaining ICHIMOKU but unfortunately only in TURKISH:
www.youtube.com
Developed by: Goichi Hosoda
Here's the link to a complete list of all my indicators:
tr.tradingview.com
Ichimoku kullanımı anlattığım detaylı video serisini linkten izleyebilirsiniz:
www.youtube.com
İndikatörü geliştiren: Goichi Hosoda
ICHIMOKU Kinko Hyo by KIVANC fr3762Created in 1940's by Goichi Hosoda withe the help of University students in Japan.
Ichimoku is one of the best trend following indicators that works nearly perfect in all markets and time frames.
Ichimoku is originally an built in indicator in Tradingview but there are some problems like:
the indicator hast 5 lines but you can change only 4 parameters in the settings menu of Tradingview Charts which you could only control 3 of the lines effectively. A second problem is that Tradingview preferred to use English titles for the ICHIMOKU lines instead of giving them the most common original Japanese ones. (So I rewrite the indicator)
Kijun Sen (blue line): Also called standard line or base line, this is calculated by averaging the highest high and the lowest low for the past 26 periods.
Tenkan Sen (red line): This is also known as the turning line and is derived by averaging the highest high and the lowest low for the past nine periods.
Chikou Span (Plum line): This is called the lagging line. It is today’s closing price plotted 26 periods behind.
Senkou SpanA (green line): The first Senkou line is calculated by averaging the Tenkan Sen and the Kijun Sen and plotted 26 periods ahead.
Senkou SpanB (purple line):
The second Senkou line is determined by averaging the highest high and the lowest low for the past 52 periods and plotted 26 periods ahead.
PERSONALLY I ADVISE YOU TO USE ICHIMOKU WITH DEAFULT LENGTHS (9,26,26,52,26) IN ORDER FOR STOCK MARKETS AND FOREX MARKETS
FOR CRYPTO YOU'D BETTER USE:
10,30,30,60,30 OR 20,60,60,120,60
THE TRICKY THING IS THAT KEEPING THE 1-3-3-6-3 RATIO CONSTANT IS NECESSARY
Here's a link of my Youtube video explaining ICHIMOKU but unfortunately only in TURKISH:
www.youtube.com
Developed by: Goichi Hosoda
Money Flow Index + AlertsThis study is based on the work of TV user Beasley Savage ( ) and all credit goes to them.
Changes I've made:
1. Added a visual symbol of an overbought/oversold threshold cross in the form of a red/green circle, respectively. Sometimes it can be hard to see when a cross actually occurs, and if your scaling isn't set up properly you can get misleading visuals. This way removes all doubt. Bear in mind they aren't meant as trading signals, so DO NOT use them as such. Research the MFI if you're unsure, but I use them as an early warning and that particular market/stock is added to my watchlist.
2. Added 60/40 lines as the MFI respects these incredibly well in trends. E.g. in a solid uptrend the MFI won't go below 40, and vice versa. Use the idea of support and resistance levels on the indicator and it'll be a great help. I've coloured the zones. Strong uptrends should stay above 60, strong downtrends should stay below 40. The zone in between 40-60 I've called the transition zone. MFI often stays here in consolidation periods, and in the last leg of a cycle/trend the MFI will often drop into this zone after being above 60 or below 40. This is a great sign that you should get out and start looking to reverse your position. Hopefully it helps to spot divergences as well.
3. Added alerts based on an overbought/oversold cross. Also added an alert for when either condition is triggered, so hopefully that's useful for those struggling with low alert limits. Feel free to change the overbought/oversold levels, the alerts + crossover visual are set to adapt.
Like any indicator, don't use this one alone. It works best paired with indicators/techniques that contradict it. You'll often see a OB/OS cross, and price will continue on it's way for many weeks more. But MFI is a great tool for identifying upcoming trend changes.
Any queries please comment or PM me.
Cheers,
RJR
PT Magic - BTC/ETH Trigger Trend ChangesThis Script shows you how BTC/ETH Percentage change in trends affect coins you trade.
- For ETH market please change BTC in Setting for ETH
What you need it PT Magic:
{
"Name": "BTC1h", // UNIQUE market trend name (to be referenced by your triggers below)
"Platform": "CoinMarketCap", // Platform to grab prices from (Allowed values are: CoinMarketCap, Exchange)
"MaxMarkets": 1, // Number of markets/pairs to analyze sorted by 24h volume
"TrendMinutes": 60 // Number of minutes to build a trend (1440 = 24h, 720 = 12h, 60 = 1h)
},
{
"Name": "ETH1h", // UNIQUE market trend name (to be referenced by your triggers below)
"Platform": "CoinMarketCap", // Platform to grab prices from (Allowed values are: CoinMarketCap, Exchange)
"MaxMarkets": 2, // Number of markets/pairs to analyze sorted by 24h volume
"IgnoredMarkets": "BTC",
"TrendMinutes": 60 // Number of minutes to build a trend (1440 = 24h, 720 = 12h, 60 = 1h)
},
VWAP forex Yesterday Hi/Low update fix This script is an updte fix of an earlier script that stopped functioning when TradingView updated Pine script. This script plots Forex (24 hour session) VWAP, yesterday's high, low, open and close (HLOC),
the day before's HLOC -
Also plots higher timeframe 20 emas
1 minute 5, 15, 60 period 20 ema
5 minute 15, 60 period 20 ema
15 minute 60, 120 , 240 period 20 ema
60 minute 120, 240 period 20 ema
120 minute 240, D period 20 ema
240 minute D period 20 ema
Also signals inside bars (high is less than or equal to the previous bar's high and the low is greater than or equal to the previous low) the : true inside bars have a maroon triangle below the bar as well as a ">" above the bar.
If subsequest bars are inside the last bar before the last true inside bar they also are marked with an ">"
This is probably a slight variation from the way Leaf_West plots the inside bars.
It appears that he marks all bars that are inside the original bar until one a bar has a high or low
outside the original bar. But I would need to see an example on his charts.
The Time Session Glitch and the Fix FX_IDC, COINBASE and BITSTAMP:
The script will correctly default to 1700 hrs to 1700hrs EDT/EST session for FXCM.
Strangely some securities appear to erroneously start their session at 1200 hrs ie. My guess is that they are somehow tied to GMT+0 instead of New York time (GMT+5). See this for yourself by selecting EURUSD using the FXCM exchange (FX:EURUSD) and then EURUSD from the IDC exchange (FX_IDC:EURUSD). The FX-IDC session opening range starts 5 hours before it actually should at 1700 hrs EDT/EST. To correct for this I have implemented an automatic fix (default) and a user selected "5 hour time shift adjust. ment needed on some securities".
There is also a 4 hour time shift button which might be necessary when New York reverts from Eastern Standard Time to Eastern Daylight Time (1 hour difference) in March (and then back again in November). In the default auto adjust mode you will need to select the 1 hour time shift. That is if this glitch still exists at that time.
I have looked at other scripts, other than my own and where the script is available, that need to use information about the opening bar and all have the same time shift issue
COINBASE and BITSTAMP open at 0000 hours GMT. Since I use lines instead of circles or crosses I had to make a small adjustment to plot the lines correctly.
If it needs work let me know.
Jayy
VWAP forex Yesterday Hi/Low switchThis script plots VWAP, yesterday's high, low, open and close (HLOC), the day before's HLOC -
Also plots higher timeframe 20 emas including:
1 minute 5, 15, 60 period 20 ema
5 minute 15, 60 period 20 ema
15 minute 60, 120 , 240 period 20 ema
60 minute 120, 240 period 20 ema
120 minute 240, D period 20 ema
240 minute D period 20 ema
Also signals inside bars (high is less than or equal to the previous
bar's high and the low is greater than or equal to the previous low) the : true inside bars have a maroon triangle below the bar as well as a ">" above the bar.
If subsequent bars are inside the last bar before the last true inside bar they also are marked with an ">"
If you have suggestions let me know.
Jayy
HeikenAshi[1]This is the alert script so you can automate this strategy using AutoView:
Make sure to use
crossing down value 0.9 once per bar (on condition) for this.
For the alert Message if you're using AutoView:
Long GBPUSD
c=order b=short
c=position b=short l=200 t=market
b=long q=0.01 l=200 t=market tp=60 sl=60
Short GBPUSD
c=order b=long
c=position b=long l=200 t=market
b=short q=0.01 l=200 t=market tp=60 sl=60
Price Action Concepts [StratifyTrade]// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © StratifyTrade - formerly know as HunterAlgos
//@version=5
indicator("Price Action Concepts ", shorttitle = "Price Action Concepts ", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100)
//-----------------------------------------------------------------------------{
//Boolean set
//-----------------------------------------------------------------------------{
s_BOS = 0
s_CHoCH = 1
i_BOS = 2
i_CHoCH = 3
i_pp_CHoCH = 4
green_candle = 5
red_candle = 6
s_CHoCHP = 7
i_CHoCHP = 8
boolean =
array.from(
false
, false
, false
, false
, false
, false
, false
, false
, false
)
//-----------------------------------------------------------------------------{
// User inputs
//-----------------------------------------------------------------------------{
show_swing_ms = input.string ("All" , "Swing " , inline = "1", group = "MARKET STRUCTURE" , options = )
show_internal_ms = input.string ("All" , "Internal " , inline = "2", group = "MARKET STRUCTURE" , options = )
internal_r_lookback = input.int (5 , "" , inline = "2", group = "MARKET STRUCTURE" , minval = 2)
swing_r_lookback = input.int (50 , "" , inline = "1", group = "MARKET STRUCTURE" , minval = 2)
ms_mode = input.string ("Manual" , "Market Structure Mode" , inline = "a", group = "MARKET STRUCTURE" , tooltip = " Use selected lenght\n Use automatic lenght" ,options = )
show_mtf_str = input.bool (true , "MTF Scanner" , inline = "9", group = "MARKET STRUCTURE" , tooltip = "Display Multi-Timeframe Market Structure Trend Directions. Green = Bullish. Red = Bearish")
show_eql = input.bool (false , "Show EQH/EQL" , inline = "6", group = "MARKET STRUCTURE")
plotcandle_bool = input.bool (false , "Plotcandle" , inline = "3", group = "MARKET STRUCTURE" , tooltip = "Displays a cleaner colored candlestick chart in place of the default candles. (requires hiding the current ticker candles)")
barcolor_bool = input.bool (false , "Bar Color" , inline = "4", group = "MARKET STRUCTURE" , tooltip = "Color the candle bodies according to market strucutre trend")
i_ms_up_BOS = input.color (#089981 , "" , inline = "2", group = "MARKET STRUCTURE")
i_ms_dn_BOS = input.color (#f23645 , "" , inline = "2", group = "MARKET STRUCTURE")
s_ms_up_BOS = input.color (#089981 , "" , inline = "1", group = "MARKET STRUCTURE")
s_ms_dn_BOS = input.color (#f23645 , "" , inline = "1", group = "MARKET STRUCTURE")
lvl_daily = input.bool (false , "Day " , inline = "1", group = "HIGHS & LOWS MTF")
lvl_weekly = input.bool (false , "Week " , inline = "2", group = "HIGHS & LOWS MTF")
lvl_monthly = input.bool (false , "Month" , inline = "3", group = "HIGHS & LOWS MTF")
lvl_yearly = input.bool (false , "Year " , inline = "4", group = "HIGHS & LOWS MTF")
css_d = input.color (color.blue , "" , inline = "1", group = "HIGHS & LOWS MTF")
css_w = input.color (color.blue , "" , inline = "2", group = "HIGHS & LOWS MTF")
css_m = input.color (color.blue , "" , inline = "3", group = "HIGHS & LOWS MTF")
css_y = input.color (color.blue , "" , inline = "4", group = "HIGHS & LOWS MTF")
s_d = input.string ('⎯⎯⎯' , '' , inline = '1', group = 'HIGHS & LOWS MTF' , options = )
s_w = input.string ('⎯⎯⎯' , '' , inline = '2', group = 'HIGHS & LOWS MTF' , options = )
s_m = input.string ('⎯⎯⎯' , '' , inline = '3', group = 'HIGHS & LOWS MTF' , options = )
s_y = input.string ('⎯⎯⎯' , '' , inline = '4', group = 'HIGHS & LOWS MTF' , options = )
ob_show = input.bool (true , "Show Last " , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volumetric order blocks on the chart \n\n Ammount of volumetric order blocks to show")
ob_num = input.int (5 , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Orderblocks number", minval = 1, maxval = 10)
ob_metrics_show = input.bool (true , "Internal Buy/Sell Activity" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volume metrics that have formed the orderblock")
css_metric_up = input.color (color.new(#089981, 50) , " " , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
css_metric_dn = input.color (color.new(#f23645 , 50) , "" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
ob_swings = input.bool (false , "Swing Order Blocks" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display swing volumetric order blocks")
css_swing_up = input.color (color.new(color.gray , 90) , " " , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
css_swing_dn = input.color (color.new(color.silver, 90) , "" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
ob_filter = input.string ("None" , "Filtering " , inline = "d", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Filter out volumetric order blocks by BOS/CHoCH/CHoCH+", options = )
ob_mitigation = input.string ("Absolute" , "Mitigation " , inline = "4", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Trigger to remove volumetric order blocks", options = )
ob_pos = input.string ("Precise" , "Positioning " , inline = "k", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Position of the Order Block\n Cover the whole candle\n Cover half candle\n Adjust to volatility\n Same as Accurate but more precise", options = )
use_grayscale = input.bool (false , "Grayscale" , inline = "6", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Use gray as basic order blocks color")
use_show_metric = input.bool (true , "Show Metrics" , inline = "7", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show volume associated with the orderblock and his relevance")
use_middle_line = input.bool (true , "Show Middle-Line" , inline = "8", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show mid-line order blocks")
use_overlap = input.bool (true , "Hide Overlap" , inline = "9", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Hide overlapping order blocks")
use_overlap_method = input.string ("Previous" , "Overlap Method " , inline = "Z", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = " Preserve the most recent volumetric order blocks\n\n Preserve the previous volumetric order blocks", options = )
ob_bull_css = input.color (color.new(#089981 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
ob_bear_css = input.color (color.new(#f23645 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
show_acc_dist_zone = input.bool (false , "" , inline = "1", group = "Accumulation And Distribution")
zone_mode = input.string ("Fast" , "" , inline = "1", group = "Accumulation And Distribution" , tooltip = " Find small zone pattern formation\n Find bigger zone pattern formation" ,options = )
acc_css = input.color (color.new(#089981 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
dist_css = input.color (color.new(#f23645 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
show_lbl = input.bool (false , "Show swing point" , inline = "1", group = "High and Low" , tooltip = "Display swing point")
show_mtb = input.bool (false , "Show High/Low/Equilibrium" , inline = "2", group = "High and Low" , tooltip = "Display Strong/Weak High And Low and Equilibrium")
toplvl = input.color (color.red , "Premium Zone " , inline = "3", group = "High and Low")
midlvl = input.color (color.white , "Equilibrium Zone" , inline = "4", group = "High and Low")
btmlvl = input.color (#089981 , "Discount Zone " , inline = "5", group = "High and Low")
fvg_enable = input.bool (false , " " , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap")
what_fvg = input.string ("FVG" , "" , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap", options = )
fvg_num = input.int (5 , "Show Last " , inline = "1a", group = "FAIR VALUE GAP" , tooltip = "Number of fvg to show")
fvg_upcss = input.color (color.new(#089981, 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_dncss = input.color (color.new(color.red , 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_extend = input.int (10 , "Extend FVG" , inline = "2", group = "FAIR VALUE GAP" , tooltip = "Extend the display of the FVG.")
fvg_src = input.string ("Close" , "Mitigation " , inline = "3", group = "FAIR VALUE GAP" , tooltip = " Use the close of the body as trigger\n\n Use the extreme point of the body as trigger", options = )
fvg_tf = input.timeframe ("" , "Timeframe " , inline = "4", group = "FAIR VALUE GAP" , tooltip = "Timeframe of the fair value gap")
t = color.t (ob_bull_css)
invcol = color.new (color.white , 100)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - UDT }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
type bar
float o = open
float c = close
float h = high
float l = low
float v = volume
int n = bar_index
int t = time
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type FVG
box box
line ln
bool bull
float top
float btm
int left
int right
type ms
float p
int n
float l
type msDraw
int n
float p
color css
string txt
bool bull
type obC
float top
float btm
int left
float avg
float dV
float cV
int wM
int blVP
int brVP
int dir
float h
float l
int n
type obD
box ob
box eOB
box blB
box brB
line mL
type zone
chart.point points
float p
int c
int t
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type ehl
float pt
int t
float pb
int b
type pattern
string found = "None"
bool isfound = false
int period = 0
bool bull = false
type alerts
bool chochswing = false
bool chochplusswing = false
bool swingbos = false
bool chochplus = false
bool choch = false
bool bos = false
bool equal = false
bool ob = false
bool swingob = false
bool zone = false
bool fvg = false
bool obtouch = false
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - General Setup }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
bar b = bar.new()
var pattern p = pattern.new()
alerts blalert = alerts.new()
alerts bralert = alerts.new()
if p.isfound
p.period += 1
if p.period == 50
p.period := 0
p.found := "None"
p.isfound := false
p.bull := na
switch
b.c > b.o => boolean.set(green_candle, true)
b.c < b.o => boolean.set(red_candle , true)
f_zscore(src, lookback) =>
(src - ta.sma(src, lookback)) / ta.stdev(src, lookback)
var int iLen = internal_r_lookback
var int sLen = swing_r_lookback
vv = f_zscore(((close - close ) / close ) * 100,iLen)
if ms_mode == "Dynamic"
switch
vv >= 1.5 or vv <= -1.5 => iLen := 10
vv >= 1.6 or vv <= -1.6 => iLen := 9
vv >= 1.7 or vv <= -1.7 => iLen := 8
vv >= 1.8 or vv <= -1.8 => iLen := 7
vv >= 1.9 or vv <= -1.9 => iLen := 6
vv >= 2.0 or vv <= -2.0 => iLen := 5
=> iLen
var msline = array.new(0)
iH = ta.pivothigh(high, iLen, iLen)
sH = ta.pivothigh(high, sLen, sLen)
iL = ta.pivotlow (low , iLen, iLen)
sL = ta.pivotlow (low , sLen, sLen)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - ARRAYS }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
hl () =>
= request.security(syminfo.tickerid , 'D' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'W' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'M' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , '12M', hl() , lookahead = barmerge.lookahead_on)
lstyle(style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
mtfphl(h, l ,tf ,css, pdhl_style) =>
var line hl = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var line ll = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var label lbl = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}L', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
var label hlb = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}H', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
hy = ta.valuewhen(h != h , h , 1)
hx = ta.valuewhen(h == high , time , 1)
ly = ta.valuewhen(l != l , l , 1)
lx = ta.valuewhen(l == low , time , 1)
if barstate.islast
extension = time + (time - time ) * 50
line.set_xy1(hl , hx , hy)
line.set_xy2(hl , extension , hy)
label.set_xy(hlb, extension , hy)
line.set_xy1(ll , lx , ly)
line.set_xy2(ll , extension , ly)
label.set_xy(lbl, extension , ly)
if lvl_daily
mtfphl(pdh , pdl , 'D' , css_d, s_d)
if lvl_weekly
mtfphl(pwh , pwl , 'W' , css_w, s_w)
if lvl_monthly
mtfphl(pmh , pml, 'M' , css_m, s_m)
if lvl_yearly
mtfphl(pyh , pyl , '12M', css_y, s_y)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Market Structure }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method darkcss(color css, float factor, bool bull) =>
blue = color.b(css) * (1 - factor)
red = color.r(css) * (1 - factor)
green = color.g(css) * (1 - factor)
color.rgb(red, green, blue, 0)
method f_line(msDraw d, size, style) =>
var line id = na
var label lbl = na
id := line.new(
d.n
, d.p
, b.n
, d.p
, color = d.css
, width = 1
, style = style
)
if msline.size() >= 250
line.delete(msline.shift())
msline.push(id)
lbl := label.new(
int(math.avg(d.n, b.n))
, d.p
, d.txt
, color = invcol
, textcolor = d.css
, style = d.bull ? label.style_label_down : label.style_label_up
, size = size
, text_font_family = font.family_monospace
)
structure(bool mtf) =>
msDraw drw = na
bool isdrw = false
bool isdrwS = false
var color css = na
var color icss = na
var int itrend = 0
var int trend = 0
bool bull_ob = false
bool bear_ob = false
bool s_bull_ob = false
bool s_bear_ob = false
n = bar_index
var ms up = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms dn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sup = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sdn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
switch show_swing_ms
"All" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, true )
"CHoCH" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, false )
"CHoCH+" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, true )
"BOS" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
"None" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
=> na
switch show_internal_ms
"All" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, true )
"CHoCH" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, false)
"CHoCH+" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, true )
"BOS" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
"None" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
=> na
switch
iH =>
up.p.unshift(b.h )
up.l.unshift(b.h )
up.n.unshift(n )
iL =>
dn.p.unshift(b.l )
dn.l.unshift(b.l )
dn.n.unshift(n )
sL =>
sdn.p.unshift(b.l )
sdn.l.unshift(b.l )
sdn.n.unshift(n )
sH =>
sup.p.unshift(b.h )
sup.l.unshift(b.h )
sup.n.unshift(n )
// INTERNAL BULLISH STRUCTURE
if up.p.size() > 0 and dn.l.size() > 1
if ta.crossover(b.c, up.p.first())
bool CHoCH = na
string txt = na
if itrend < 0
CHoCH := true
switch
not CHoCH =>
txt := "BOS"
css := i_ms_up_BOS
blalert.bos := true
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS
, txt
, true
)
CHoCH =>
dn.l.first() > dn.l.get(1) ? blalert.chochplus : blalert.choch
txt := dn.l.first() > dn.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_up_BOS.darkcss(0.25, true)
if (dn.l.first() > dn.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => bull_ob := true
ob_filter == "BOS" and txt == "BOS" => bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bull_ob := true
itrend := 1
up.n.clear()
up.p.clear()
// INTERNAL BEARISH STRUCTURE
if dn.p.size() > 0 and up.l.size() > 1
if ta.crossunder(b.c, dn.p.first())
bool CHoCH = na
string txt = na
if itrend > 0
CHoCH := true
switch
not CHoCH =>
bralert.bos := true
txt := "BOS"
css := i_ms_dn_BOS
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS
, txt
, false
)
CHoCH =>
if up.l.first() < up.l.get(1)
bralert.chochplus := true
else
bralert.choch := true
txt := up.l.first() < up.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_dn_BOS.darkcss(0.25, false)
if (up.l.first() < up.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => bear_ob := true
ob_filter == "BOS" and txt == "BOS" => bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bear_ob := true
itrend := -1
dn.n.clear()
dn.p.clear()
// SWING BULLISH STRUCTURE
if sup.p.size() > 0 and sdn.l.size() > 1
if ta.crossover(b.c, sup.p.first())
bool CHoCH = na
string txt = na
if trend < 0
CHoCH := true
switch
not CHoCH =>
blalert.swingbos := true
txt := "BOS"
icss := s_ms_up_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS
, txt
, true
)
CHoCH =>
if sdn.l.first() > sdn.l.get(1)
blalert.chochplusswing := true
else
blalert.chochswing := true
txt := sdn.l.first() > sdn.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_up_BOS.darkcss(0.25, true)
if (sdn.l.first() > sdn.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => s_bull_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bull_ob := true
trend := 1
sup.n.clear()
sup.p.clear()
// SWING BEARISH STRUCTURE
if sdn.p.size() > 0 and sup.l.size() > 1
if ta.crossunder(b.c, sdn.p.first())
bool CHoCH = na
string txt = na
if trend > 0
CHoCH := true
switch
not CHoCH =>
bralert.swingbos := true
txt := "BOS"
icss := s_ms_dn_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS
, txt
, false
)
CHoCH =>
if sup.l.first() < sup.l.get(1)
bralert.chochplusswing := true
else
bralert.chochswing := true
txt := sup.l.first() < sup.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_dn_BOS.darkcss(0.25, false)
if (sup.l.first() < sup.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => s_bear_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bear_ob := true
trend := -1
sdn.n.clear()
sdn.p.clear()
= structure(false)
if isdrw
f_line(drw, size.small, line.style_dashed)
if isdrwS
f_line(drw, size.small, line.style_solid)
= request.security("", "15" , structure(true))
= request.security("", "60" , structure(true))
= request.security("", "240" , structure(true))
= request.security("", "1440" , structure(true))
if show_mtf_str
var tab = table.new(position = position.top_right, columns = 10, rows = 10, bgcolor = na, frame_color = color.rgb(54, 58, 69, 0), frame_width = 1, border_color = color.rgb(54, 58, 69, 100), border_width = 1)
table.cell(tab, 0, 1, text = "15" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 2, text = "1H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 3, text = "4H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 4, text = "1D" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 1, 1, text = itrend15 == 1 ? "BULLISH" : itrend15 == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend15 == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend15 == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 2, text = itrend1H == 1 ? "BULLISH" : itrend1H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 3, text = itrend4H == 1 ? "BULLISH" : itrend4H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend4H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend4H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 4, text = itrend1D == 1 ? "BULLISH" : itrend1D == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1D == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1D == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 5, text = "Detected Pattern", text_halign = text.align_center, text_size = size.normal, text_color = color.silver, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 6, text = p.found, text_halign = text.align_center, text_size = size.normal, text_color = na(p.bull) ? color.white : p.bull ? i_ms_up_BOS.darkcss(-0.25, true) : p.bull == false ? i_ms_dn_BOS.darkcss(0.25, false) : na, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.merge_cells(tab, 0, 5, 1, 5)
table.merge_cells(tab, 0, 6, 1, 6)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Strong/Weak High/Low And Equilibrium }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
var phl = Zphl.new(
na
, na
, label.new(na , na , color = invcol , textcolor = i_ms_dn_BOS , style = label.style_label_down , size = size.tiny , text = "")
, label.new(na , na , color = invcol , textcolor = i_ms_up_BOS , style = label.style_label_up , size = size.tiny , text = "")
, true
, true
, true
, true
, ""
, ""
, 0
, 0
, 0
, 0
, high
, low
, 0
, 0
, 0
, 0
, 0
, 0
, na
, na
)
zhl(len)=>
upper = ta.highest(len)
lower = ta.lowest(len)
var float out = 0
out := b.h > upper ? 0 : b.l < lower ? 1 : out
top = out == 0 and out != 0 ? b.h : 0
btm = out == 1 and out != 1 ? b.l : 0
= zhl(sLen)
= zhl(iLen)
upphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
if top
phl.stopcross := true
phl.txtup := top > phl.topy ? "HH" : "HL"
if show_lbl
topl = label.new(
b.n - swing_r_lookback
, top
, phl.txtup
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
line.delete(phl.top )
phl.top := line.new(
b.n - sLen
, top
, b.n
, top
, color = toplvl)
phl.topy := top
phl.topx := b.n - sLen
phl.tup := top
phl.tupx := b.n - sLen
if itop
phl.itopcross := true
phl.itopy := itop
phl.itopx := b.n - iLen
phl.tup := math.max(high, phl.tup)
phl.tupx := phl.tup == high ? b.n : phl.tupx
phl.uV := phl.tup != phl.tup ? b.v : phl.uV
if barstate.islast
line.set_xy1(
phl.top
, phl.tupx
, phl.tup
)
line.set_xy2(
phl.top
, b.n + 50
, phl.tup
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tup
)
dist = math.abs(phl.uV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend < 0
? "Strong High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
dnphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
if btm
phl.sbottomcross := true
phl.txtdn := btm > phl.bottomy ? "LH" : "LL"
if show_lbl
btml = label.new(
b.n - swing_r_lookback
, btm, phl.txtdn
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
line.delete(phl.bottom )
phl.bottom := line.new(
b.n - sLen
, btm
, b.n
, btm
, color = btmlvl
)
phl.bottomy := btm
phl.bottomx := b.n - sLen
phl.tdn := btm
phl.tdnx := b.n - sLen
if ibtm
phl.ibottomcross := true
phl.ibottomy := ibtm
phl.ibottomx := b.n - iLen
phl.tdn := math.min(low, phl.tdn)
phl.tdnx := phl.tdn == low ? b.n : phl.tdnx
phl.dV := phl.tdn != phl.tdn ? b.v : phl.dV
if barstate.islast
line.set_xy1(
phl.bottom
, phl.tdnx
, phl.tdn
)
line.set_xy2(
phl.bottom
, b.n + 50
, phl.tdn
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tdn
)
dist = math.abs(phl.dV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend > 0
? "Strong Low | " + str.tostring(phl.dV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak Low | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
midphl() =>
avg = math.avg(phl.bottom.get_y2(), phl.top.get_y2())
var line l = line.new(
y1 = avg
, y2 = avg
, x1 = b.n - sLen
, x2 = b.n + 50
, color = midlvl
, style = line.style_solid
)
var label lbl = label.new(
x = b.n + 50
, y = avg
, text = "Equilibrium"
, style = label.style_label_left
, color = invcol
, textcolor = midlvl
, size = size.small
)
if barstate.islast
more = (phl.bottom.get_x1() + phl.bottom.get_x2()) > (phl.top.get_x1() + phl.top.get_x2()) ? phl.top.get_x1() : phl.bottom.get_x1()
line.set_xy1(l , more , avg)
line.set_xy2(l , b.n + 50, avg)
label.set_x (lbl , b.n + 50 )
label.set_y (lbl , avg )
dist = math.abs((l.get_y2() - close) / close) * 100
label.set_text (lbl, "Equilibrium (" + str.tostring(math.round(dist,0)) + "%)")
hqlzone() =>
if barstate.islast
var hqlzone dZone = hqlzone.new(
box.new(
na
, na
, na
, na
, bgcolor = color.new(toplvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(midlvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(btmlvl, 70)
, border_color = na
)
, label.new(na, na, text = "Premium" , color = invcol, textcolor = toplvl, style = label.style_label_down, size = size.small)
, label.new(na, na, text = "Equilibrium", color = invcol, textcolor = midlvl, style = label.style_label_left, size = size.small)
, label.new(na, na, text = "Discount" , color = invcol, textcolor = btmlvl, style = label.style_label_up , size = size.small)
)
dZone.pbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)) , phl.tup)
dZone.pbx.set_rightbottom(b.n + 50 , 0.95 * phl.tup + 0.05 * phl.tdn)
dZone.ebx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.525 * phl.tup + 0.475 * phl.tdn)
dZone.ebx.set_rightbottom(b.n + 50 , 0.525 * phl.tdn + 0.475 * phl.tup)
dZone.lbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.95 * phl.tdn + 0.05 * phl.tup)
dZone.lbx.set_rightbottom(b.n + 50 , phl.tdn)
dZone.plb.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tup)
dZone.elb.set_xy( int(b.n + 50) , math.avg(phl.tup, phl.tdn))
dZone.lbl.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tdn)
if show_mtb
upphl (trend)
dnphl (trend)
hqlzone()
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Volumetric Order Block }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method eB(box b, bool ext, color css, bool swing) =>
b.unshift(
box.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, text_font_family = font.family_monospace
, extend = ext ? extend.right : extend.none
, border_color = swing ? color.new(css, 0) : color.new(color.white,100)
, bgcolor = css
, border_width = 1
)
)
method eL(line l, bool ext, bool solid, color css) =>
l.unshift(
line.new(
na
, na
, na
, na
, width = 1
, color = css
, xloc = xloc.bar_time
, extend = ext ? extend.right : extend.none
, style = solid ? line.style_solid : line.style_dashed
)
)
method drawVOB(bool cdn, bool bull, color css, int loc, bool swing) =>
= request.security(
syminfo.tickerid
, ""
,
, lookahead = barmerge.lookahead_off
)
var obC obj = obC.new(
array.new()
, array.new()
, array.new< int >()
, array.new()
, array.new()
, array.new()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new()
, array.new()
, array.new< int >()
)
var obD draw = obD.new(
array.new()
, array.new()
, array.new()
, array.new()
, array.new()
)
if barstate.isfirst
for i = 0 to ob_num - 1
draw.mL .eL(false, false, use_grayscale ? color.new(color.gray, 0) : color.new(css,0))
draw.ob .eB(false, use_grayscale ? color.new(color.gray, 90) : css, swing)
draw.blB.eB(false, css_metric_up , swing)
draw.brB.eB(false, css_metric_dn , swing)
draw.eOB.eB(true , use_grayscale ? color.new(color.gray, 90) : css, swing)
float pos = ob_pos == "Full"
? (bull ? high : low)
: ob_pos == "Middle"
? ohlc4
: ob_pos == "Accurate"
? hl2
: hl2
if cdn
obj.h.clear()
obj.l.clear()
obj.n.clear()
for i = 1 to math.abs((loc - b.n)) - 1
obj.h.push(hH )
obj.l.push(lL )
obj.n.push(b.t )
// obj.h.reverse()
// obj.l.reverse()
int iU = obj.l.indexof(obj.l.min()) + 1
int iD = obj.h.indexof(obj.h.max()) + 1
obj.dir.unshift(
bull
? (b.c > b.o ? 1 : -1)
: (b.c > b.o ? 1 : -1)
)
obj.top.unshift(
bull
? pos
: obj.h.max()
)
obj.btm.unshift(
bull
? obj.l.min()
: pos
)
obj.left.unshift(
bull
? obj.n.get(obj.l.indexof(obj.l.min()))
: obj.n.get(obj.h.indexof(obj.h.max()))
)
obj.avg.unshift(
math.avg(obj.top.first(), obj.btm.first())
)
obj.cV.unshift(
bull
? b.v
: b.v
)
if ob_pos == "Precise"
switch bull
true =>
if obj.avg.get(0) < (b.c < b.o ? b.c : b.o ) and obj.top.get(0) > hlcc4
obj.top.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
false =>
if obj.avg.get(0) > (b.c < b.o ? b.o : b.c ) and obj.btm.get(0) < hlcc4
obj.btm.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
obj.blVP.unshift ( 0 )
obj.brVP.unshift ( 0 )
obj.wM .unshift ( 1 )
if use_overlap
int rmP = use_overlap_method == "Recent" ? 1 : 0
if obj.avg.size() > 1
if bull
? obj.btm.first() < obj.top.get(1)
: obj.top.first() > obj.btm.get(1)
obj.wM .remove(rmP)
obj.cV .remove(rmP)
obj.dir .remove(rmP)
obj.top .remove(rmP)
obj.avg .remove(rmP)
obj.btm .remove(rmP)
obj.left .remove(rmP)
obj.blVP .remove(rmP)
obj.brVP .remove(rmP)
if barstate.isconfirmed
for x = 0 to ob_num - 1
tg = switch ob_mitigation
"Middle" => obj.avg
"Absolute" => bull ? obj.btm : obj.top
for in tg
if (bull ? cC < pt : cC > pt)
obj.wM .remove(idx)
obj.cV .remove(idx)
obj.dir .remove(idx)
obj.top .remove(idx)
obj.avg .remove(idx)
obj.btm .remove(idx)
obj.left .remove(idx)
obj.blVP .remove(idx)
obj.brVP .remove(idx)
if barstate.islast
if obj.avg.size() > 0
// Alert
if bull
? ta.crossunder(low , obj.top.get(0))
: ta.crossover (high, obj.btm.get(0))
switch bull
true => blalert.obtouch := true
false => bralert.obtouch := true
float tV = 0
obj.dV.clear()
seq = math.min(ob_num - 1, obj.avg.size() - 1)
for j = 0 to seq
tV += obj.cV.get(j)
if j == seq
for y = 0 to seq
obj.dV.unshift(
math.floor(
(obj.cV.get(y) / tV) * 100)
)
obj.dV.reverse()
for i = 0 to math.min(ob_num - 1, obj.avg.size() - 1)
dmL = draw.mL .get(i)
dOB = draw.ob .get(i)
dblB = draw.blB.get(i)
dbrB = draw.brB.get(i)
deOB = draw.eOB.get(i)
dOB.set_lefttop (obj.left .get(i) , obj.top.get(i))
deOB.set_lefttop (b.t , obj.top.get(i))
dOB.set_rightbottom (b.t , obj.btm.get(i))
deOB.set_rightbottom(b.t + (b.t - b.t ) * 100 , obj.btm.get(i))
if use_middle_line
dmL.set_xy1(obj.left.get(i), obj.avg.get(i))
dmL.set_xy2(b.t , obj.avg.get(i))
if ob_metrics_show
dblB.set_lefttop (obj.left.get(i), obj.top.get(i))
dbrB.set_lefttop (obj.left.get(i), obj.avg.get(i))
dblB.set_rightbottom(obj.left.get(i), obj.avg.get(i))
dbrB.set_rightbottom(obj.left.get(i), obj.btm.get(i))
rpBL = dblB.get_right()
rpBR = dbrB.get_right()
dbrB.set_right(rpBR + (b.t - b.t ) * obj.brVP.get(i))
dblB.set_right(rpBL + (b.t - b.t ) * obj.blVP.get(i))
if use_show_metric
txt = switch
obj.cV.get(i) >= 1000000000 => str.tostring(math.round(obj.cV.get(i) / 1000000000,3)) + "B"
obj.cV.get(i) >= 1000000 => str.tostring(math.round(obj.cV.get(i) / 1000000,3)) + "M"
obj.cV.get(i) >= 1000 => str.tostring(math.round(obj.cV.get(i) / 1000,3)) + "K"
obj.cV.get(i) < 1000 => str.tostring(math.round(obj.cV.get(i)))
deOB.set_text(
str.tostring(
txt + " (" + str.tostring(obj.dV.get(i)) + "%)")
)
deOB.set_text_size (size.auto)
deOB.set_text_halign(text.align_left)
deOB.set_text_color (use_grayscale ? color.silver : color.new(css, 0))
if ob_metrics_show and barstate.isconfirmed
if obj.wM.size() > 0
for i = 0 to obj.avg.size() - 1
switch obj.dir.get(i)
1 =>
switch obj.wM.get(i)
1 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 1)
-1 =>
switch obj.wM.get(i)
1 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 1)
var hN = array.new(1, b.n)
var lN = array.new(1, b.n)
var hS = array.new(1, b.n)
var lS = array.new(1, b.n)
if iH
hN.pop()
hN.unshift(int(b.n ))
if iL
lN.pop()
lN.unshift(int(b.n ))
if sH
hS.pop()
hS.unshift(int(b.n ))
if sL
lS.pop()
lS.unshift(int(b.n ))
if ob_show
bull_ob.drawVOB(true , ob_bull_css, hN.first(), false)
bear_ob.drawVOB(false, ob_bear_css, lN.first(), false)
if ob_swings
s_bull_ob.drawVOB(true , css_swing_up, hS.first(), true)
s_bear_ob.drawVOB(false, css_swing_dn, lS.first(), true)
if bull_ob
blalert.ob := true
if bear_ob
bralert.ob := true
if s_bull_ob
blalert.swingob := true
if s_bear_ob
blalert.swingob := true
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - FVG | VI | OG }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
ghl() => request.security(syminfo.tickerid, fvg_tf, [high , low , close , open ])
tfG() => request.security(syminfo.tickerid, fvg_tf, )
cG(bool bull) =>
= ghl()
= tfG()
var FVG draw = FVG.new(
array.new()
, array.new()
)
var FVG cords = array.new()
float pup = na
float pdn = na
bool cdn = na
int pos = 2
cc = timeframe.change(fvg_tf)
if barstate.isfirst
for i = 0 to fvg_num - 1
draw.box.unshift(box.new (na, na, na, na, border_color = color.new(color.white, 100), xloc = xloc.bar_time))
draw.ln.unshift (line.new(na, na, na, na, xloc = xloc.bar_time, width = 1, style = line.style_solid))
switch what_fvg
"FVG" =>
pup := bull ? gl : l
pdn := bull ? h : gh
cdn := bull ? gl > h and cc : gh < l and cc
pos := 2
"VI" =>
pup := bull
? (gc > go
? go
: gc)
: (gc > go
? go
: gc )
pdn := bull
? (gc > go
? gc
: go )
: (gc > go
? gc
: go)
cdn := bull
? go > gc and gh > gl and gc > gc and go > go and gh < math.min(gc, go) and cc
: go < gc and gl < gh and gc < gc and go < go and gl > math.max(gc, go) and cc
pos := 1
"OG" =>
pup := bull ? b.l : gl
pdn := bull ? gh : gh
cdn := bull ? gl > gh and cc : gh < gl and cc
pos := 1
if not na(cdn) and cdn
cords.unshift(
FVG.new(
na
, na
, bull
? true
: false
, pup
, pdn
, b.t - (b.t - b.t ) * pos
, b.t + (b.t - b.t ) * fvg_extend)
)
if bull
blalert.fvg := tru
Simple Multi-Timeframe Trends with RSI (Realtime)Simple Multi-Timeframe Trends with RSI Realtime Updates
Overview
The Simple Multi-Timeframe Trends with RSI Realtime Updates indicator is a comprehensive dashboard designed to give you an at-a-glance understanding of market trends across nine key timeframes, from one minute (M1) to one month (M).
It moves beyond simple moving average crossovers by calculating a sophisticated Trend Score for each timeframe. This score is then intelligently combined into a single, weighted Confluence Signal , which adapts to your personal trading style. With integrated RSI and divergence detection, SMTT provides a powerful, all-in-one tool to confirm your trade ideas and stay on the right side of the market.
Key Features
Automatic Trading Presets: The most powerful feature of the script. Simply select your trading style, and the indicator will automatically adjust all internal parameters for you:
Intraday: Uses shorter moving averages and higher sensitivity, focusing on lower timeframe alignment for quick moves.
Swing Trading: A balanced preset using medium-term moving averages, ideal for capturing trends that last several days or weeks.
Investment: Uses long-term moving averages and lower sensitivity, prioritizing the major trends on high timeframes.
Advanced Trend Scoring: The trend for each timeframe isn't just "up" or "down". The score is calculated based on a combination of:
Price vs. Moving Average: Is the price above or below the MA?
MA Slope: Is the trend accelerating or decelerating? A steep slope indicates a strong trend.
Price Momentum: How quickly has the price moved recently?
Volatility Adjustment: The score's quality is adjusted based on current market volatility (using ATR) to filter out choppy conditions.
Weighted Confluence Score: The script synthesizes the trend scores from all nine timeframes into a single, actionable signal. The weights are dynamically adjusted based on your selected Trading Style , ensuring the most relevant timeframes have the most impact on the final result.
Integrated RSI & Divergence: Each timeframe includes a smoothed RSI value to help you spot overbought/oversold conditions. It also flags potential bullish (price lower, RSI higher) and bearish (price higher, RSI lower) divergences, which can be early warnings of a trend reversal.
Clean & Customizable Dashboard: The entire analysis is presented in a clean, easy-to-read table on your chart. You can choose its position and optionally display the raw numerical scores for a deeper analysis.
How to Use It
1. Add to Chart: Apply the "Simple Multi-Timeframe Trends" indicator to your chart.
2. Select Your Style: This is the most important step. Go to the indicator settings and choose the Trading Style that best fits your strategy (Intraday, Swing Trading, or Investment). All calculations will instantly adapt.
3. Analyze the Dashboard:
Look at the Trend row to see the direction and strength of the trend on individual timeframes. Strong alignment (e.g., all green or all red) indicates a powerful, market-wide move.
Check the RSI row. Is the trend overextended (RSI > 60) or is there room to run? Look for the fuchsia color, which signals a divergence and warrants caution.
Focus on the Signal row. This is your summary. A "STRONG SIGNAL" with high alignment suggests a high-probability setup. A "NEUTRAL" or "Weak" signal suggests waiting for a better opportunity.
4. Confirm Your Trades: Use the SMTT dashboard as a confirmation tool. For example, if you are looking for a long entry, wait for the dashboard to show a "BULLISH" or "STRONG SIGNAL" to confirm that the broader market structure supports your trade.
Dashboard Legend
Trend Row
This row shows the trend direction and strength for each timeframe.
⬆⬆ (Dark Green): Ultra Bullish - Very strong, established uptrend.
⬆ (Green): Strong Bullish - Confident uptrend.
▲ (Light Green): Bullish - The beginning of an uptrend or a weak uptrend.
━ (Orange): Neutral - Sideways or consolidating market.
▼ (Light Red): Bearish - The beginning of a downtrend or a weak downtrend.
⬇ (Red): Strong Bearish - Confident downtrend.
⬇⬇ (Dark Red): Ultra Bearish - Very strong, established downtrend.
RSI Row
This row displays the smoothed RSI value and its condition.
Green Text: Oversold (RSI < 40). Potential for a bounce or reversal upwards.
Red Text: Overbought (RSI > 60). Potential for a pullback or reversal downwards.
Fuchsia (Pink) Text: Divergence Detected! A potential reversal is forming.
White Text: Neutral (RSI between 40 and 60).
Signal Row
This is the final, weighted confluence of all timeframes.
Label:
🚀 STRONG SIGNAL / 💥 STRONG SIGNAL: High confluence and strong momentum.
🟢 BULLISH / 🔴 BEARISH: Clear directional bias across relevant timeframes.
🟡 Weak + / 🟠 Weak -: Minor directional bias, suggests caution.
⚪ NEUTRAL: No clear directional trend; market is likely choppy or undecided.
Numerical Score: The raw weighted confluence score. The further from zero, the stronger the signal.
Alignment %: The percentage of timeframes (out of 9) that are showing a clear bullish or bearish trend. Higher percentages indicate a more unified market.
Choppiness ZONE OverlayPurpose
This script overlays choppiness zones directly onto the price chart to help traders identify whether the market is trending or ranging. It is designed to filter out low-probability trades during high choppiness conditions.
How It Works
Calculates the Choppiness Index over a user-defined period using ATR and price range.
Divides choppiness into four zones:
30 to 40: Low choppiness, possible trend initiation, shown in yellow.
40 to 50: Moderate choppiness, transition zone, shown in orange.
50 to 60: High choppiness, weakening momentum, shown in red.
60 and above: Extreme choppiness, avoid trading, shown in purple.
Highlights each zone with customizable color fills between the high and low of the selected range.
Triggers a real-time alert when choppiness exceeds 60.
Features
Customizable choppiness zones and color settings.
Real-time alert when market becomes extremely choppy (choppiness ≥ 60).
Visual zone overlay on the price chart.
Compatible with all timeframes.
Lightweight and responsive for scalping, intraday, or swing trading.
Tip
Use this tool as a volatility or trend filter. Combine it with momentum or trend-following indicators to improve trade selection.
Kaufman Trend Strategy# ✅ Kaufman Trend Strategy – Full Description (Script Publishing Version)
**Kaufman Trend Strategy** is a dynamic trend-following strategy based on Kaufman Filter theory.
It detects real-time trend momentum, reduces noise, and aims to enhance entry accuracy while optimizing risk.
⚠️ _For educational and research purposes only. Past performance does not guarantee future results._
---
## 🎯 Strategy Objective
- Smooth price noise using Kaufman Filter smoothing
- Detect the strength and direction of trends with a normalized oscillator
- Manage profits using multi-stage take-profits and adaptive ATR stop-loss logic
---
## ✨ Key Features
- **Kaufman Filter Trend Detection**
Extracts directional signal using a state space model.
- **Multi-Stage Profit-Taking**
Automatically takes partial profits based on color changes and zero-cross events.
- **ATR-Based Volatility Stops**
Stops adjust based on swing highs/lows and current market volatility.
---
## 📊 Entry & Exit Logic
**Long Entry**
- `trend_strength ≥ 60`
- Green trend signal
- Price above the Kaufman average
**Short Entry**
- `trend_strength ≤ -60`
- Red trend signal
- Price below the Kaufman average
**Exit (Long/Short)**
- Blue trend color → TP1 (50%)
- Oscillator crosses 0 → TP2 (25%)
- Trend weakens → Final exit (25%)
- ATR + swing-based stop loss
---
## 💰 Risk Management
- Initial capital: `$3,000`
- Order size: `$100` per trade (realistic, low-risk sizing)
- Commission: `0.002%`
- Slippage: `2 ticks`
- Pyramiding: `1` max position
- Estimated risk/trade: `~0.1–0.5%` of equity
> ⚠️ _No trade risks more than 5% of equity. This strategy follows TradingView script publishing rules._
---
## ⚙️ Default Parameters
- **1st Take Profit**: 50%
- **2nd Take Profit**: 25%
- **Final Exit**: 25%
- **ATR Period**: 14
- **Swing Lookback**: 10
- **Entry Threshold**: ±60
- **Exit Threshold**: ±40
---
## 📅 Backtest Summary
- **Symbol**: USD/JPY
- **Timeframe**: 1H
- **Date Range**: Jan 3, 2022 – Jun 4, 2025
- **Trades**: 924
- **Win Rate**: 41.67%
- **Profit Factor**: 1.108
- **Net Profit**: +$1,659.29 (+54.56%)
- **Max Drawdown**: -$1,419.73 (-31.87%)
---
## ✅ Summary
This strategy uses Kaufman filtering to detect market direction with reduced lag and increased smoothness.
It’s built with visual clarity and strong trade management, making it practical for both beginners and advanced users.
---
## 📌 Disclaimer
This script is for educational and informational purposes only and should not be considered financial advice.
Use with proper risk controls and always test in a demo environment before live trading.
Enhanced Cycle IndicatorEnhanced Cycle Indicator Guide
DISCLAIMER
"This PineScript indicator evolved from a foundational algorithm designed to visualize cycle-based center average differentials. The original concept has been significantly enhanced and optimized through collaborative refinement with AI, resulting in improved functionality, performance, and visualization capabilities while maintaining the core mathematical principles of the original design"
Overview
The Enhanced Cycle Indicator is designed to identify market cycles with minimal lag while ensuring the cycle lows and highs correspond closely with actual price bottoms and tops. This indicator transforms price data into observable cycles that help you identify when a market is likely to change direction.
Core Principles
Cycle Detection: Identifies natural market rhythms using multiple timeframes
Dynamic Adaptation: Adjusts to changing market conditions for consistent performance
Precise Signals: Provides clear entry and exit points aligned with actual market turns
Reduced Lag: Uses advanced calculations to minimize delay in cycle identification
How To Use
1. Main Cycle Interpretation
Green Histogram Bars: Bullish cycle phase (upward momentum)
Red Histogram Bars: Bearish cycle phase (downward momentum)
Cycle Extremes: When the histogram reaches extreme values (+80/-80), the market is likely approaching a turning point
Zero Line: Crossovers often indicate a shift in the underlying market direction
2. Trading Signals
Green Triangle Up (bottom of chart): Strong bullish signal - ideal for entries or covering shorts
Red Triangle Down (top of chart): Strong bearish signal - ideal for exits or short entries
Diamond Shapes: Indicate divergence between price and cycle - early warning of potential reversals
Small Circles: Minor cycle turning points - useful for fine-tuning entries/exits
3. Optimal Signal Conditions
Bullish Signals Work Best When:
The cycle is deeply oversold (below -60)
RSI is below 40 or turning up
Price is near a significant low
Multiple confirmation bars have occurred
Bearish Signals Work Best When:
The cycle is heavily overbought (above +60)
RSI is above 60 or turning down
Price is near a significant high
Multiple confirmation bars have occurred
4. Parameter Adjustments
For Shorter Timeframes: Reduce cycle periods and smoothing factor for faster response
For Daily/Weekly Charts: Increase cycle periods and smoothing for smoother signals
For Volatile Markets: Reduce cycle responsiveness to filter noise
For Trending Markets: Increase signal confirmation requirement to avoid false signals
Recommended Settings
Default (All-Purpose)
Main Cycle: 50
Half Cycle: 25
Quarter Cycle: 12
Smoothing Factor: 0.5
RSI Filter: Enabled
Signal Confirmation: 2 bars
Faster Response (Day Trading)
Main Cycle: 30
Half Cycle: 15
Quarter Cycle: 8
Smoothing Factor: 0.3
Cycle Responsiveness: 1.2
Signal Confirmation: 1 bar
Smoother Signals (Swing Trading)
Main Cycle: 80
Half Cycle: 40
Quarter Cycle: 20
Smoothing Factor: 0.7
Cycle Responsiveness: 0.8
Signal Confirmation: 3 bars
Advanced Features
Adaptive Period
When enabled, the indicator automatically adjusts cycle periods based on recent price volatility. This is particularly useful in markets that alternate between trending and ranging behaviors.
Momentum Filter
Enhances cycle signals by incorporating price momentum, making signals more responsive during strong trends and less prone to whipsaws during consolidations.
RSI Filter
Adds an additional confirmation layer using RSI, helping to filter out lower-quality signals and improve overall accuracy.
Divergence Detection
Identifies situations where price makes a new high/low but the cycle doesn't confirm, often preceding significant market reversals.
Best Practices
Use the indicator in conjunction with support/resistance levels
Look for signal clusters across multiple timeframes
Reduce position size when signals appear far from cycle extremes
Pay special attention to signals that coincide with divergences
Customize cycle periods to match the natural rhythm of your traded instrument
Troubleshooting
Too Many Signals: Increase signal confirmation bars or reduce cycle responsiveness
Missing Major Turns: Decrease smoothing factor or increase cycle responsiveness
Signals Too Late: Decrease cycle periods and smoothing factor
False Signals: Enable RSI filter and increase signal confirmation requirement
Time-Based Fair Value Gaps (FVG) with Inversions (iFVG)Overview
The Time-Based Fair Value Gaps (FVG) with Inversions (iFVG) (ICT/SMT) indicator is a specialized tool designed for traders using Inner Circle Trader (ICT) methodologies. Inspired by LuxAlgo's Fair Value Gap indicator, this script introduces significant enhancements by integrating ICT principles, focusing on precise time-based FVG detection, inversion tracking, and retest signals tailored for institutional trading strategies. Unlike LuxAlgo’s general FVG approach, this indicator filters FVGs within customizable 10-minute windows aligned with ICT’s macro timeframes and incorporates ICT-specific concepts like mitigation, liquidity grabs, and session-based gap prioritization.
This tool is optimized for 1–5 minute charts, though probably best for 1 minute charts, identifying bullish and bearish FVGs, tracking their mitigation into inverted FVGs (iFVGs) as key support/resistance zones, and generating retest signals with customizable “Close” or “Wick” confirmation. Features like ATR-based filtering, optional FVG labels, mitigation removal, and session-specific FVG detection (e.g., first FVG in AM/PM sessions) make it a powerful tool for ICT traders.
Originality and Improvements
While inspired by LuxAlgo’s FVG indicator (credit to LuxAlgo for their foundational work), this script significantly extends the original concept by:
1. Time-Based FVG Detection: Unlike LuxAlgo’s continuous FVG identification, this script filters FVGs within user-defined 10-minute windows each hour (:00–:10, :10–:20, etc.), aligning with ICT’s emphasis on specific periods of institutional activity, such as hourly opens/closes or kill zones (e.g., New York 7:00–11:00 AM EST). This ensures FVGs are relevant to high-probability ICT setups.
2. Session-Specific First FVG Option: A unique feature allows traders to display only the first FVG in ICT-defined AM (9:30–10:00 AM EST) or PM (1:30–2:00 PM EST) sessions, reflecting ICT’s focus on initial market imbalances during key liquidity events.
3. ICT-Driven Mitigation and Inversion Logic: The script tracks FVG mitigation (when price closes through a gap) and converts mitigated FVGs into iFVGs, which serve as ICT-style support/resistance zones. This aligns with ICT’s view that mitigated gaps become critical reversal points, unlike LuxAlgo’s simpler gap display.
4. Customizable Retest Signals: Retest signals for iFVGs are configurable for “Close” (conservative, requiring candle body confirmation) or “Wick” (faster, using highs/lows), catering to ICT traders’ need for precise entry timing during liquidity grabs or Judas swings.
5. ATR Filtering and Mitigation Removal: An optional ATR filter ensures only significant FVGs are displayed, reducing noise, while mitigation removal declutters the chart by removing filled gaps, aligning with ICT’s principle that mitigated gaps lose relevance unless inverted.
6. Timezone and Timeframe Safeguards: A timezone offset setting aligns FVG detection with EST for ICT’s New York-centric strategies, and a timeframe warning alerts users to avoid ≥1-hour charts, ensuring accuracy in time-based filtering.
These enhancements make the script a distinct tool that builds on LuxAlgo’s foundation while offering ICT traders a tailored, high-precision solution.
How It Works
FVG Detection
FVGs are identified when a candle’s low is higher than the high of two candles prior (bullish FVG) or a candle’s high is lower than the low of two candles prior (bearish FVG). Detection is restricted to:
• User-selected 10-minute windows (e.g., :00–:10, :50–:60) to capture ICT-relevant periods like hourly transitions.
• AM/PM session first FVGs (if enabled), focusing on 9:30–10:00 AM or 1:30–2:00 PM EST for key market opens.
An optional ATR filter (default: 0.25× ATR) ensures only gaps larger than the threshold are displayed, prioritizing significant imbalances.
Mitigation and Inversion
When price closes through an FVG (e.g., below a bullish FVG’s bottom), the FVG is mitigated and becomes an iFVG, plotted as a support/resistance zone. iFVGs are critical in ICT for identifying reversal points where institutional orders accumulate.
Retest Signals
The script generates signals when price retests an iFVG:
• Close: Triggers when the candle body confirms the retest (conservative, lower noise).
• Wick: Triggers when the candle’s high/low touches the iFVG (faster, higher sensitivity). Signals are visualized with triangular markers (▲ for bullish, ▼ for bearish) and can trigger alerts.
Visualization
• FVGs: Displayed as colored boxes (green for bullish, red for bearish) with optional “Bull FVG”/“Bear FVG” labels.
• iFVGs: Shown as extended boxes with dashed midlines, limited to the user-defined number of recent zones (default: 5).
• Mitigation Removal: Mitigated FVGs/iFVGs are removed (if enabled) to keep the chart clean.
How to Use
Recommended Settings
• Timeframe: Use 1–5 minute charts for precision, avoiding ≥1-hour timeframes (a warning label appears if misconfigured).
• Time Windows: Enable :00–:10 and :50–:60 for hourly open/close FVGs, or use the “Show only 1st presented FVG” option for AM/PM session focus.
• ATR Filter: Keep enabled (multiplier 0.25–0.5) for significant gaps; disable on 1-minute charts for more FVGs during volatility.
• Signal Preference: Use “Close” for conservative entries, “Wick” for aggressive setups.
• Timezone Offset: Set to -5 for EST (or -4 for EDT) to align with ICT’s New York session.
Trading Strategy
1. Macro Timeframes: Focus on New York (7:00–11:00 AM EST) or London (2:00–5:00 AM EST) kill zones for high institutional activity.
2. FVG Entries: Trade bullish FVGs as support in uptrends or bearish FVGs as resistance in downtrends, especially in :00–:10 or :50–:60 windows.
3. iFVG Retests: Enter on retest signals (▲/▼) during liquidity grabs or Judas swings, using “Close” for confirmation or “Wick” for speed.
4. Session FVGs: Use the “Show only 1st presented FVG” option to target the first gap in AM/PM sessions, often tied to ICT’s market maker algorithms.
5. Risk Management: Combine with ICT concepts like order blocks or breaker blocks for confluence, and set stops beyond FVG/iFVG boundaries.
Alerts
Set alerts for:
• “Bullish FVG Detected”/“Bearish FVG Detected”: New FVGs in selected windows.
• “Bullish Signal”/“Bearish Signal”: iFVG retest confirmations.
Settings Description
• Show Last (1–100, default: 5): Number of recent iFVGs to display. Lower values reduce clutter.
• Show only 1st presented FVG : Limits FVGs to the first in 9:30–10:00 AM or 1:30–2:00 PM EST sessions (overrides time window checkboxes).
• Time Window Checkboxes: Enable/disable FVG detection in 10-minute windows (:00–:10, :10–:20, etc.). All enabled by default.
• Signal Preference: “Close” (default) or “Wick” for iFVG retest signals.
• Use ATR Filter: Enables ATR-based size filtering (default: true).
• ATR Multiplier (0–∞, default: 0.25): Sets FVG size threshold (higher values = larger gaps).
• Remove Mitigated FVGs: Removes filled FVGs/iFVGs (default: true).
• Show FVG Labels: Displays “Bull FVG”/“Bear FVG” labels (default: true).
• Timezone Offset (-12 to 12, default: -5): Aligns time windows with EST.
• Colors: Customize bullish (green), bearish (red), and midline (gray) colors.
Why Use This Indicator?
This indicator empowers ICT traders with a tool that goes beyond generic FVG detection, offering precise, time-filtered gaps and inversion tracking aligned with institutional trading principles. By focusing on ICT’s macro timeframes, session-specific imbalances, and customizable signal logic, it provides a clear edge for scalping, swing trading, or reversal setups in high-liquidity markets.
Green*DiamondGreen*Diamond (GD1)
Unleash Dynamic Trading Signals with Volatility and Momentum
Overview
GreenDiamond is a versatile overlay indicator designed for traders seeking actionable buy and sell signals across various markets and timeframes. Combining Volatility Bands (VB) bands, Consolidation Detection, MACD, RSI, and a unique Ribbon Wave, it highlights high-probability setups while filtering out noise. With customizable signals like Green-Yellow Buy, Pullback Sell, and Inverse Pullback Buy, plus vibrant candle and volume visuals, GreenDiamond adapts to your trading style—whether you’re scalping, day trading, or swing trading.
Key Features
Volatility Bands (VB): Plots dynamic upper and lower bands to identify breakouts or reversals, with toggleable buy/sell signals outside consolidation zones.
Consolidation Detection: Marks low-range periods to avoid choppy markets, ensuring signals fire during trending conditions.
MACD Signals: Offers flexible buy/sell conditions (e.g., cross above signal, above zero, histogram up) with RSI divergence integration for precision.
RSI Filter: Enhances signals with customizable levels (midline, oversold/overbought) and bullish divergence detection.
Ribbon Wave: Visualizes trend strength using three EMAs, colored by MACD and RSI for intuitive momentum cues.
Custom Signals: Includes Green-Yellow Buy, Pullback Sell, and Inverse Pullback Buy, with limits on consecutive signals to prevent overtrading.
Candle & Volume Styling: Blends MACD/RSI colors on candles and scales volume bars to highlight momentum spikes.
Alerts: Set up alerts for VB signals, MACD crosses, Green*Diamond signals, and custom conditions to stay on top of opportunities.
How It Works
Green*Diamond integrates multiple indicators to generate signals:
Volatility Bands: Calculates bands using a pivot SMA and standard deviation. Buy signals trigger on crossovers above the lower band, sell signals on crossunders below the upper band (if enabled).
Consolidation Filter: Suppresses signals when candle ranges are below a threshold, keeping you out of flat markets.
MACD & RSI: Combines MACD conditions (e.g., cross above signal) with RSI filters (e.g., above midline) and optional volume spikes for robust signals.
Custom Logic: Green-Yellow Buy uses MACD bullishness, Pullback Sell targets retracements, and Inverse Pullback Buy catches reversals after downmoves—all filtered to avoid consolidation.
Visuals: Ribbon Wave shows trend direction, candles blend momentum colors, and volume bars scale dynamically to confirm signals.
Settings
Volatility Bands Settings:
VB Lookback Period (20): Adjust to 10–15 for faster markets (e.g., 1-minute scalping) or 25–30 for daily charts.
Upper/Lower Band Multiplier (1.0): Increase to 1.5–2.0 for wider bands in volatile stocks like AEHL; decrease to 0.5 for calmer markets.
Show Volatility Bands: Toggle off to reduce chart clutter.
Use VB Signals: Enable for breakout-focused trades; disable to focus on Green*Diamond signals.
Consolidation Settings:
Consolidation Lookback (14): Set to 5–10 for small caps (e.g., AEHL) to catch quick consolidations; 20 for higher timeframes.
Range Threshold (0.5): Lower to 0.3 for stricter filtering in choppy markets; raise to 0.7 for looser signals.
MACD Settings:
Fast/Slow Length (12/26): Shorten to 8/21 for scalping; extend to 15/34 for swing trading.
Signal Smoothing (9): Reduce to 5 for faster signals; increase to 12 for smoother trends.
Buy/Sell Signal Options: Choose “Cross Above Signal” for classic MACD; “Histogram Up” for momentum plays.
Use RSI Div + MACD Cross: Enable for high-probability reversal signals.
RSI Settings:
RSI Period (14): Drop to 10 for 1-minute charts; raise to 20 for daily.
Filter Level (50): Set to 55 for stricter buys; 45 for sells.
Overbought/Oversold (70/30): Tighten to 65/35 for small caps; widen to 75/25 for indices.
RSI Buy/Sell Options: Select “Bullish Divergence” for reversals; “Cross Above Oversold” for momentum.
Color Settings:
Adjust bullish/bearish colors for visibility (e.g., brighter green/red for dark themes).
Border Thickness (1): Increase to 2–3 for clearer candle outlines.
Volume Settings:
Volume Average Length (20): Shorten to 10 for scalping; extend to 30 for swing trades.
Volume Multiplier (2.0): Raise to 3.0 for AEHL’s volume surges; lower to 1.5 for steady stocks.
Bar Height (10%): Increase to 15% for prominent bars; decrease to 5% to reduce clutter.
Ribbon Settings:
EMA Periods (10/20/30): Tighten to 5/10/15 for scalping; widen to 20/40/60 for trends.
Color by MACD/RSI: Disable for simpler visuals; enable for dynamic momentum cues.
Gradient Fill: Toggle on for trend clarity; off for minimalism.
Custom Signals:
Enable Green-Yellow Buy: Use for momentum confirmation; limit to 1–2 signals to avoid spam.
Pullback/Inverse Pullback % (50): Set to 30–40% for small caps; 60–70% for indices.
Max Buy Signals (1): Increase to 2–3 for active markets; keep at 1 for discipline.
Tips and Tricks
Scalping Small Caps (e.g., AEHL):
Use 1-minute charts with VB Lookback = 10, Consolidation Lookback = 5, and Volume Multiplier = 3.0 to catch $0.10–$0.20 moves.
Enable Green-Yellow Buy and Inverse Pullback Buy for quick entries; disable VB Signals to focus on Green*Diamond logic.
Pair with SMC+ green boxes (if you use them) for reversal confirmation.
Day Trading:
Try 5-minute charts with MACD Fast/Slow = 8/21 and RSI Period = 10.
Enable RSI Divergence + MACD Cross for high-probability setups; set Max Buy Signals = 2.
Watch for volume bars turning yellow to confirm entries.
Swing Trading:
Use daily charts with VB Lookback = 30, Ribbon EMAs = 20/40/60.
Enable Pullback Sell (60%) to exit after rallies; disable RSI Color for cleaner candles.
Check Ribbon Wave gradient for trend strength—bright green signals strong bulls.
Avoiding Noise:
Increase Consolidation Threshold to 0.7 on volatile days to skip false breakouts.
Disable Ribbon Wave or Volume Bars if the chart feels crowded.
Limit Max Buy Signals to 1 for disciplined trading.
Alert Setup:
In TradingView’s Alerts panel, select:
“GD Buy Signal” for standard entries.
“RSI Div + MACD Cross Buy” for reversals.
“VB Buy Signal” for breakout plays.
Set to “Once Per Bar Close” for confirmed signals; “Once Per Bar” for scalping.
Backtesting:
Replay on small caps ( Float < 5M, Price $0.50–$5) to test signals.
Focus on “GD Buy Signal” with yellow volume bars and green Ribbon Wave.
Avoid signals during gray consolidation squares unless paired with RSI Divergence.
Usage Notes
Markets: Works on stocks, forex, crypto, and indices. Best for volatile assets (e.g., small-cap stocks, BTCUSD).
Timeframes: Scalping (1–5 minutes), day trading (15–60 minutes), or swing trading (daily). Adjust settings per timeframe.
Risk Management: Combine with stop-losses (e.g., 1% risk, $0.05 below AEHL entry) and take-profits (3–5%).
Customization: Tweak inputs to match your strategy—experiment in replay to find your sweet spot.
Disclaimer
Green*Diamond is a technical tool to assist with trade identification, not a guarantee of profits. Trading involves risks, and past performance doesn’t predict future results. Always conduct your own analysis, manage risk, and test settings before live trading.
Feedback
Love Green*Diamond? Found a killer setup?
Mercury Venus Conjunction Sextiles 2019-2026How to Use It and What It Means Astrologically
How to Use the Script in TradingView
This Pine Script, called "Mercury Venus Aspects 2019–2026," is made to highlight the dates of Mercury-Venus conjunctions (0°) and sextiles (60°) from 2019 to 2026 on TradingView charts. Here's how to use it:
click “Add to Chart.” It will apply to any chart you have open—stocks, forex, crypto, etc.
Customize the Display
You can turn on/off the visibility of conjunctions and sextiles using checkboxes under "Inputs" in the settings.
You can also adjust the label size (small, normal, large, or huge) for better readability on your chart.
What You’ll See on the Chart
Conjunctions appear as blue shaded zones with labels like “C1,” “C2,” etc. These mark dates when Mercury and Venus are at the same degree.
Sextiles show up in orange with labels like “S1,” “S2,” marking when they’re about 60° apart.
Each event spans a 2-day window (one day before and after the exact aspect).
How to Use It Practically
You can overlay the script on market charts to look for any patterns between these planetary aspects and price movements.
You can also use it to plan personal or financial activities, since these aspects often affect communication, money, and relationships.
What to Keep in Mind
Dates are approximate and based on average planetary cycles (Mercury: ~88 days, Venus: ~225 days). For exact timing, use an ephemeris.
Only conjunctions and sextiles are shown. Oppositions, squares, and trines aren’t included because Mercury and Venus never get far enough apart (more than 75°).
This script is great for astrologers, traders, and enthusiasts who want to see Mercury-Venus aspects directly on their charts and explore their possible effects.
Astrological Meaning of Mercury-Venus Aspects
What Mercury and Venus Represent
Mercury rules communication, thinking, technology, travel, and trade. In global events (mundane astrology), it affects media, markets, and movement of information.
Venus is about love, beauty, money, and pleasure. It influences relationships, aesthetics, and finance. In the world stage, it’s linked to luxury, art, fashion, and economic balance.
When Mercury and Venus form aspects (like conjunctions or sextiles), their energies mix in helpful ways that can affect people and events.
Conjunction (0°) – Mercury and Venus Together
These two planets are in the same sign and degree, so their qualities merge.
For people:
Positive: Smooth communication, charm, creativity, and better relationships. Great for romance, art, and social interaction.
Negative: Too much focus on appearances, sweet talk, or pleasure can cloud judgment. Decisions may lack depth.
For the economy:
Positive: Boosts in media, entertainment, fashion, and tech. Good for trade, deals, and optimism in financial markets.
Negative: Risk of overspending or unrealistic expectations. May cause small market bubbles or misleading hype.
Sextile (60°) – Mercury and Venus in Harmony
These two planets are two signs apart, creating a smooth, supportive energy.
For people:
Positive: Easy conversations, creative teamwork, small financial wins, and pleasant social experiences.
Negative: Energy is mild, so opportunities might be missed if not acted on. People may avoid hard decisions.
For the economy:
Positive: Gradual improvements in areas like marketing, social media, hospitality, and design. Good for diplomacy.
Negative: Lack of strong initiative could limit bigger gains. Minor missteps are possible due to a laid-back attitude.
General Effects
These aspects are mostly beneficial. They support creativity, financial thinking, and social harmony.
Downsides: Conjunctions may lead to overindulgence or shallow choices, while sextiles may cause missed chances due to low energy.
These aspects rarely cause major economic shifts on their own but can amplify trends depending on other planetary influences (like Saturn or Uranus).
Zodiac Sign Influence
Fire signs (Aries, Leo, Sagittarius): Bold communication, energetic spending, gains in media or entertainment.
Earth signs (Taurus, Virgo, Capricorn): Practical results, stable finances, growth in real-world assets like property or food.
Air signs (Gemini, Libra, Aquarius): Intellectual growth, tech innovation, and social ideas flourish.
Water signs (Cancer, Scorpio, Pisces): Emotional depth in conversations, artistic growth, and financial sensitivity.
Mercury-Venus aspects are gentle but helpful. They combine logic (Mercury) with emotion and value (Venus). They’re good times for love, communication, and money—but their benefits depend on how we use the energy. This script lets you easily track these moments on a chart and explore how they might align with real-life trends or decisions.
Disclaimer: This script and its interpretations are for informational and educational purposes only. They do not constitute financial, trading, or professional astrological advice. Always conduct your own research and consult qualified professionals before making any financial or personal decisions. Use at your own discretion.
Dskyz Adaptive Futures Elite (DAFE)Dskyz Adaptive Futures Edge (DAFE)
imgur.com
A Dynamic Futures Trading Strategy
DAFE adapts to market volatility and price action using technical indicators and advanced risk management. It’s built for high-stakes futures trading (e.g., MNQ, BTCUSDT.P), offering modular logic for scalpers and swing traders alike.
Key Features
Adaptive Moving Averages
Dynamic Logic: Fast and slow SMAs adjust lengths via ATR, reacting to momentum shifts and smoothing in calm markets.
Signals: Long entry on fast SMA crossing above slow SMA with price confirmation; short on cross below.
RSI Filtering (Optional)
Momentum Check: Confirms entries with RSI crossovers (e.g., above oversold for longs). Toggle on/off with custom levels.
Fine-Tuning: Adjustable lookback and thresholds (e.g., 60/40) for precision.
Candlestick Pattern Recognition
Eng|Enhanced Detection: Identifies strong bullish/bearish engulfing patterns, validated by volume and range strength (vs. 10-period SMA).
Conflict Avoidance: Skips trades if both patterns appear in the lookback window, reducing whipsaws.
Multi-Timeframe Trend Filter
15-Minute Alignment: Syncs intrabar trades with 15-minute SMA trends; optional for flexibility.
Dollar-Cost Averaging (DCA) New!
Scaling: Adds up to a set number of entries (e.g., 4) on pullbacks/rallies, spaced by ATR multiples.
Control: Caps exposure and resets on exit, enhancing trend-following potential.
Trade Execution & Risk Management
Entry Rules: Prioritizes moving averages or patterns (user choice), with volume, volatility, and time filters.
Stops & Trails:
Initial Stop: ATR-based (2–3.5x, volatility-adjusted).
Trailing Stop: Locks profits with configurable ATR offset and multiplier.
Discipline
Cooldown: Pauses post-exit (e.g., 0–5 minutes).
Min Hold: Ensures trades last a set number of bars (e.g., 2–10).
Visualization & Tools
Charts: Overlays MAs, stops, and signals; trend shaded in background.
Dashboard: Shows position, P&L, win rate, and more in real-time.
Debugging: Logs signal details for optimization.
Input Parameters
Parameter Purpose Suggested Use
Use RSI Filter - Toggle RSI confirmation *Disable 4 price-only
trading
RSI Length - RSI period (e.g., 14) *7–14 for sensitivity
RSI Overbought/Oversold - Adjust for market type *Set levels (e.g., 60/40)
Use Candlestick Patterns - Enables engulfing signals *Disable for MA focus
Pattern Lookback - Pattern window (e.g., 19) *10–20 bars for balance
Use 15m Trend Filter - Align with 15-min trend *Enable for trend trades
Fast/Slow MA Length - Base MA lengths (e.g., 9/19) *10–25 / 30–60 per
timeframe
Volatility Threshold - Filters volatile spikes *Max ATR/close (e.g., 1%)
Min Volume - Entry volume threshold *Avoid illiquid periods
(e.g., 10)
ATR Length - ATR period (e.g., 14) *Standard volatility
measure
Trailing Stop ATR Offset - Trail distance (e.g., 0.5) *0.5–1.5 for tightness
Trailing Stop ATR Multi - Trail multiplier (e.g., 1.0) *1–3 for trend room
Cooldown Minutes - Post-exit pause (e.g., 0–5) *Prevents overtrading
Min Bars to Hold - Min trade duration (e.g., 2) *5–10 for intraday
Trading Hours - Active window (e.g., 9–16) *Focus on key sessions
Use DCA - Toggle DCA *Enable for scaling
Max DCA Entries - Cap entries (e.g., 4) *Limit risk exposure
DCA ATR Multiplier Entry spacing (e.g., 1.0) *1–2 for wider gaps
Compliance
Realistic Testing: Fixed quantities, capital, and slippage for accurate backtests.
Transparency: All logic is user-visible and adjustable.
Risk Controls: Cooldowns, stops, and hold periods ensure stability.
Flexibility: Adapts to various futures and timeframes.
Summary
DAFE excels in volatile futures markets with adaptive logic, DCA scaling, and robust risk tools. Currently in prop account testing, it’s a powerful framework for precision trading.
Caution
DAFE is experimental, not a profit guarantee. Futures trading risks significant losses due to leverage. Backtest, simulate, and monitor actively before live use. All trading decisions are your responsibility.
Statistical OHLC Projections [neo|]█ OVERVIEW
Statistical OHLC Projections is an indicator designed to offer users a customizable deep-dive on measuring historical price levels for any timeframe. The indicator separates price into two distinct levels, "Manipulation" and "Distribution", where the idea is that for higher timeframe candles, e.g. an up-close candle, the distance from the open to the bottom of the wick would constitute the Manipulation, and the rest would be considered the Distribution. By measuring out these levels, we can gain insight on how far the market may move from higher timeframe opens to their manipulations and distributions, and apply this knowledge to our analysis.
IMPORTANT: Since levels are based on the lookback available on your chart, if the levels aren't being displayed this likely means you don't have enough lookback for your selected timeframe. To check this, enable the stat table to see how many values are available for your timeframe, and either reduce the lookback or increase your chart timeframe.
█ CONCEPTS
The core concept revolves around understanding market behavior through the lens of historical candle structure. The indicator dissects OHLC data to provide statistical boundaries of expected price movement.
- Manipulation Levels: These represent the areas typically seen as liquidity grabs or false moves where price extends in one direction before reversing.
- Distribution Levels: These highlight where the bulk of directional movement tends to occur, often following the manipulation move.
The tool aggregates this data across your selected timeframe to inform you of potential levels associated with it.
█ FEATURES
Multiple Display Types: Display statistical data through two sleek styles, areas or lines. Where areas represent the area between two customizable lookback values, and lines represent one average value.
Adjustable Timeframe Selection: Whether you want to see data based on the 1D chart, or the 1W chart, anything is possible. Simply change the timeframe on the dropdown menu and if there is sufficient lookback the indicator will adjust to your requested timeframe.
Customizable Historical Lookback: By default, the indicator will measure the average 60 values of your requested timeframe, however this may be adjusted to be higher or lower based on your preference. If you want to measure recent moves, 10-20 lookback may be better for you, or if you want more data for less volatile instruments, a value of 100 may be better.
Historical Display: Prevent historical levels from being removed by unchecking the "Remove Previous Drawings" option, this will allow you to examine how the levels previously interacted with price.
NY Midnight Anchoring: By checking the "Use NY Midnight" option, you may see the projection anchored to the New York midnight open time, which is often a significant level on indices.
Alerts: You may enable alerts for any of the indicator's provided levels to stay informed, even when off the charts.
█ How to use
To use the indicator, simply apply it to your chart and modify any of your desired inputs.
By default, the indicator will provide levels for the "1D" timeframe, with a desired lookback of 60, on most instruments and plans this can be gotten when you are on the 30 minute timeframe or above.
When price reaches or extends beyond a manipulation level, observe how it reacts and whether it rejects from that level, if it does this may be an indication that the candle for the timeframe you selected may be reversing.
█ SETTINGS AND OPTIONS
Customize the indicator’s behavior, timeframe sources, and visual appearance to fit your analysis style. Each setting has been designed with flexibility in mind, whether you're working on lower or higher timeframes.
Display Mode: Switch between different display styles for levels: - Default: Shows all statistical levels as individual lines.
- Areas: Plots filled zones between two customizable lookbacks to represent the range between them.
This is ideal for visually mapping high-probability zones of price activity.
Timeframe Settings:
- Show First/Second Timeframe: Choose to show one or both timeframe projections simultaneously.
- First Timeframe / Second Timeframe: Define the higher timeframe candle you want to base calculations on (e.g., 1D, 1W).
- Use NY Midnight: When enabled and using the daily timeframe, the levels will be anchored to the New York Midnight Open (00:00 EST), a key institutional timing reference, especially useful for indices and forex.
Calculation Settings:
- Main Lookback Period: The number of historical candles used in the statistical calculations. A lower number focuses on recent price action, while a higher number smooths results across broader history.
- First Lookback / Second Lookback: Used when “Areas” mode is selected to define the range of the shaded zone. For example, an area from 20 to 60 candles creates a band between short- and long-term price behavior averages.
Visual Settings:
- Line Style: Set your preferred visual style: Solid, Dashed, or Dotted.
- Remove Previous Drawings: When enabled, only the most recent projection is shown on the chart. Disable to retain previous levels and visually backtest their reactions over time.
Color Settings:
Customize each level independently to match your chart theme:
- Manipulation High/Low
- Distribution High/Low
- Open Level
- Label Text Color
Premium/Discount Zones:
- Enable Premium/Discount Zones: Overlay price zones above and below equilibrium to visualize potential overbought (premium) and oversold (discount) areas.
- Premium/Discount Colors: Fully customizable zone colors for clarity and emphasis.
Table Settings:
- Show Statistics Table: Adds an on-chart table summarizing key levels from your active timeframe(s).
- Table Cell Color: Set the background color of the table cells for visibility.
- Table Position: Choose from preset chart locations to position the table where it works best for your layout.
Alerts:
Stay on top of price interactions with key levels even when you're away from the charts.
- Manipulation Hits (High)
- Manipulation Hits (Low)
- Distribution Hits (High)
- Distribution Hits (Low)
4 EMA with Two Timeframes and Supertrend by Natee L.Key Features:
Customizable Timeframes:
The script has two inputs (timeframe_1 and timeframe_2) where you can select the timeframes for the two sets of EMAs. For example, you could choose:
timeframe_1 = "60" for 1-hour (60-minute) EMAs.
timeframe_2 = "240" for 4-hour (240-minute) EMAs.
Four EMAs for Each Timeframe:
It calculates 4 EMAs for both the first timeframe (timeframe_1) and the second timeframe (timeframe_2).
Plotting:
The EMAs for timeframe 1 are plotted in solid colors (blue, red, green, and purple).
The EMAs for timeframe 2 are plotted with a transparent effect (using color.new), so they are visually distinct but less dominant than the first timeframe's EMAs.
How to Use:
The timeframe_1 and timeframe_2 inputs allow you to select any timeframes you prefer (e.g., "15", "30", "60", "D", "W", etc.).
The EMAs for both selected timeframes will be plotted, allowing for easy comparison between the two timeframes on the same chart.
Explanation of the Updates:
Supertrend Calculation:
The Supertrend is calculated using the ta.supertrend function, which requires two parameters:
multiplier: The multiplier used for the Average True Range (ATR) calculation.
atr_period: The period for the ATR (usually set to 14).
The supertrend variable represents the value of the Supertrend, and direction is a boolean value indicating whether the trend is up (green) or down (red).
Supertrend Plot:
The Supertrend is plotted on the chart using the plot() function. The color is determined by the direction variable:
Green if the trend is up.
Red if the trend is down.
The Supertrend line is drawn with a linewidth of 2 for visibility.
Inputs:
atr_period: The period used for the ATR calculation, typically 14.
multiplier: The multiplier for the ATR to determine the offset for the Supertrend line.
How It Works:
The 4 EMAs are calculated for both timeframes (timeframe_1 and timeframe_2), just like before.
The Supertrend is calculated based on the ATR and the multiplier parameters, and it's plotted on the main chart.
The Supertrend changes color based on the trend direction (green for an uptrend, red for a downtrend).
Customization:
You can adjust the ATR period and multiplier as needed via the input fields.
You can also adjust the timeframes (timeframe_1 and timeframe_2) for the EMAs.
This script now combines the 4 EMAs and Supertrend indicators for two different timeframes, giving you a powerful tool for trend analysis and crossover strategies.