AIAE: Average Investor's Allocation To EquityPeople say a bull market ends when there are no more buyers left on the market and a bear market ends when there are no more sellers. Well, this indicador shows exactly this.
It uses FRED data to compare the total value invested on stocks with the total value held by investors to find the percentage that is allocated to stocks.
The exact formula used to calculate this index was created by pseudonymous Jesse Livermore and is available for free to anyone who wishes to consult it in his blog Philosophical Economics . The only thing I'm adding here that wasn't available on Jesse's index is the color code.
This script will use Jesse's formula to find the average investor's allocation to equity at any given time. Then, it will color the SPDR (S&P 500) according to this allocation.
A high allocation to equity means we could be close to a market correction, so it will color the SPDR in red and a low allocation means we could be close to a market bottom, so it will color the SPDR in blue.
Here's the exact color parameters used:
switch
AIAE <= 23 => priceLevel := "Gift"
AIAE > 23 and AIAE <=26 => priceLevel := "Very Cheap"
AIAE > 26 and AIAE <= 29 => priceLevel := "Cheap"
AIAE > 29 and AIAE <= 32 => priceLevel := "Slightly Cheap"
AIAE > 32 and AIAE <= 37 => priceLevel := "Neutral"
AIAE > 37 and AIAE <= 40 => priceLevel := "Slightly Expensive"
AIAE > 40 and AIAE <= 43 => priceLevel := "Expensive"
AIAE > 43 and AIAE <= 46 => priceLevel := "Very Expensive"
AIAE > 46 => priceLevel := "Exuberant"
Please note that this indicador should ONLY be used on the SPDR (S&P 500). It will not produce adequate results if used on other assets.
Cyclestudies
Bitcoin wave modelBitcoin wave model is based on the logarithmic regression model and the sinusoidal waves, induced by the halving events.
This chart presents the outcome of an in-depth analysis of the complete set of Bitcoin price data available from October 2009 to August 2023.
The central concept is that the logarithm of the Bitcoin price closely adheres to the logarithmic regression model. If we plot the logarithm of the price against the logarithm of time, it forms a nearly straight line.
The parameters of this model are provided in the script as follows: log (BTCUSD) = 1.48 + 5.44log(h).
The secondary concept involves employing the inherent time unit of Bitcoin instead of days:
'h' denotes a slightly adjusted time measurement intrinsic to the Bitcoin blockchain. It can be approximated as (days since the genesis block) * 0.0007. Precisely, 'h' is defined as follows: h = 0 at the genesis block, h = 1 at the first halving block, and so forth. In general, h = block height / 210,000.
Adjustments are made to account for variations in block creation time.
The third concept revolves around investigating halving waves triggered by supply shock events resulting from the halvings. These halvings occur at regular intervals in Bitcoin's native time 'h'. All halvings transpire when 'h' is an integer. These events induce waves with intervals denoted as h = 1.
Consequently, we can model these waves using a sin(2pih - a) function. The parameter determining the time shift is assessed as 'a = 0.4', aligning with earlier expectations for halving events and their subsequent outcomes.
The fourth concept introduces the notion that the waves gradually diminish in amplitude over the progression of "time h," diminishing at a rate of 0.7^h.
Lastly, we can create bands around the modeled sinusoidal waves. The upper band is derived by multiplying the sine wave by a factor of 3.1*(1-0.16)^h, while the lower band is obtained by dividing the sine wave by the same factor, 3.1*(1-0.16)^h.
The current bandwidth is 2.5x. That means that the upper band is 2.5 times the lower band. These bands are forming an exceptionally narrow predictive channel for Bitcoin. Consequently, a highly accurate estimation of the peak of the next cycle can be derived.
The prediction indicates that the zenith past the fourth halving, expected around the summer of 2025, could result in prices ranging between 200,000 and 240,000 USD.
Enjoy the mathematical insights!
Market Time Cycle (Expo)█ Time Cycles Overview
Time cycles are a fascinating and powerful concept in the world of trading and investing. They are all about understanding and predicting the timing of market moves based on the premise that market events and price movements are not random, but instead occur in repeatable, cyclical patterns.
The Concept of Time Cycles: The foundation of time cycles lies in the belief that historical market patterns tend to repeat themselves over specific periods. These periods or cycles could be influenced by a myriad of factors like economic data releases, earnings reports, geopolitical events, or even natural human behavior. For example, some traders observe increased market activity around the start and end of a trading day, which is a form of intraday time cycle.
Understanding time cycles can provide traders with a roadmap, helping them anticipate potential trend shifts and make more informed decisions about when to buy or sell.
█ Indicator Overview
The Market Time Cycle (Expo) is designed to help traders track and analyze market cycles and generate signals for potential trading opportunities. It uses mathematical techniques to analyze market cycles and detect possible turning points. It does this by projecting the estimated cycle timeline and providing visual indications of cyclical phases through the use of color-coded lines and sine wave cycles.
Time cycles offer a compelling way to forecast market trends and time your trades better. By adding time cycles to your trading toolbox, you could potentially gain a new perspective on market movements and refine your trading strategy further. The indicator generates trading signals based on the sine wave's behavior. When the sine wave crosses certain thresholds, the indicator generates a signal suggesting a potential trading opportunity based on cycle behavior.
█ How to use
This indicator can be a valuable tool to help traders understand and predict market trends and time their trades more accurately. By visualizing the cyclic nature of markets, traders can better anticipate potential turning points and adjust their trading strategies accordingly. It helps traders to spot ideal entry and exit points based on the cyclical nature of financial markets.
█ Settings
You can customize the number of bars (NumbOfBars) that are taken into consideration for the cycle. Including a higher number of bars will provide more data, which can be helpful for analyzing long-term trends.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Benner-Fibonacci Reversal Points [CC]This is an original script based on a very old idea called the Benner Theory from the Civil War times. Benner discovered a pattern in pig iron prices (no clue what those are), and this turned out to be a parallel idea to indicators based on Fibonacci numbers. Because a year is 365 days (nearly 377, which is a Fibonacci number), made up of 52 weeks (nearly 55, which is another Fibonacci number), or 12 months (nearly 13, which is another Fibonacci number), Benner theorized that he could find both past and future turning points in the market by using a pattern he found. He discovered that peaks in prices seemed to follow a pattern of 8-9-10, meaning that after a recent peak, it would be 8 bars until the next peak, 9 bars until after that peak for the next, and 10 bars until the following peak. For past peaks, he would just need to reverse this pattern, and so the previous peak would be 10 bars before the most current peak, 9 bars before that peak, and 8 bars before the previous one, and these patterns seemed to repeat. For troughs, he found a pattern of 16,18,20 which follows the same logic, and this idea also seemed to work on long-term peaks and troughs as well.
This is my version of the Benner theory and the major difference between my version and his is that he would manually select a year or date and either work backwards or forwards from that point. I chose to go with an adaptive version that will automatically detect those points and plot those past and future points. I have included several options such as allowing the algorithm to be calculated in reverse which seems to work well for Crypto for some reason. I also have both short and long term options to only show one or both if you choose and of course the option to enable repainting or leave it disabled.
Big thanks to @HeWhoMustNotBeNamed and @RicardoSantos for helping me fix some bugs in my code and for @kerpiciwuasile for suggesting this idea in the first place.
Prime, E & PI Superiority CyclesIf you have been studying the markets long enough you will probably have noticed a certain pattern. Whichever trade entry/exit logic you try to use, it will go through phases of working really well and phases where it doesn't work at all. This is the markets way of ensuring anyone who sticks to an oversimplified, one-dimensional strategy will not profit. Superiority cycles are a method I devised by which code interrogates the nature of where price has been pivoting in relation to three key structures, the Prime Frame, E Frame and Pi Frame which are plotted as horizontal lines at these values:
* Use script on 1 minute chart ONLY
prime numbers up to 100: 2.0,3.0,5.0,7.0,11.0,13.0,17.0,19.0,23.0,27.0,29.0,31.0,37.0,41.0,43.0,47.0,53.0,59.0,61.0,67.0,71.0,73.0,79.0,83.0,89.0,97.0
multiples of e up to 100: 2.71828, 5.43656, 8.15484, 10.87312, 13.5914, 16.30968, 19.02796, 21.74624, 24.46452, 27.1828, 29.90108, 32.61936, 35.33764,
38.05592, 40.7742, 43.49248, 46.21076, 48.92904, 51.64732, 54.3656, 57.08388, 59.80216, 62.52044, 65.23872, 67.957, 70.67528, 73.39356000000001, 76.11184,
78.83012, 81.5484, 84.26668000000001, 86.98496, 89.70324, 92.42152, 95.13980000000001, 97.85808
multiples of pi up to 100: 3.14159, 6.28318, 9.424769999999999, 12.56636, 15.70795, 18.849539999999998, 21.99113, 25.13272, 28.27431, 31.4159, 34.55749,
37.699079999999995, 40.840669999999996, 43.98226, 47.12385, 50.26544, 53.40703, 56.54862, 59.69021, 62.8318, 65.97339, 69.11498, 72.25657, 75.39815999999999,
78.53975, 81.68133999999999, 84.82293, 87.96452, 91.10611, 94.2477, 97.38929
These values are iterated up the chart as seen below:
The script sums the distance of pivots to each of the respective frames (olive lines for Prime Frame, green lines for E Frame and maroon lines for Pi Frame) and determines which frame price has been reacting to in the least significant way. The worst performing frame is the next frame we target reversals at. The table in the bottom right will light up a color that corresponds to the frame color we should target.
Here is an example of Prime Superiority, where we prioritize trading from prime levels:
The table and the background color are both olive which means target prime levels. In an ideal world strong moves should start and finish where the white flags are placed i.e. in this case $17k and $19k. The reason these levels are 17,000 and 19,000 and not just 17 and 19 like in the original prime number sequence is due to the scaling code in the get_scale_func() which allows the code to operate on all assets.
This is E Superiority where we would hope to see major reversals at green lines:
This is Pi Superiority where we would hope to see major reversals at maroon lines:
And finally I would like to show you a market moving from one superiority to another. This can be observed by the bgcolor which tells us what the superiority was at every historical minute
Pi Frame Superiority into E Frame Superiority example:
Prime Frame Superiority into E Frame Superiority example:
Prime Frame Superiority into Pi Frame Superiority example:
By rotating the analysis we use to enter trades in this way we hope to hide our strategy better from market makers and artificial intelligence, and overall make greater profits.