Hann Window Amplitude FilterThis script is designed to implement a multi-signal Hann filter, which is essentially a movable Hann window filter. The purpose of this filter is to allow users to select the periods or frequencies that best align with their trading strategy or market analysis.
The Hann window filter operates by enabling the selection of either lower or higher frequencies. The period of the window is twice the number of signals you wish to filter. As you shift the window by the number of your signals, the signal on one side will have an amplitude of 0, while the other side will have an amplitude of 1.
Continuing to shift the window will result in new values of 0. This feature is particularly useful for further filtering the frequencies or periods that you want to focus on for your trading decisions.
In summary, this script provides a flexible and customizable tool for filtering signals based on their frequency or period, which can be a valuable addition to any trader's technical analysis toolkit.
Frequencies
Tesla CoilThis indicator reads the charts as frequency because the charts are just waves after all. This is an excellent tool for finding "Booms" and detecting dumps. Booms are found when all the frequencies pull under the red 20 line. Dumps are detected when all the lines drag themselves along the 20 line as seen is screenshots below.
Below is another 2 examples of a "boom". Everything sucks in before exploding out.
Below is an example of a dump:
Composite Synchronous Sinusoidal Harmonics Waveform GeneratorWait, "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!
Adaptive Zero Lag EMA v2This is my most successful strategy to date! Please enjoy and join the Open Source movement by sharing your code and ideas online!
OPERATING PRINCIPLE
The strategy is based on Ehlers idea that any indicator can be turned into a signal-producing trade system through smoothing and other filtering processes.
In fact, I'm using his Zero Lag EMA (ZLEMA) as a baseline indicator as well as some code snippets he has made public (1). God bless open source!
Next, I've provided the option to use an Instantaneous Frequency Measurement (IFM) method, which will adaptively choose the best period for the ZLEMA (2)
I've written other studies that use the differential calculus approximations for IFM, so it was only natural to include them in this strategy.
The primary two are Cosine IFM (3) and In-phase Quadrature IFM (4). You can also find an indicator with both plotted and the ability to average them together, as one IFM prefers long periods and the other short. (5)
BEFORE WE BEGIN
1. This strategy only runs on "normal" FX pairs (EURUSD, GBPJPY, AUDUSD ...) and will fail on Metals or Commodities.
Cryptos are largely untested.
2. Please run it on these time frames: M15 to D.
Anything outside this range will likely fail.
HOW TO USE AND SUCCEED
1. If the Default settings don't produce good results right off the bat, then lower gain limit to 1 or 2 and threshold to 0.01.
2. Test each setting under adaptive method . If you want to leave it Off , then I'd recommend using some kind of IFM (see my links below) to
discover the most efficient period to use.
3. Once you have the best adaptive method chosen, begin incrementing gain limit until you find a nice balance between profit factor (PF) and drawdown.
4. Now, begin incrementing threshold . The goal is to have PF above 2 and a drawdown as low as possible.
5. Finally, change the source ! Typically, close is the best option, but I have run into cases where high
yielded the highest returns and win rate.
6. Sit back, relax, and tweak the risk until you're happy with the return and drawdown amounts.
ADVANCED
You may need to adjust take profit (TP) points and stop loss (SL) points to create the best entry possible. Don't be greedy! You'll likely have poor
results if the TP is set to 300 and SL is 50.
If you are trading a pair that has a long Dominant Cycle Period , then you may increase Max Period to allow the IFM
to accept longer periods. Any period above the Max Period will be rejected. This may increase lag time!
Cheers and good luck trading!
-DasanC
PS - This code doesn't repaint or have future-leak, which was present in Pinescript v2.
PPS - Believe me! These returns are typical! Sometimes you must push aside the "if it's too good to be true..." mindset that society has ingrained in you.
Do you really believe the most successful pass up opportunities before investigating them? ;)
(1) Ehlers & Ric Zero Lag EMA
(2) Measuring Cycles by Ehlers
(3) Cosine IFM
(4) Inphase Quadrature IFM
(5) Averaging IFM