Mean Shift Pivot ClusteringCore Concepts
According to Jeff Greenblatt in his book "Breakthrough Strategies for Predicting Any Market", Fibonacci and Lucas sequences are observed repeated in the bar counts from local pivot highs/lows. They occur from high to high, low to high, high to low, or low to high. Essentially, this phenomenon is observed repeatedly from any pivot points on any time frame. Greenblatt combines this observation with Elliott Waves to predict the price and time reversals. However, I am no Elliottician so it was not easy for me to use this in a practical manner. I decided to only use the bar count projections and ignore the price. I projected a subset of Fibonacci and Lucas sequences along with the Fibonacci ratios from each pivot point. As expected, a projection from each pivot point resulted in a large set of plotted data and looks like a huge gong show of lines. Surprisingly, I did notice clusters and have observed those clusters to be fairly accurate.
Fibonacci Sequence: 1, 2, 3, 5, 8, 13, 21, 34...
Lucas Sequence: 2, 1, 3, 4, 7, 11, 18, 29, 47...
Fibonacci Ratios (converted to whole numbers): 23, 38, 50, 61, 78, 127, 161...
Light Bulb Moment
My eyes may suck at grouping the lines together but what about clustering algorithms? I chose to use a gimped version of Mean Shift because it doesn't require me to know in advance how many lines to expect like K-Means. Mean shift is computationally expensive and with Pinescript's 500ms timeout, I had to make due without the KDE. In other words, I skipped the weighting part but I may try to incorporate it in the future. The code is from Harrison Kinsley . He's a fantastic teacher!
Usage
Search Radius: how far apart should the bars be before they are excluded from the cluster? Try to stick with a figure between 1-5. Too large a figure will give meaningless results.
Pivot Offset: looks left and right X number of bars for a pivot. Same setting as the default TradingView pivot high/low script.
Show Lines Back: show historical predicted lines. (These can change)
Use this script in conjunction with Fibonacci price retracement/extension levels and/or other support/resistance levels. If it's no where near a support/resistance and there's a projected time pivot coming up, it's probably a fake out.
Notes
Re-painting is intended. When a new pivot is found, it will project out the Fib/Lucas sequences so the algorithm will run again with additional information.
The script is for informational and educational purposes only.
Do not use this indicator by itself to trade!
Циклический анализ
Interest Rates | USA / EU / UKThis script shows the Interest Rates of the USA, EU and UK.
USA = Red
EU = Blue
UK = White
CyclesTime based indicator attempting to show changes in a cycle based on the different time elapsed between new highs and new lows in a given time period. Useful when combined with elliott wave price structure. A drop above/below 0 suggests a wave 4 whilst new highs/lows of the indicator suggest whether a bullish or bearish trend is in place. You can change the time cycle as you like. Any Q's please post, i'll be happy to answer them. (If I can)
MACRO BTC HEALTH 1WThis indicator is used as MACRO tool to view the outlook of BTC on the 1W time frame to illustrate (BLX chart works best)
BTC's price action and where it's at, it helps provide an indication of the crypto market's current health as BTC health is an overall indicator in the crypto market as a whole.
This indicator uses historic data to fit between 4 bands fitted to MA, top(red) when BTC is overheated, 2 bands in middle(yellow) when BTC in fair value, and bottom band(blue) when BTC is oversold
I combined MA that fit BTC 1W chart precisely to show when BTC looks overheated vs over sold using historic data.
When BTC is in the top bands historically overheated.
When BTC is in the middle it is fighting at fair value with the 2 yellow lines in the middle, bullish when above yellow lines, as they act as support, and in downtrend when price is below yellow lines and can act as resistance.
Historically the 200W MA is where BTC finds support at an oversold level at the bottom blue line.
When two yellow lines in middle cross downwards historically results in a downtrend to the bottom oversold line (blue). and when two yellow lines cross up and BTC holds them as support bullish trend continues until it is overheated passed the red band.
This indicator is not meant for day trading but is meant to illustrate a MACRO view of BTC current situation from a zoomed-out view, and to help illustrate to investors where things are at so they leave emotions out of the market and can make decisions based on BTC current levels using Historic data. Pro tip use bottom line(blue, oversold) as an opportunity to buy in and top line red(overheated) to scale out of positions, LONG TERM CRYPTO IS BULLISH BUT GREAT TO GET AN OUTLOOK OF THE CURRENT STATE OF BTC, WHILE ALSO USING MACRO ECONOMIC SENTIMENT IRL, FUNDAMENTAL ECONOMIC DECISIONS, ECONOMIC CONDITIONS/ENVIRONMENT, ECONOMIC HEALTH ,FED DECISIONS, INTEREST RATE ENVIRONMENT AND OF COURSE LOOKING AT CRYPTO ADOPTION.
Hope this indicator helps leave emotions out of the market by providing a good guide of BTC sentiment, and its current health to make decisions accordingly. NFA but good to envision the MACRO BTC HEALTH at the 1W timeframe.
100W sma/200W smaThis is an Indicator specifically made for BTC/USD ( Index)
Zoom out on Daily and Weekly candles as much and you can SEE a trend . A very very important trend and you shall remember this indicator with Years to come . This is a VERY long term type indicator and can help you with long term hodling investor mindset analysis .
Periodic CycleAllows visualizing a periodic cycle based on startdate, cycle period and part of cycle to be highlighed.
Long Term: Cumulative Moving AverageWho to use?
This indicator is for Long Term Investors or for Position trading and not for Day traders.
What time-frame to use?
• Daily, Weekly or Monthly
What is Blue line?
• Blue line is Cumulative Moving Average. It is cumulative sum of closing price.
• It is a trend reversal level.
• It is a strong support level.
• If price is below Blue line better not to take any Long position until it crosses above it.
What are Red lines?
• Red lines are Multiplier levels.
• These are target levels to exit the position.
• It can be breakout or pull back levels.
• The level combination numbers can be fully odd or even numbers.
• For example in certain stocks the working levels will be 1x, 3x, 5x etc., in others it will be even numbers like 2x, 4x, 6x etc.
• In some cases the levels need to be tweaked with custom decimals like 1.1x, 2.1x, 3.1x, 4.1x etc. to align the support & resistance levels.
How to use?
Entry
• Enter when the Price reach closer to the Blue line.
• Enter Long when the Price takes a pullback or breakout at the Red lines.
Exit
• Exit position when the Price reach closer to the Red lines in Long positions.
Indicator Menu
• Works only in higher time-frames like D, W & M.
• Will not work in Lower time-frames less than "D" or the Launch Date shows wrong in Lower time-frames.
Multipliers:
(Read above What are Red lines?)
Launch Date:
• Launch Date: Starting date of stock when it appeared in the exchange. Works only in D, W & M timeframes.
• Years: Total number of years from the Launch Date. Accurate date will be shown in Daily timeframe.
• Candles Count: Total number of candles from the Launch Date in the current timeframe.
Labels:
• First number is last traded price.
• Second number in () is percentage change from last traded price to that level.
Accumulation/Distribution Bands & Signals (BTC, 1D, BITSTAMP) This is an accumulation/distribution indicator for BTC/USD (D) based on variations of 1400D and 120D moving averages and logarithmic regression. Yellow plot signals Long Term Accumulation, which is based on 1400D (200W) ALMA, orange plot signals Mid Term Accumulation and is based on 120D ALMA, and finally the red plot signals Long Term Distribution that's based on log regression. It should be noted that for red plot to work BTC 1D BITSTAMP graph must be used, because the function of the logarithmic regression was modified according to the x axis of the BITSTAMP data.
Signal bands have different coefficients; long term accumulation (yellow) and and the log regression (red) plots have the highest coefficients and mid term accumulation (orange) has the lowest coefficients. Coefficients are 6x, 3x and 1.5x for the red (sell) and yellow (buy) plots and 1x, 2x and 3x for the orange (buy) plot. Selling coefficient for the yellow and the orange plots are respectively 2x and 1x. Buy and sell signals are summed up accordingly and plotted at the top of the highest band.
Acknowledgement: Credits for the logarithmic regression function are due @memotyka9009 and Benjamin Cowen
Vertical lines period 9,26,51 Ichimokuallows you to view the old prices on periods 9, 26 and 51 on the Ichimoku indicator. Periods and color can be changed. Can be used on all products. it saves you from having to count the old candles
Simple FX Market Hours█ OVERVIEW
A simple market session indicator that show you what market is in session according to the timezone you configured. It will draw a table with 4 cells matching 4 market Sydney, Tokyo, London and New York. Whenever market is in session the matching text will change colour.
█ WHAT MAKE THIS DIFFERENT
All other indicator on the market are either bar colouring, background colouring, or some sort of box drawing on the chart which is very messy and cluttered your chart. This indicator is as simple as it gets. The label are positions by default at the top right corner (you can change this in the config). It doesn’t draw anything on your chart so you can get right into your price action without anything blocking you.
Also, these type of indicator on the market are not auto converting the market session time to your your configured timezone, you will have to manually entered in the market session hours in your local time. This indicator does! Or perhaps I didn’t look hard enough. Either way I think there aren’t any indicator that are this simple.
█ HOW IT WORKS
I’m using table function (available to pinescript version 4 and above) to position the market labels and change colour of them according to if the market is in session or not.
For timezone, I have predefined all the market hours in all of the timezone from GMT-12 to GMT+12. When you select your timezone it will convert it to the symbol’s exchange timezone. Feel free to update the timezone if I had it incorrectly.
This script doesn’t take into account the DST because DST doesn’t starts or ends on a fixed date.
I also put in a check for symbol type using: syminfo.type == "forex”. So that it will only display if you are on forex pairs. You don’t need to hide it while you are looking at crypto or other assets. For convenience purposes.
█ NOTES
If you like the script be sure to press the like button it will help shows other people that this is useful. Thank you very much!
BTC Gravity OscillatorThis indicator is a deviation of a Center of Gravity Oscillator corrected for the diminishing returns of Bitcoin.
I've set up this indicator for it to be used on the weekly timeframe. The indicator oscillates between 0 and 10, where 0 indicates oversold conditions and 10 indicates overbought conditions.
The indicator plots in any BTCUSD spot, futures , BLX index and BTCEUR .
It paints in all time frames, but Weekly time frame is the correct one to interpret the 'official' read of it.
Hourly Range SeparatorHourly Range Separator is a useful tool to display a hourly vertical line separator in less than 1H timeframes like as 1M, 5M, 15M and etc.
You can change Lines color, style and width from Indicator settings.
Notice : We used vline() function for building this Indicator.
Good trading to all ...
Buy Monday, Exit Tuesday with Stop Loss and Take ProfitStrategy to go long at end of Monday before market closes and exit before Tuesday close, or at stop loss or take profit percentages
This runs strategy on entering by weekday name and also by session time.
Implemented are also Take Profit and Stop Loss to exit position using custom inputs.
Added stoploss and take profit plot lines
Compound Indicator Strategy - BTC/USDT 3hThis is an Strategy finds and utilise end points of short term market trends and this is a combination of many indicators such as
1. Volume change oscillator
2. Money flow index ( MFI )
3. Momentum Oscillator (MOM)
4. Stochastic Indicator
6. Relative Strength Indicator ( RSI )
7. Relative volatility index (RVI)
8. Balance of power (BOP)
9. Small moving average ( SMA )
10. Exponential moving average ( EMA )
11. Parabolic SAR
12. Super trend indicator
this script forms a compound indicator after analysing movements of those indicators through different time frames and measure its co-relation and variance with the price action. buy doing that, indicator in a position to identify short term market reversals and presented.
after generating a common indicator, it evaluates standard deviation and standard variance with currant market price action and generates a buy and sell signals. you can determine your own trading method based on available options.
INVEST BTC RSI (from @tradinglord)RSI VERSION - no alerts
The script highlight point of interest for investors using EMA , RSI and a bit of criticism.
The script is built to be used on a weekly timeframe
When RSI is bellow 35 it can be interesting to invest in BTC , on the opposite when it is above 80 can be where to take a bit of profits.
Also using EMA to flow with the power of the trend or change your bias depending on conditions.
Feel free to use the included alerts to be informed when RSI is telling you something.
The idea is quite simple, and you will not gain x100 your investment, but with these kind of investments and some patience you could make your way out.
Obviously not financial advice, understand what you are doing.
"Sometimes it's better to be rational monkey than a greedy baboon" - Tradinglord 2022
INVEST BTC (from @tradinglord)The script highlight point of interest for investors using EMA, RSI and a bit of criticism.
The script is built to be used on a weekly timeframe
When RSI is bellow 35 it can be interesting to invest in BTC, on the opposite when it is above 80 can be where to take a bit of profits.
Also using EMA to flow with the power of the trend or change your bias depending on conditions.
Feel free to use the included alerts to be informed when RSI is telling you something.
The idea is quite simple, and you will not gain x100 your investment, but with these kind of investments and some patience you could make your way out.
Obviously not financial advice, understand what you are doing.
"Sometimes it's better to be rational monkey than a greedy baboon" - Tradinglord 2022
AltSessionHello World
It’s no secret that trading sessions play a massive role in market movement and liquidity. We can clearly see in the image about how important identifying international trading hours are for a trader.
The Asian session starts around 1am GMT and often has a bearish bias through this session lasting for a few hours, after which Frankfurt and London traders start to come online and can often reverse the Asian sentiment.
The London session is the best session to trade traditionally starting around 7am GMT before the American traders come online and reverse market once again.
We have designed this indicator to help identify different trading hours easily with a background shade on the chart and also high/lows of the training session, as these levels can often be revisited.
We hope you find this indicator useful and please feel free to drop a comment if you have any updates you wish to be made or any future indicator script ideas, thank you.
Modified Mannarino Market Risk Indicator & Bubbles
Modified Mannarino Market Risk Indicator
MMRI = DXY * 10Y Yield
MMMRI = MMRI * (Debt/GDP)
Color Indicators
Green ~ Low Risk
Yellow - Mod Risk
Red - High Risk
Purple - Extreme Risk
Bubbles Formula (MMMRI_DK)
DXY*(10Y + FED Rate)* (Shiller P/E Ratio) * (Warren Buffet Indicator)*(Debt/GDP) /1.61
Similar to the Shiller P/E Ratio - you need to look back to see where the bubbles were. The difference between the Dot Com bubble and subsequent ones is that we now have QE which is why I included the FED Rate + 10Y.
Color Indicators
Green ~ Low Risk
Yellow - Mod Risk
Red - High Risk
Purple - Extreme Risk
Future Bubbles Formula (MMMRI_DK_Fut)
DXY*(10Y + Future FED Rate)* (Shiller P/E Ratio) * (Warren Buffet Indicator)*(Debt/GDP) /1.61
Assumes that the 10Y is fixed but what is important is that you will get an idea on when the system may pop.
Lankou Shad helperdisplay values of the current price x2 and x4 and /2, /4
it permit to compare the security values to its past and see if x2 is nearly probable are totally out of reach, he same for /2 of price.
It can be used for Sell Half At Double strategy: SHAD.