function var ComplexIndicator() { vars Price = series(price()); vars FastMA = series(SMA(Price, 10)); vars SlowMA = series(SMA(Price, 30)); // Custom weighted oscillator var diff = (FastMA[0] - SlowMA[0]); var norm = (abs(FastMA[0]) + abs(SlowMA[0]))/2; var rawOsc = diff / (norm + 0.0001); // avoid div by 0 // Non-linear scaling and signal enhancement var weight = pow(rawOsc, 3) * sin(4 * rawOsc); // enhanced non-linearity var smooth = EMA(series(weight), 14); // smooth the output return smooth[0]; }