OPEN-SOURCE SCRIPT

Weierstrass Function (Fractal Cycles)

THE WEIERSTRASS FUNCTION

f(x) = ∑(n=0)^∞ a^n * cos(b^n * π * x)

The Weierstrass Function is the sum of an infinite series of cosine functions, each with increasing frequency and decreasing amplitude. This creates powerful multi-scale oscillations within the range ⬍(-2;+2), resembling a system of self-repetitive patterns. You can zoom into any part of the output and observe similar proportions, mimicking the hidden order behind the irregularity and unpredictability of financial markets.

IT DOESN’T RELY ON ANY MARKET DATA, AS THE OUTPUT IS BASED PURELY ON A MATHEMATICAL FORMULA!
This script does not provide direct buy or sell signals and should be used as a tool for analyzing the market behavior through fractal geometry. The function is often used to model complex, chaotic systems, including natural phenomena and financial markets.

APPLICATIONS:
  • Timing Aspect: Identifies the phases of market cycles, helping to keep awareness of frequency of turning points snapshot
  • Price-Modeling features: The Amplitude, frequency, and scaling settings allow the indicator to simulate the trends and oscillations. Its nowhere-differentiable nature aligns with the market's inherent uncertainty. The fractured oscillations resemble sharp jumps, noise, and dips found in volatile markets. snapshot


SETTINGS
Amplitude Factor (a): Controls the size of each wave. A higher value makes the waves larger.
Frequency Factor (b): Determines how fast the waves oscillate. A higher value creates more frequent waves.
Ability to Invert the output: Just like any cosine function it starts its journey with a decline, which is not distinctive to the behavior of most assets. The default setting is in "inverted mode".
Scale Factor: Adjusts the speed at which the oscillations grow over time.
Number of Terms (n_terms): Increases the number of waves. More terms add complexity to the pattern.
chaoscycleCyclesforecastingfunctionmathsorderwaveweierstrass

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Unlock exclusive tools: fractlab.com

ᴀʟʟ ᴄᴏɴᴛᴇɴᴛ ᴘʀᴏᴠɪᴅᴇᴅ ʙʏ ꜰʀᴀᴄᴛʟᴀʙ ɪꜱ ɪɴᴛᴇɴᴅᴇᴅ ꜰᴏʀ ɪɴꜰᴏʀᴍᴀᴛɪᴏɴᴀʟ ᴀɴᴅ ᴇᴅᴜᴄᴀᴛɪᴏɴᴀʟ ᴘᴜʀᴘᴏꜱᴇꜱ ᴏɴʟʏ.

ᴘᴀꜱᴛ ᴘᴇʀꜰᴏʀᴍᴀɴᴄᴇ ɪꜱ ɴᴏᴛ ɪɴᴅɪᴄᴀᴛɪᴠᴇ ᴏꜰ ꜰᴜᴛᴜʀᴇ ʀᴇꜱᴜʟᴛꜱ.

Disclaimer