[Excalibur][Pandora][Mosaic] Ultra Spectrum Analyzer@veryfid, you will always be remembered eternally...
ANCIENT MYTHOS AND LORE:
The retellings of "Pandora's Box" serve as a cautionary metaphor depicting an opened container (pithos - jar) that once held profound perils and evils — sufferings that are experienced around the world in various forms. The known and vague mythical box contents actually represent manifestation of evils, situational adversities, and human disparities that have been encountered throughout life for aeons. In contemporary times, a meager list of ordeals would include incidents of deceit, betrayal, corruption, oppression, greed, envy, depravity, conflict, mania, affliction, plague, and mortality. However, as the tale is told, kept and remaining inside the box was the essence of expectant hope (elpis), which may represent the optimism and resilience to overcome immense hardships.
There are other versions of the classic story where Pandora isn't actually the culprit, being her husband Epimetheus was the lid lifting perpetrator and the one who always and actually received the gift(s). Curiously, the interpreted Greek word ‘Pandora’ translated to English, can mean either "all-endowed" or "all-gifting". Much like Pandora herself, who was formed from clay of the earth, the jar also would have been most likely crafted from clay. Conceived as a made-to-order maiden for an arranged marriage, Pandora was given qualities of exquisite beauty, persuasive charm, all while being adorned with jewelry and fine clothing. Olympian premeditated preparations in the didactic fable of 'Works and Days' by Hesiod had blamable intent and would be later used for centuries as denigration of women/mothers. The rest of Hesiod's tale is even worse.
In reality, the entire contrived exploit of incarnating Pandora as a trojan temptress was solely intended as an instrument of infiltration and entrapment for delivery to Epimetheus as an arranged seductive snare. Being a man myself, I find it appalling how the antiquated writings of ancient morphological men have repeatedly ostracized women for many of the ailments of mankind. When in truth, it is far more often that despicable men are the recorded all time winning historical harbingers of global abysmal darkness by means of ideological treachery. Vast historical chronicles since antiquity have frequently recorded who the typical real-world villains truly are and are not. As the stories are told in the first place, it was dictator Zeus along with his Olympian conspirators, who intently implanted malicious spirits into a gifted receptacle to orchestrate planetary suffering and carnage on humankind.
PROLOGUE:
I believe, it is way past overdue to restore Pandora's name to a place of better standing. As I have been peaking into a theoretical pitcher of mathematic mysteria for years now, where no one else dares to look. Once upon a time, I pondered an opposite notion: What if Pandora was originally conceived to solve global problems instead of creating them? Maybe Pandora could have been wielded into existence to wage unrelenting and avenging retribution on every dominance hierarchy and each diabolical enemy intently hostile to humankind. My hypothetical version of Pandora would take the notion of "mors omnibus tyrannis" to a whole other fearsome magnitude. She would cause evil arrogant men to tremble with sheer horror... the kind of fear ALL false gods, despotic kings, tyrannical dictators, controligarchies, and criminal syndicates truly worry about at night. In my opinion, that would be a better fictional story worthy of retelling for aeons.
One unique goliath 21st century adversary is LAG and it must be subdued or minimized. This unyielding nemesis is also known as group delay, processing delay, and algorithmic latency. My eyes are locked onto this opponent with fixation that will never surrender a staring contest. The formidable creature lag is my daily arch enemy destined for defeat in battle. It's losing time after time and bar by bar during the past year of 2023. In my attempts to peer through the murky darkness of useless and deceptive information, I am confident that I have found more suitable answers to many current dilemmas of algorithmic lag.
The internet, using mathematics and the speed of light as a planetary beneficial advantage, has already performed wonders by drastically reducing the delay of dissemination of knowledge. This has garnered a mostly positive rapid acceleration of economic evolution. However, hierarchies of dark forces of chaos and subversion by the thousands lurking in the global shadows are not thrilled about well informed populations. In the present era, new spectrums of strife within planetary societies are being waged, one of the worst forms taking the hideous form of censorship. Other nefarious tactics are hindering economic progress with substantial negativity using heavily funded penetration and infiltration operations. Those sinister operational varieties are spanning psychological, cultural, educational, digital, financial, electoral, scientific, medical, biological, commercial, infrastructural, institutional, and organizational domains.
They are mistakenly meddling with the entire primordial order of planetary natural dynamics. The miscalculations from these malevolent CAUSES will be countered with EFFECTS of immense retaliatory primal veracity having equal or exceedingly more powerful opposition with overwhelming numbers in mass. It is a law embedded within the universe that supersedes ALL laws, known as 'causality'. Everyone, especially programmers, know exactly what to do with predatory infiltrating cockroaches... When tyranny becomes enforced law by agendized policies in any land, order = abs(DUTY) * pow(RIGHT) * exp(PEOPLE).
FUTURE ECONOMIC ADVERSARIAL CHALLENGES:
Just as programmers have to critically analyze our code for BUGS, a scrutinized analysis of the current world around us is at times necessary. It is an empirical statistical fact that a few percent of captains at the helm of industry, commerce, institutes, and governance are monetarily psychopathic. They are often hidden bugs operating within national systems. The subsequent economic consequences result in effects that aren't always clearly obvious to all. Here are a few global economic security issues...
Corrupted immoral code in national operation is an inevitable breakdown waiting to happen. In the harsh future to follow, old degenerate interdependent control systems will need to be dismantled and discarded, eventually succeeded by having resilient parallel arrangements with robust independent fidelity. The coming successive paradigm shifts would include future hardware and the hefty novel algorithms that will run on them afterwards. Evolution is inevitable! The internet must be upgraded and continually programmed securely to the near hardness of diamonds at multiple layers within the operational code to retain peaceful global integrity between international collaborations.
DigitalID is never going to fix an insecure vulnerable titanic network of devices full of holes taking in megatons of water from every direction. Weaponized digital mucking ID dead on arrival is certainly NOT a one size fits all solution and it still doesn't do diddly-squat to secure the internet's DNA as executable code. DigID's real purpose is to manage servitude digitally and keep citizens right where they want them, as subservient slaves.
There is a very specific reason why we have key chain rings in OUR pockets with numerous private keys evolving technologically over time to robustly safeguard individual locks we use every day, duh. AI becoming an artificial sentient hyper intelligence may sooner or later become a potential hazard, especially if it breaks AES192 into a thousand shards of glass. Perilous aspects from artilects will emerge and are coming swiftly. AI is already being weaponized and tasked to mind muzzle expressions of human consciousness.
Also, EMPs from the sun ARE an imminent planetary threat, and no amount of carbon taxation schemes inciting anthropomorphic climate hysteria originating from falsified modeling hocus-pocus is going to protect against extreme solar cycle related X-class phenomena. Our solar system candle called the sun, is not consistently energy irradiation stable if you just glance at SOHO images/video. There are very obvious cyclical frequencies within the dynamics of the sun's energetic activity that affect planets far beyond earth. The earth already has a built-in natural thermometer indicating that oceans have been rising very linearly for thousands of years since the last ice age, submerging entire ancient cities under coastal water dozens of meters.
BEAR with me and pardon my French translation, but I have the option to call major league climate BULLshite. There is no hardcore "anthropomorphic climate crisis" proof. It is a crisis in failed modeling that is insufficient to properly estimate colossal computations with dircet limited empirical data with enough accuracy to anticipate higly probable future outcomes. People deserve solid science instead of slanderous smackdowns and slighted statistics. 400ppm of atmospheric CO2 is nothing compared to previously existing 1600ppm concentrations acquired from ancient indirect historical observations at a time when early humans were hunter gatherers driving gas guzzlers.
Western climate-monger fortune tellers are scamming every nation on earth, betraying the collective human species worldwide by climate hype strangulation. Wait until the sheeple with dinner forks turn on the rabid wolves in shepherds's clothing; it has already begun. What these predatory profiteering fraudsters are not telling you is WATER (H2O) in earth's atmosphere is the all time dominating and potent greenhouse gas, always has been, not CO2. Dr. Willie Soon has explained it in the best of ways with clarity. Misleaders, banksterCorpses, and mediaPresstitutes are immensely involved in this hot model scheme and like keeping people right where they want them, force fed with mental filth with regularly scheduled socially engineered programming.
Beware of agendas and isms. The ESGovernanceAgenda is ready made economic coffin nails. I'll explain this very simply, a future green war on carbon is a silent war on carbon lifeforms and economies. Many of the smiling faces you can actually see on the world stage pulling levers are often the coldest blooded deceivers beyond anything you can ever imagine. In truth, corporate agents and policies are the greatest devastators to ecologies, while in concert, they are incessantly waging blame campaign agendas with subversive narratives by targeting consumers as the wrongdoers.
Why am I mentioning all these adversarial difficulties? Well, the intertangling myriads of tomorrow's "bundle of burdens" in a future box ALL have to be thoroughly analyzed, sifted through, and dealt with tenaciously now and in the future by generations to come in every nation state. Some days I wonder if Hesiod's fiction was taken from reality over 2000 years ago to WARN future world inhabitants. In the scope of economics, the series of incidents that have or will lead up to major world events, will need to have the frequency of related occurrences examined that lead up to crucial points in time historically. In order to prevent future disparities, our progeny will look backwards into history with ultra clarity and vigilance to see how corrupted society once was by hordes of overlords twisted by obsessive delusions of absolute power over the entire human species. There is no human race, only diverse genetic multiformity expressed from the DNA code of humankind exists.
We can't simply put the lid back on low entropy hydroCarbons and a broadband globalNet without having an implemented proven replacement or upgrade. It's far too late, leaving only wiser security chess moves forward as the only viable options. Nikola Tesla was dreaming of this daily in order to build every foundation of modern civilization that we now enjoy today and take for granted. Humanity still has to evolve by unlocking hidden secrets of mother nature. For instance, nations powered by endless geothermal electricity and deuterium fusion WILL solve a lot of the world's problems. Imagine our world dominantly powered by extreme abundant amounts of heavy water... Lady destiny awaits and begs for the future to be built securely, by eventual abandonment of antiquated wheelworks that eventually deserve to be hurled into the annihilatory dustbin of history.
SPECTRAL BURDENS:
Ephemeral 'spectral contents' are extremely difficult to decipher with the least amount of lag, especially while they reside within a noise ridden non-stationary environment. When 'lifting the lid off' of series analysis to peek with quick discernment, distinguishing between real-time relevant signals differing from intertwining undesirable randomness in a crowded information space, requires special kinds of intricate extraction. Due to the nature of fractal chaos, any novel spectral method is better than the scanty few we have now. Firstly, let's comprehend agilities of interpreting a spectrum's structure...
SPECTRAL ANALYSIS PURPOSE AND INTENTION:
Frequency Analysis - Spectral analysis serves a crucial purpose in unraveling the frequency composition of a signal. Its primary intention is to explore the intricacies of a dataset by identifying dominant frequencies and unveiling inherent cyclical patterns. This foundational understanding forms the basis for improving analyses.
Power Spectrum Visualization - The visualization of a signal's power spectrum is a key objective in spectral analysis. By portraying how power is distributed across different frequencies, the goal is to provide a visual representation of the signal's energy landscape. This insight aids with grasping the significance of various frequency components obtained from a larger whole.
Signal Characteristics - Understanding the traits of a signal is another vital goal. Spectral analysis seeks to characterize the nature of the signal, unveiling its periodicity, trends, or irregularities. This knowledge is instrumental in deciphering the behavior of the signal over time, fostering a deeper comprehension.
Algorithmic Adaptation - Spectral analyzer estimation can play a pivotal role in algorithmic development. By assisting with the creation of algorithms sensitive to specific frequency ranges, one possible advantage is to enable real-time adaptability. This adaptability approach may allow algorithms to respond dynamically to variations in different spectral components, potentially enhancing their efficacy.
Market Analysis - In the realm of trading systems and financial markets, spectral analysis methods can serve as applicable functions when studying market dynamics. By 'uncovering' trends, cycles, and anomalies within financial instruments, this analytical proficiency can aid traders and algorithm developers with making better informed decisions based on the spectral attributes of market data.
Noise/Interference Detection - Another purpose of spectral analysis is to identify and scrutinize undesirable elements within a signal, such as noise or interference. One benefit would be to facilitate the development of strategies to mitigate or eliminate these unwanted components, ultimately refining the quality of a given signal with filtration.
INTRODUCTION:
Allow me to introduce Pandora! What you see in the demonstration above, I've named it "Pandora Periodogram", which is also referred to as 'Ultra Spectrum Analyzer' (USA) for technical minds. Firstly, this is NOT technically speaking an indicator like most others. I would describe it as an avant-garde cycle period detector obtaining accurate spectral estimates on market data with Pine Script v5.0. USA is a spectral analysis cryptid that I can only describe as being an alien saber in nature. It is my rendering of spectral wrath unleashed. With time and history to come, my HOPE is this instrument will reveal Excalibur like aspects capable of slicing up a spectrum craftily, traits long thought to be a mythical enigma.
It is not modified forms of either Autocorrelation Periodogram (ACP) or MESA. Pandora's Periodogram embodies an entirely distinct design, adorned with glamourous color, by incorporating several of my most profound, highly refined technological innovations that I have poetically composed into being. What I have forged in Pine, has essentially manifested as a zero lag spectrum analyzer. Pandora easily peeks inside a single signal source more effectively to inspect for hidden spectres, revealing invisible apparitions inside data with improved clarity...
My 'Ultra Spectrum Analyzer' bears an eerie likeness to Autocorrelation Periodogram, but it possesses no autocorrelation and the other small hindrances of ACP that I formerly encountered. While ACP does have a few shortcomings, a few bars of lag, and high frequency bias, it is still phenomenal code. ACP is one answer to spectral enigmas, but not the only one. Developers can utilize this detector by creating scripts that employ a "Dominant Cycle Source" input to adaptively govern algorithms. If you are capable of building suitable algorithms for direct tethering to Autocorrelation Periodogram, then this is your next step in evolutionary application to tether to when you are ready. ACP is a good place to start building upon as an exploratory vessel, before you might ponder using USA. Once you do obtain dynamic ACP sweetness with only a few pesky bars of dominant cycle induced lag, USA may be your tool chest choice without the burden of subtle ACP lag.
USA is possibly the end of my quest for spectral bliss, for the time being. However, I still suspect there is more room for upgrades to Pandora in the future. I must mention, as an overture, this won't be the last of Pandora tech that you will witness, as my literal "out of the box thinking" will unleash many additional creations upon this Earth. The "Power of Pine" merely serves as the beginning foundational phase... Some of my futuristic dreams and daydreams of TradingView are droplets in a wavy ocean of economic providence and potential.
What I am crafting in poetic form is born out of raw curiosity. Future creations are probably best kept private for now, but I will present my future tech with beauty and elegance as it should rightfully be. There's one catch, I have absolutely no idea what this and my future marvels may do to the future of digital signal processing (DSP) and markets. I do fear any insane AI or MALEficent entity ever seeing this code. My innermost hopes and ambitions are always focused on achieving the best result obtainable. What the future can hold, may be absolutely exquisite to gaze upon, maybe even monstrous, or possibly a combination of both.
Notice: Unfortunately, I will not provide any integration support into member's projects at all. My own projects demand too much of my day to day time. I hope you understand. Meanwhile, I'll be applying this on future indication until Mr. Mortality sneaks up behind me.
FEATURES AND CHARACTERISTICS:
I have included as much ultra adjustability as I can humanly muster. Those features being the following and more...
Color Preferences - Four vivid color schemes are available in the original release. The "Ultra Violet" color scheme, in particular, contributes to the indicator's technical title, as it seems to me to reveal the greatest detail of my various spectral color schemes. Color inversion of the four color schemes is also possible, yielding eight schemes in total with predator style visuals. Heatmap transparency control is also provided.
Lag Control - Pandora achieves zero lag spectral approximations, with the added capability to control lag using an input for selectable delay. Note, however, that testing less than zero lag has not been assessed thoroughly due to potential unforeseen instability concerns. Adjustments are provided in either direction for further testing.
Spectral Bias Mitigation - Options for mitigating high OR low-frequency spectral biases are present. One interesting tweak made during development was a subtle form of spectral manipulation, involving a partial reduction of frequency amplitudes influencing either the highest or lowest periodicities. This slightly reduces the impact on the upper and lower portions of the spectrogram and the dominant cycle measurement. What initially surfaced as an unexpected discovery, may now be considered worthy of experimental utility.
Adjustable Periodogram Window Size - The periodogram is adjustable for various window sizes of periodic operation. Exploration up to a periodicity of 59 is obtainable for curiosity's sake. This flexibility challenges the notion that curiosity isn't always a negative trait, contrasting with Hesiod's ancient perspective.
Dominant Cycle Filtration - Filtration of the dominant cycle is achieved with a novel smoother having reduced lag, easily surpassing SuperSmoother's performance. However, defeating lag completely on that one plot() function was elusive.
Tooltips for Control Intention - The settings commonly include handy and informative tooltips that provide information eluding to the intention behind the various controls provided.
Initialization Advantages - Initialization of USA accomplishes what Autocorrelation Periodogram (ACP) didn't. Spectral analysis begins on the earliest visible bars, starting at period 2. Users need to ensure their algorithm's integrity from period 2 upwards to beyond 40ish, establishing a viable operational range for dynamically governing those algorithms. It's notable that stochastics and correlations have a minimum operable critical period of 2, distinct from most low-pass filters that can actually achieve a period of 1 (which is the raw signal itself). Proper initialization of complex IIR filters is particularly effective, especially with smaller initialization periods.
Remaining options and features are comparable to my Enhanced Autocorrelation Periodogram in terms of comprehension, and other upgrades may be added in the future upon discovery.
PERIODOGRAM INTERPRETATION:
The periodogram heatmap renders a power spectrum of a signal visually by color, where the y-axis represents periodicity (frequencies/wavelengths) and the x-axis is delineating time. The y-axis is divided into periods, with each elevation portraying demarcation of periodicity. In this periodogram, the y-axis ranges from 4 at the very bottom to 49 (or greater) at the top, with intermediary values in between, all conveying power of the corresponding frequency component by color. The higher the position ascends on the y-axis, the longer the cycle period or lower the frequency. The x-axis of the periodogram signifies time and is partitioned into equal chart intervals, where each vertical column corresponds to the time interval when the signal was measured. Most recent values/colors are on the right side of the periodogram.
Intensity of the colors on the periodogram signify the power level of the corresponding frequency or cycle period. For example, the "Fiery Embers" color scheme is distinctly like heat intensity from any casual flame witnessed in a small fire from a lighter, match, or campfire. The most intense power exhibited would be represented by the brightest of yellow, while the lowest power would be indicated by the darkest shade of red or just black. By analyzing the pattern of colors across different periods, one may gain insights into the dominant frequency components of the signal and visually identify recurring cycles/patterns of periodicity.
Spectrum
[Excalibur] Ehlers AutoCorrelation Periodogram ModifiedKeep your coins folks, I don't need them, don't want them. If you wish be generous, I do hope that charitable peoples worldwide with surplus food stocks may consider stocking local food banks before stuffing monetary bank vaults, for the crusade of remedying the needs of less than fortunate children, parents, elderly, homeless veterans, and everyone else who deserves nutritional sustenance for the soul.
DEDICATION:
This script is dedicated to the memory of Nikolai Dmitriyevich Kondratiev (Никола́й Дми́триевич Кондра́тьев) as tribute for being a pioneering economist and statistician, paving the way for modern econometrics by advocation of rigorous and empirical methodologies. One of his most substantial contributions to the study of business cycle theory include a revolutionary hypothesis recognizing the existence of dynamic cycle-like phenomenon inherent to economies that are characterized by distinct phases of expansion, stagnation, recession and recovery, what we now know as "Kondratiev Waves" (K-waves). Kondratiev was one of the first economists to recognize the vital significance of applying quantitative analysis on empirical data to evaluate economic dynamics by means of statistical methods. His understanding was that conceptual models alone were insufficient to adequately interpret real-world economic conditions, and that sophisticated analysis was necessary to better comprehend the nature of trending/cycling economic behaviors. Additionally, he recognized prosperous economic cycles were predominantly driven by a combination of technological innovations and infrastructure investments that resulted in profound implications for economic growth and development.
I will mention this... nation's economies MUST be supported and defended to continuously evolve incrementally in order to flourish in perpetuity OR suffer through eras with lasting ramifications of societal stagnation and implosion.
Analogous to the realm of economics, aperiodic cycles/frequencies, both enduring and ephemeral, do exist in all facets of life, every second of every day. To name a few that any blind man can naturally see are: heartbeat (cardiac cycles), respiration rates, circadian rhythms of sleep, powerful magnetic solar cycles, seasonal cycles, lunar cycles, weather patterns, vegetative growth cycles, and ocean waves. Do not pretend for one second that these basic aforementioned examples do not affect business cycle fluctuations in minuscule and monumental ways hour to hour, day to day, season to season, year to year, and decade to decade in every nation on the planet. Kondratiev's original seminal theories in macroeconomics from nearly a century ago have proven remarkably prescient with many of his antiquated elementary observations/notions/hypotheses in macroeconomics being scholastically studied and topically researched further. Therefore, I am compelled to honor and recognize his statistical insight and foresight.
If only.. Kondratiev could hold a pocket sized computer in the cup of both hands bearing the TradingView logo and platform services, I truly believe he would be amazed in marvelous delight with a GARGANTUAN smile on his face.
INTRODUCTION:
Firstly, this is NOT technically speaking an indicator like most others. I would describe it as an advanced cycle period detector to obtain market data spectral estimates with low latency and moderate frequency resolution. Developers can take advantage of this detector by creating scripts that utilize a "Dominant Cycle Source" input to adaptively govern algorithms. Be forewarned, I would only recommend this for advanced developers, not novice code dabbling. Although, there is some Pine wizardry introduced here for novice Pine enthusiasts to witness and learn from. AI did describe the code into one super-crunched sentence as, "a rare feat of exceptionally formatted code masterfully balancing visual clarity, precision, and complexity to provide immense educational value for both programming newcomers and expert Pine coders alike."
Understand all of the above aforementioned? Buckle up and proceed for a lengthy read of verbose complexity...
This is my enhanced and heavily modified version of autocorrelation periodogram (ACP) for Pine Script v5.0. It was originally devised by the mathemagician John Ehlers for detecting dominant cycles (frequencies) in an asset's price action. I have been sitting on code similar to this for a long time, but I decided to unleash the advanced code with my fashion. Originally Ehlers released this with multiple versions, one in a 2016 TASC article and the other in his last published 2013 book "Cycle Analytics for Traders", chapter 8. He wasn't joking about "concepts of advanced technical trading" and ACP is nowhere near to his most intimidating and ingenious calculations in code. I will say the book goes into many finer details about the original periodogram, so if you wish to delve into even more elaborate info regarding Ehlers' original ACP form AND how you may adapt algorithms, you'll have to obtain one. Note to reader, comparing Ehlers' original code to my chimeric code embracing the "Power of Pine", you will notice they have little resemblance.
What you see is a new species of autocorrelation periodogram combining Ehlers' innovation with my fascinations of what ACP could be in a Pine package. One other intention of this script's code is to pay homage to Ehlers' lifelong works. Like Kondratiev, Ehlers is also a hardcore cycle enthusiast. I intend to carry on the fire Ehlers envisioned and I believe that is literally displayed here as a pleasant "fiery" example endowed with Pine. With that said, I tried to make the code as computationally efficient as possible, without going into dozens of more crazy lines of code to speed things up even more. There's also a few creative modifications I made by making alterations to the originating formulas that I felt were improvements, one of them being lag reduction. By recently questioning every single thing I thought I knew about ACP, combined with the accumulation of my current knowledge base, this is the innovative revision I came up with. I could have improved it more but decided not to mind thrash too many TV members, maybe later...
I am now confident Pine should have adequate overhead left over to attach various indicators to the dominant cycle via input.source(). TV, I apologize in advance if in the future a server cluster combusts into a raging inferno... Coders, be fully prepared to build entire algorithms from pure raw code, because not all of the built-in Pine functions fully support dynamic periods (e.g. length=ANYTHING). Many of them do, as this was requested and granted a while ago, but some functions are just inherently finicky due to implementation combinations and MUST be emulated via raw code. I would imagine some comprehensive library or numerous authored scripts have portions of raw code for Pine built-ins some where on TV if you look diligently enough.
Notice: Unfortunately, I will not provide any integration support into member's projects at all. I have my own projects that require way too much of my day already. While I was refactoring my life (forgoing many other "important" endeavors) in the early half of 2023, I primarily focused on this code over and over in my surplus time. During that same time I was working on other innovations that are far above and beyond what this code is. I hope you understand.
The best way programmatically may be to incorporate this code into your private Pine project directly, after brutal testing of course, but that may be too challenging for many in early development. Being able to see the periodogram is also beneficial, so input sourcing may be the "better" avenue to tether portions of the dominant cycle to algorithms. Unique indication being able to utilize the dominantCycle may be advantageous when tethering this script to those algorithms. The easiest way is to manually set your indicators to what ACP recognizes as the dominant cycle, but that's actually not considered dynamic real time adaption of an indicator. Different indicators may need a proportion of the dominantCycle, say half it's value, while others may need the full value of it. That's up to you to figure that out in practice. Sourcing one or more custom indicators dynamically to one detector's dominantCycle may require code like this: `int sourceDC = int(math.max(6, math.min(49, input.source(close, "Dominant Cycle Source"))))`. Keep in mind, some algos can use a float, while algos with a for loop require an integer.
I have witnessed a few attempts by talented TV members for a Pine based autocorrelation periodogram, but not in this caliber. Trust me, coding ACP is no ordinary task to accomplish in Pine and modifying it blessed with applicable improvements is even more challenging. For over 4 years, I have been slowly improving this code here and there randomly. It is beautiful just like a real flame, but... this one can still burn you! My mind was fried to charcoal black a few times wrestling with it in the distant past. My very first attempt at translating ACP was a month long endeavor because PSv3 simply didn't have arrays back then. Anyways, this is ACP with a newer engine, I hope you enjoy it. Any TV subscriber can utilize this code as they please. If you are capable of sufficiently using it properly, please use it wisely with intended good will. That is all I beg of you.
Lastly, you now see how I have rasterized my Pine with Ehlers' swami-like tech. Yep, this whole time I have been using hline() since PSv3, not plot(). Evidently, plot() still has a deficiency limited to only 32 plots when it comes to creating intense eye candy indicators, the last I checked. The use of hline() is the optimal choice for rasterizing Ehlers styled heatmaps. This does only contain two color schemes of the many I have formerly created, but that's all that is essentially needed for this gizmo. Anything else is generally for a spectacle or seeing how brutal Pine can be color treated. The real hurdle is being able to manipulate colors dynamically with Merlin like capabilities from multiple algo results. That's the true challenging part of these heatmap contraptions to obtain multi-colored "predator vision" level indication. You now have basic hline() food for thought empowerment to wield as you can imaginatively dream in Pine projects.
PERIODOGRAM UTILITY IN REAL WORLD SCENARIOS:
This code is a testament to the abilities that have yet to be fully realized with indication advancements. Periodograms, spectrograms, and heatmaps are a powerful tool with real-world applications in various fields such as financial markets, electrical engineering, astronomy, seismology, and neuro/medical applications. For instance, among these diverse fields, it may help traders and investors identify market cycles/periodicities in financial markets, support engineers in optimizing electrical or acoustic systems, aid astronomers in understanding celestial object attributes, assist seismologists with predicting earthquake risks, help medical researchers with neurological disorder identification, and detection of asymptomatic cardiovascular clotting in the vaxxed via full body thermography. In either field of study, technologies in likeness to periodograms may very well provide us with a better sliver of analysis beyond what was ever formerly invented. Periodograms can identify dominant cycles and frequency components in data, which may provide valuable insights and possibly provide better-informed decisions. By utilizing periodograms within aspects of market analytics, individuals and organizations can potentially refrain from making blinded decisions and leverage data-driven insights instead.
PERIODOGRAM INTERPRETATION:
The periodogram renders the power spectrum of a signal, with the y-axis representing the periodicity (frequencies/wavelengths) and the x-axis representing time. The y-axis is divided into periods, with each elevation representing a period. In this periodogram, the y-axis ranges from 6 at the very bottom to 49 at the top, with intermediate values in between, all indicating the power of the corresponding frequency component by color. The higher the position occurs on the y-axis, the longer the period or lower the frequency. The x-axis of the periodogram represents time and is divided into equal intervals, with each vertical column on the axis corresponding to the time interval when the signal was measured. The most recent values/colors are on the right side.
The intensity of the colors on the periodogram indicate the power level of the corresponding frequency or period. The fire color scheme is distinctly like the heat intensity from any casual flame witnessed in a small fire from a lighter, match, or camp fire. The most intense power would be indicated by the brightest of yellow, while the lowest power would be indicated by the darkest shade of red or just black. By analyzing the pattern of colors across different periods, one may gain insights into the dominant frequency components of the signal and visually identify recurring cycles/patterns of periodicity.
SETTINGS CONFIGURATIONS BRIEFLY EXPLAINED:
Source Options: These settings allow you to choose the data source for the analysis. Using the `Source` selection, you may tether to additional data streams (e.g. close, hlcc4, hl2), which also may include samples from any other indicator. For example, this could be my "Chirped Sine Wave Generator" script found in my member profile. By using the `SineWave` selection, you may analyze a theoretical sinusoidal wave with a user-defined period, something already incorporated into the code. The `SineWave` will be displayed over top of the periodogram.
Roofing Filter Options: These inputs control the range of the passband for ACP to analyze. Ehlers had two versions of his highpass filters for his releases, so I included an option for you to see the obvious difference when performing a comparison of both. You may choose between 1st and 2nd order high-pass filters.
Spectral Controls: These settings control the core functionality of the spectral analysis results. You can adjust the autocorrelation lag, adjust the level of smoothing for Fourier coefficients, and control the contrast/behavior of the heatmap displaying the power spectra. I provided two color schemes by checking or unchecking a checkbox.
Dominant Cycle Options: These settings allow you to customize the various types of dominant cycle values. You can choose between floating-point and integer values, and select the rounding method used to derive the final dominantCycle values. Also, you may control the level of smoothing applied to the dominant cycle values.
DOMINANT CYCLE VALUE SELECTIONS:
External to the acs() function, the code takes a dominant cycle value returned from acs() and changes its numeric form based on a specified type and form chosen within the indicator settings. The dominant cycle value can be represented as an integer or a decimal number, depending on the attached algorithm's requirements. For example, FIR filters will require an integer while many IIR filters can use a float. The float forms can be either rounded, smoothed, or floored. If the resulting value is desired to be an integer, it can be rounded up/down or just be in an integer form, depending on how your algorithm may utilize it.
AUTOCORRELATION SPECTRUM FUNCTION BASICALLY EXPLAINED:
In the beginning of the acs() code, the population of caches for precalculated angular frequency factors and smoothing coefficients occur. By precalculating these factors/coefs only once and then storing them in an array, the indicator can save time and computational resources when performing subsequent calculations that require them later.
In the following code block, the "Calculate AutoCorrelations" is calculated for each period within the passband width. The calculation involves numerous summations of values extracted from the roofing filter. Finally, a correlation values array is populated with the resulting values, which are normalized correlation coefficients.
Moving on to the next block of code, labeled "Decompose Fourier Components", Fourier decomposition is performed on the autocorrelation coefficients. It iterates this time through the applicable period range of 6 to 49, calculating the real and imaginary parts of the Fourier components. Frequencies 6 to 49 are the primary focus of interest for this periodogram. Using the precalculated angular frequency factors, the resulting real and imaginary parts are then utilized to calculate the spectral Fourier components, which are stored in an array for later use.
The next section of code smooths the noise ridden Fourier components between the periods of 6 and 49 with a selected filter. This species also employs numerous SuperSmoothers to condition noisy Fourier components. One of the big differences is Ehlers' versions used basic EMAs in this section of code. I decided to add SuperSmoothers.
The final sections of the acs() code determines the peak power component for normalization and then computes the dominant cycle period from the smoothed Fourier components. It first identifies a single spectral component with the highest power value and then assigns it as the peak power. Next, it normalizes the spectral components using the peak power value as a denominator. It then calculates the average dominant cycle period from the normalized spectral components using Ehlers' "Center of Gravity" calculation. Finally, the function returns the dominant cycle period along with the normalized spectral components for later external use to plot the periodogram.
POST SCRIPT:
Concluding, I have to acknowledge a newly found analyst for assistance that I couldn't receive from anywhere else. For one, Claude doesn't know much about Pine, is unfortunately color blind, and can't even see the Pine reference, but it was able to intuitively shred my code with laser precise realizations. Not only that, formulating and reformulating my description needed crucial finesse applied to it, and I couldn't have provided what you have read here without that artificial insight. Finding the right order of words to convey the complexity of ACP and the elaborate accompanying content was a daunting task. No code in my life has ever absorbed so much time and hard fricking work, than what you witness here, an ACP gem cut pristinely. I'm unveiling my version of ACP for an empowering cause, in the hopes a future global army of code wielders will tether it to highly functional computational contraptions they might possess. Here is ACP fully blessed poetically with the "Power of Pine" in sublime code. ENJOY!
Ehlers Mesa Spectrum Dominant Cycle [CC]The Mesa Spectrum Dominant Cycle was created by John Ehlers and this is the foundation for many indicators he created that would later follow. This is his updated version of his original Mesa algorithm and I do not recommend this indicator as a stand alone for trading. This is more of an informational indicator that will tell you the current dominant cycle period which is the approximate period between peaks and valleys in the underlying data. I have color coded buy signals just in case with both strong and normal signals. Darker colors are strong and lighter colors are normal. Buy when the line is green and sell when it is red.
Let me know if there are any other indicators you would like to see me publish!
[blackcat] L3 Ehlers Spectrogram IndicatorLevel: 3
Background
John F. Ehlers introuced Dominant Cycle and Spectrogram Indicator in Mar, 2008.
Function
In "Measuring Cycle Periods" in Mar, 2008, John Ehlers presented a very interesting technique of measuring dominant market cycle periods by means of multiple bandpass filtering. By utilizing an approach similar to audio equalizers, the signal (here, the price series) is fed into a set of simple second-order infinite impulse response bandpass filters. Filters are tuned to 8,9,10,...,50 periods. The filter with the highest output represents the dominant cycle. This script implements a high-pass filter and a six-tap low-pass Fir filter on input, then 42 parallel Iir band-pass filters. Finally, it plots the Ehlers spectrogram as a heat map.
Ehlers Spectrogram indicates market power status:
With high market power, the spectrogram become fuzzy;
With low market power, the spectrogram become distinct.
It also discloses market dominant cycles and subcycles, which indicates the major rhythm. Regarding the rhythm of the market, Chinese and Western cultures have reached a consensus: Dr. Ehlers can find the main harmonic components of the market through DSP analysis via spectrum; Master Zen compares the market rhythm to Bach’s fugue from a philosophical perspective, where there is a rhythm of life.
Finally, please allow me to quote Master Zen’s statement on market rhythm:
"The market is cruel. For those who try to violate the market rhythm, the market is their death place; the market is beautiful, and the market is Bach’s fugue. There is a rhythm of life. Rhythm is always the rhythm of the market. A market participant without a sense of rhythm is always torturing. Put aside your greed and fear and listen to the rhythm of the market. In the weekend, let go of everything, but listen to the rhythm of nature, the rhythm of life, the rhythm of music, and then come back to listen to the rhythm of the market. Dancing with the market, your greed and fear are peeled off one by one, you will become very bright."
Key Signal
DomCyc--> Ehlers Dominant Cycle
Plot2~Plot60--> Ehlers Spectrum Heat Map
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 73th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Traders voiceThis strange indicator translates traders' decisions into voice! Which Generates a beautiful vocal spectrum of the traders.
The indicator uses high and low pivots with left bars to draw a vocal spectrum of highs and lows (Right Pivot bars are set to 0 by default to prevent repainting, but can be adjusted in settings)
Increasing spectrum means that the divergence between pivot Highs and Lows are increasing (increasing volatility) which leads to a conclusion that traders are starting to SHOUT out Loud!
NOTE: Trend can go either way, Up or Down. It's a cool visual display of the market voices and can be used with other tools.
Follow for new script updates: www.tradingview.com
Strength Analyzer [DW]This is an experimental hybrid between relative strength and spectrum analysis methods aimed to deliver useful insights about cyclical dominance and momentum.
This study utilizes a modified RSI formula and a modified Goertzel algorithm to determine relative strength and spectral dominance for periods 8 through 50.
These periods are theorized by many analysts to be the main cyclical components of market movement.
In this study, you are given the option to apply equalization (EQ) to the dataset before estimating strength.
This enables you to transform your data and observe how strength estimates changes as well.
Whether you want to give emphasis to some frequencies, isolate specific bands, or completely alter the shape of your waveform, EQ filtration makes for an interesting experience.
The default EQ preset in this script cuts low end presence, dampens high frequency oscillations, and cleanly passes main cyclic components.
There are many ways to use EQ to transform your dataset, so play around with the settings and find the presets that work best for your analysis setup.
After EQ processing, the data is then passed through the modified RSI algorithm to generate momentum information
The modified RSI in this script is rescaled to oscillate between -1 and 1, and has the option to pass through a 2 pole Butterworth low pass filter before and after processing for a smoother output.
The strength thresholds are determined by the threshold value, which quantifies distance above and below 0.
The threshold value can also be thought of as conventional RSI distance from 50 rescaled so that an increment of 0.1 is equivalent to an increment of 5 on a conventional RSI.
A threshold value of 0.4 is equivalent to thresholds of 70 and 30 on a conventional RSI, so this is the default. The maximum threshold value is 1, which is equivalent to thresholds of 100 and 0.
This script plots colored sections for each period value using a gradient color scheme based on their respective strength estimates.
The color scheme in this script is a multicolored gradient that shows green scaled colors for bullish strength and red scaled colors for bearish strength.
Darker, less vibrant colors indicate lower strength. Brighter, more vibrant colors indicate higher strength.
Strength values near 0 will show the darkest colors, and values near the positive or negative threshold value will show the brightest.
The data is fed parallel through the modified Goertzel algorithm to obtain cyclic power information and to estimate the dominant cycle.
Gerald Goertzel's algorithm is a unique Fourier related transform that identifies tonal properties by quantifying resonance in a set of second order IIR filters with direct-form structure.
It is computationally more efficient than typical DFT or FFT algorithms, and yields decent spectral resolution.
In this variation of the algorithm, data is first passed through a 2 pole high pass filter to attenuate spectral dilation, then passed through a Hamming Window to tidy up the frequency range.
The clean windowed data is then passed through a recursive resonance loop over the frequency block to calculate filter coefficients, which are then used to identify real and imaginary magnitude components.
From there, the magnitude components are used to calculate cyclic power.
The power outputs of each period are then compared for dominant cycle estimation, which is plotted over the gradient.
The dominant cycle can also be optionally smoothed or halved based on your preferences.
Bar colors are included in this script. The color scheme is a gradient based on dominant cycle momentum.
Signals and alert conditions are included in this script as well, and can be customized to your liking.
The two main signal types in this script are:
-> Dominant Cycle - Signals based on dominant cycle or half dominant cycle changes from positive to negative strength or vice versa.
-> Confluence - Signals based on confluence emergence. Based on the majority of measured cycles or all measured cycles showing positive or negative strength.
The signals in this are also externally accessible by other scripts.
The output format is 1 for long signals, and -1 for short signals.
To integrate these signals with your own system, use a source input in your script and assign it to this script's "Direction Signals" output variable from the dropdown tab.
In addition, I included two external output variables that show dominant cycle strength and average cycle strength.
They can be integrated into your own scripts by using a source input and selecting the proper output variable, just like the signals.
The Strength Analyzer is a versatile and powerful analytical tool to have in the arsenal for generating unique insights about momentum and cycle dominance.
By analyzing strength on a spectral basis, we can look at relative price movements on a deeper level and gain insights that aren't necessarily obvious from simply looking at a price chart.
------------------------------------------------
This is a premium script, and access is provided on an invite-only basis.
To gain access, get a copy of the script overview, or for any other inquiries, send me a direct message!
I look forward to hearing from you!
------------------------------------------------
General Disclaimer:
Trading stocks, futures, Forex, options, ETFs, cryptocurrencies or any other financial instrument has large potential rewards, but also large potential risk.
You must be aware of the risks and be willing to accept them in order to invest in stocks, futures, Forex, options, ETFs or cryptocurrencies.
Don’t trade with money you can’t afford to lose.
This is neither a solicitation nor an offer to Buy/Sell stocks, futures, Forex, options, ETFs, cryptocurrencies or any other financial instrument.
No representation is being made that any account will or is likely to achieve profits or losses of any kind.
The past performance of any trading system or methodology is not necessarily indicative of future results.
------------------------------------------------
Note:
Because TV's UI can't handle displaying style options for 43 fills with 42 colors, the color scheme of the analyzer is currently not editable.
However, no other sacrifices to functionality or quality were made in this project.
As the TV team performs updates on the platform, the ability to customize this color scheme will likely come as well.
Also, it's important to note that this script uses a heavy amount of calculations to generate this output.
At times (very infrequently), TV will throw an error message saying "Calculation Takes Too Long", likely due to a momentary lull in available server space.
If you receive this error, simply hide then unhide the indicator, and everything should function as expected.
Ehlers Spectrum Derived Filter Bank [CC]The Spectrum Derived Filter Bank was created by John Ehlers (Stocks & Commodities V. 26:3 (16-22)) and this is technically two indicators in one. This will let you know the current cycle period which is in blue and the other indicator will let you know if you should buy the stock or not. Buy when it is green and sell when it is red.
Let me know if you would like me to publish other scripts or if you want something custom done!
Note: I'm republishing this because the original script couldn't be found in searches so this will fix that.
Volume Volatility SpectrumThis indicator estimates price volatility and it is based on Volume only (presumably Tick Volume in Forex).
Tick volume is supposed to be a good proxy to actual volume in spot forex (study of Caspar Marney, 2011)
The advantage of this indicator is that it can be used with any pair, any timeframe.
The only parameters are the periods of the reference Volume Moving Average and the fast Volume MA.
The fluctuations of a short period Volume MA with respect to a gently MA with high period
are calculated.
RED areas depict low volatility
GREEN areas depict high volatility.
When the clouds are outside the region delimited by the aqua lines we have extreme conditions:
Extremely low volatility = red cloud outside the aqua bands
Extremely high volatility = green cloud outside the aqua bands
Vitelot/yanez/Vts September 2019.
Compare this indicator with the ATR Volatility Spectrum of myself
[nv]SpectrumDEMAThis indicator Plots in different colors different kinds of Moving Averages with multiple options including the volume weighted average price.