Cosine Kernel Regressions [QuantraSystems]

QuantraSystems تم تحديثه   
Cosine Kernel Regressions


The Cosine Kernel Regressions indicator (CKR) uses mathematical concepts to offer a unique approach to market analysis. This indicator employs Kernel Regressions using bespoke tunable Cosine functions in order to smoothly interpret a variety of market data, providing traders with incredibly clean insights into market trends.

The CKR is particularly useful for traders looking to understand underlying trends without the 'noise' typical in raw price movements. It can serve as a standalone trend analysis tool or be combined with other indicators for more robust trading strategies.


Fast Trend Signal Line - This is the foreground oscillator, it is colored upon the earliest confirmation of a change in trend direction.

Slow Trend Signal Line - This oscillator is calculated in a similar manner. However, it utilizes a lower frequency within the cosine tuning function, allowing it to capture longer and broader trends in one signal. This allows for tactical trading; the user can trade smaller moves without losing sight of the broader trend.

Case Study

In this case study, the CKR was used alongside the Triple Confirmation Kernel Regression Oscillator (KRO)

  • Initially, the KRO indicated an oversold condition, which could be interpreted as a signal to enter a long position in anticipation of a price rebound. However, the CKR’s fast trend signal line had not yet confirmed a positive trend direction - suggesting that entering a trade too early and without confirmation could be a mistake.

  • Waiting for a confirmed positive trend from the CKR proved beneficial for this trade. A few candles after the oversold signal, the CKR's fast trend signal line shifted upwards, indicating a strong upward momentum. This was the optimal entry point suggested by the CKR, occurring after the confirmation of the trend change, which significantly reduced the likelihood of entering during a false recovery or continuation of the downtrend.

  • This is one of the many uses of the CKR - by timing entries using the fast signal line, traders could avoid unnecessary losses by preventing premature entries.


The methodology behind CKR is a multi-layered approach and utilizes many ‘base’ indicators.
  • Relative Strength Index
  • Stochastic Oscillator
  • Bollinger Band Percent
  • Chande Momentum Oscillator
  • Commodity Channel Index
  • Fisher Transform
  • Volume Zone Oscillator

The calculated output from each indicator is standardized and scaled before being averaged. This prevents any single indicator from overpowering the resulting signal.

//  ╔════════════════════════════════╗  //
//  ║    Scaling/Range Adjustment    ║  //
//  ╚════════════════════════════════╝  //
RSI_ReScale   (_res      ) => (      _res - 50   ) * 2.8
STOCH_ReScale (_stoch    ) => (    _stoch - 50   ) * 2
BBPCT_ReScale (_bbpct    ) => (    _bbpct - 0.5  ) * 120        
CMO_ReScale   (_chandeMO ) => ( _chandeMO * 1.15 )
CCI_ReScale   (_cci      ) => (      _cci / 2    )
FISH_ReScale  (_fish1    ) => (    _fish1 * 30   )
VZO_ReScale   (_VP, _TV  ) => (_VP / _TV) * 110

These outputs are then fed into a customized cosine kernel regression function, which smooths the data, and combines all inputs into a single coherent output.
//              ╔════════════════════════════════╗              //
//              ║    COSINE KERNEL REGRESSIONS   ║              //
//              ╚════════════════════════════════╝              //
// Define a function to compute the cosine of an input scaled by a frequency tuner
cosine(x, z) =>
    // Where x = source input
    //       y = function output
    //       z = frequency tuner
    var y = 0.
    y := math.cos(z * x)
// Define a kernel that utilizes the cosine function
kernel(x, z) =>
    var y = 0.
    y := cosine(x, z)
    math.abs(x) <= math.pi/(2 * z) ? math.abs(y) : 0.    //    cos(zx) = 0
//  The above restricts the wave to positive values      //     when x = π / 2z

The tuning of the regression is adjustable, allowing users to fine-tune the sensitivity and responsiveness of the indicator to match specific trading strategies or market conditions. This robust methodology ensures that CKR provides a reliable and adaptable tool for market analysis.
ملاحظات الأخبار:
Added combined alerts
ملاحظات الأخبار:
Added multi-timeframe functionality.

No statements or claims aim to be financial advice,
neither are any signals from us or our indicators.

Want to learn Trading, Investing or system building?
Join the Community! 👇

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟