TradingView
ImmortalFreedom
Aug 23, 2020 10:28 PM

Composite Synchronous Sinusoidal Harmonics Waveform Generator 

Amplify Energy Corp.NYSE

Description

Wait, "Composite Synchronous Sinusoidal Harmonics Waveform Generator", say what?? What on earth is that, and what function does this script perform? Keep reading and discover! It's intended and provided freely to use for any TV member at any skill level, not just at the engineering level. This is also available for anyone becoming fluent with why stocks/markets fluctuated the way that they do.

Don't let the entitled name frighten you, it's actually surprisingly fun to just fiddle with. This is ALSO a ingenious PSv4 tinker toy. Change any input() and see how one subtle settings alteration dramatically changes the entire fractal. You might learn something new about this giant financial game we all are determined to play anyways. Double and triple tops, head and shoulders, bounces, cup/handle, consolidations, and MANY-MANY other things are revealed on how they come to exist and why. Funny thing is, this is occurring in minds of traders psychologically. You, me, everyone! Ponder that.

Initially, I wanted a synthetic signal "generator", where I would know for certain what the specific "composing" frequencies are for testing, spectral analysis, filtering, and pattern recognition purposes. Inherent "harmonics" affect nearly every algorithmic indicator you have seen or that may come to exist. While encountering a plethora of cycles, you may see exactly how well your indicators/filters perform when "sourced" to this script with `src = input(close, "Source", input.source)`. Keep in mind, open, high, low, and volume variables are NOT available, if they are employed in your indicators calculations. Feel free to tether this to TV built-in indicators or create your own in TV's Pine Editor, if a source input() isn't already provided. See what happens...

Educating you informatively further, there are "synchronous" irregular harmonic frequencies just like this that do in fact exist in tickers everywhere. While this script's specific generated "sinusoidals" are completely stationary, the ones you will see in REAL price action are ephemeral, emerging and disappearing at any time unexpectedly. The remarkable thing about my creation is, you may notice patterns in the generated fundamental "waveform" that are eerily similar to actual stock market fractal patterns encountered everyday. On just spontaneous random chance, I found a recognizable pattern on a watch list asset displayed above, without looking for it before publishing this. I did not cherry pick that or tune the settings to it. I just bumped up the chart interval one notch and offset the waveform quickly.

As you can witness looking closer, there are numerous pure sine waves artificially created with different amplitudes and phase shifts to form unique patterns that combine together in most unique ways appearing fractal in nature. The sine waves are not derived from any ticker price/volume that you maybe viewing, and should look similar on any time frame chosen. Don't worry about chart intervals. The combination of these with simple addition results in the most unique of waveforms in white. You will notice "dominant cycles", as Dr. John Ehlers would describe them, are the prevailers in movement. Yet those smaller cycles have enormous influence over more powerful cycles and ultimately our indicators.

One intention not included at initial release is a preset waveforms input() to instantly generate very specific patterns, such as a pseudo-square wave, sawtooth wave, and many others that may have applications in real world pattern matching. If you happen to come across very unique ones, you may inform me privately via TV chat and I will consider your gracious considerations of discovered settings for inclusion. I'm awaiting Pine arrays to arrive for that major revision. Yes, you have read that correctly. They have been in the TV contributor/developer oven for quite some time. This was revealed in a "public" announcement recently, and I decided to provide you with a "Get Ready Notification" in this script's description, wink-wink. Pine Script endowed with arrays may be used to create and test spectral decomposition analytics code, filters, or what ever else your mind can surmise utilizing this nifty generator script. You now have another tool for your TV tool belt, to aid with spawning the future evolution of indicators on TradingView. Let the tinkering commence...

Features List Includes:
Waveform offset
Nyquist noise injection
Sine wave enable/disable for all sine waves
Cycle period for all sine waves
Amplitude for all sine waves
Phase shift for all sine waves

The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section if you do have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members , I may implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!

Release Notes

Added a seventh sIne wave just out of curiosity, disabled by default
Comments
jsfin
Please plot the individual waves & the combined waveform into future time (to the right of the last bar) to reveal predictions of future values.
ImmortalFreedom
@jsfin, Easier said than done, AND I don't wish to get into the "projections" business... Not that it's not possible to program future plots for this indicator, but go look at the FB MetaDeath spiral that occurred over the past day. There is no feasible indicator for price shock detection, nor will one probably ever exist in reality.
jsfin
@midtownsk8rguy, That's OK, I understand. It gave me some motivation, though, to program my own instead.
gotechno
Nice indicator. Playing around with it. Can you add means for the waves to extend to the future date?
Chartwatcher1996
bro, would you like to share the source code? i really need it for my research
DocFp85
it would be great if it could be "centered" on the reference lows and have the future projection
ITradeTheTurn
Interesting
KaioHokuto
Awesome script! Is it possible to include decimal numbers? And more important, a general moltiplicator which can amplify or lower the sine waves all together, so that you can better centered the total wave and more quickly. Thank you so much if you answer :)
slowcoconut
If I want to learn my algorithm on the infinite scenarios the market may present, I take it this type of tool will help it associate the states of my indicators with price action, providing a way for the algo to decipher why the indicators are outputting certain values/configurations prior to profitable entries, effectively giving it pattern recognition capabilities...

I'm also curious if you're familiar with a clever way to measure the amplitude and frequency of custom oscillators... an angle of analysis I just discovered would be useful, since I rely on custom oscillators...no worries if not, ill dig and find it
steveday72
I've been thinking about making such a waveform generator for the past few days. Luckily I searched and found yours to (hopefully) save me the bother.

I want to see if I can match a pattern and then make close predictions from there. I may end up writing one anyway with a Fourier Transform algorithm to analyze the market frequencies and help set the generator values.
More