Cosine Kernel Regressions [QuantraSystems]Cosine Kernel Regressions
Introduction
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.
Legend
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.
Methodology
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)
Y
// 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.
Shortterm
LNL Scalper ArrowsLNL Scalper Arrows
The indicator consist of various different types of candlestick patterns that are truly time tested by multiple veteran traders. These arrows are a combination of short-term scalping strategies taught by Linda Raschke & a trader that goes by name Quant Trade Edge. These strategies/patterns occur regularly within the markets. They offer high probability quick moves during the trending days. These four patterns are based on pure price action, no oscillators, no trend, no momentum indicators involved. Trend (ema) is there just as a simple trend gauge.
LNL Scalper Arrows were designed specifically for intra-day trading. Mostly useful for the futures but also stocks as well. These arrows can work anywhere between the fast-moving 512 or 1600 tick charts to a 1min, 2min and up to 5min or 10min charts.
Trend Gauge (Exponential Moving Average)
Nothing fancy just a classic EMA that can guide the direction of the short-term trend. I have added a custom coloring of the EMA that is based on a simple RSI filter. That should help to visualize the non-directional moments within the trend. Although the length is adjustable, for scalping it is better to focus on smaller periods such as 9, 13 or 20 or 34 but anything above 50 loses its purpose as a short-term trend gauge. Again, this is a scalping tool not a trend tool, you are not going to get rid of the fakeouts by increasing the period of the trend.
Tail Arrows (Eat the Tail Pattern)
Tail is a candlestick that is either a price rejection spike, or a flag continuation pattern on a lower time frame. A failed action. It is basically a candle with much bigger wick (shadow) of the candle than the actual body. Such candles are usually telling us about strong participation from the other side of the market. Eat the tail pattern occurs whenever the low of the Tail candle is immediately broken on a following candle "the tail is eaten alive". Such a breaks occurs in a most aggressive types of markets with a strong momentum. DO NOT try to trade this in a low volume or a ranging market. Tail Arrows are the most aggressive arrows & should be only used on the highest volume or a parabolic momentum markets.
Scalp Arrows (Scallop Pattern)
Known as Scallops or minor lows or highs, these patterns are the most common within the all scalper arrows. They occur regularly on 1min & 5min charts - basically everyday. Scallops provide the best possible risk to reward entry within the trend without the need of any indicators or oscillators. The Scallop Up 3 bar pattern consist of a high that is lower that the previous high but also low that is lower than the previous low. Scallop Up or a minor low triggers when the last high is broken, creating a three bar mountain or a peak within the 5 bar span.
Hoagie Arrows (Hoagie Pattern)
Hoagies occur way less often than any other scalping patterns. Hoagies represent two (or more) inside candles within the shadow of a first candle. Such a formation is creating a small compression or a range that sooner or later breaks out. The hoagie is triggered whenever the high or low of the shadow (first) candle is broken. The great thing about the hoagies is that they can work either way despite the trend direction. Although this indicator is coded for the 2 bar hoagies, there are no limitations on how much inside bars can hoagie include.
Umbrella Arrows (Umbrella Pattern)
Another really awesome 3 bar pattern that is really fun to trade. Umbrella occurs when the candle before the previous candle is a pin bar or a tail bar and the body of the previous candle is within the shadow or a wick of the candle before. The umbrella is triggered once the high or low of the previous bar is broken. Umbrellas are more frequent than Hoagies but occur much less than the Scallops.
Outside Bar Wedges (Outside Bar Pattern)
Pretty much self-explanatory candlestick pattern. Outside Bar is basically any bar that peaks outside of the both ends of the previous candle. So the range of the candle is higher & it looked beyond the high and beyond the low of the previous candle. These candles are signalizing the potenial momentum change. Ouside Bars usually occur at the tops or bottoms of the moves. I decided to add them because they can serve as a great addition to these scalping patterns.
Signal vs. SignalBreak Mode
The trigger can be viewed in two different ways:
1. Signal: Plots the trigger before the trigger bar, basically right when the pattern is formed but NOT YET triggered. The signal is triggered once the next candle break the high or low of the current candle.
2. SignalBrake: Plots the trigger after the break of the high or low of the actual pattern. It is basically a candle after the signal candle. (Signal is better for trading because it gives you time to prepare for the actual break of the high or low = the actual signal. SignalBrake is great for looking back in history only for the patterns that actually traded).
Pin Bar BTW Ratio
Pin Bar (Body-To-Wick) Ratio represents the size of the body of a pin bar candle for Eat the Tail and Umbrella patterns. Pin Bar BTW Ratio measures the ratio between the wick & the body of the candle. Ref. interval is 2.0 - 5.0 (ideal pin bar is 2.0 - 3.0 = the wick or a shadow is 2x - 3x bigger than the body of the candle)
ATR Stop & Target Labels
I also created three simple labels (tables) that can show you the ideal target & stop as well as the current ATR. Since LNL Scalper Arrows consist of high probability scalping patterns, a good rule of thumb to follow is to use a half of the current ATR as a target and a current ATR as a stop (or two times the target). So if the current 7 period ATR is 30 the target would be 15 pts. and a stop around 30 pts. With such a risk management you should aim for a win rate 70% or higher. Obviously you can adjust the risk management in the settings to your personal preference.
Low Range vs. High Range Markets
There are two major downsides with the Scalper Arrows:
1. You need volume and a volatility. These patterns really do struggle in ranging "boring" sideways action. It is absolutely crucial to recognize the current market environment and really stay cautions and (or completely out) in case the chop continues. Adding something like DMI can help you recognize the potential flat markets.
2. Not only do you need volume & momentum, you also need a decent range. This indicator works better on a rangy market such as NQ futures or YM. But are much tougher to trade on lower range markets such as some stocks or ZB futures or basically any other lower range market.
Hope it helps.
Pivot Highs&lows: Short/Medium/Long-term + Spikeyness FilterShows Pivot Highs & Lows defined or 'Graded' on a fractal basis: Short-term, medium-term and long-term. Also applies 'Spikeyness' condition by default to filter-out weak/rounded pivots
ES1! 4hr chart (CME) shown above, with lookback = 15; clearly identifying the major highs & lows on the basis of how they are fractally 'nested' within lesser Pivots.
-- in the above chart Short term pivot highs (STH) are simply represented by green 'ʌ', and short-term pivot lows (STL) are simply represented by orange 'v'.
//Basics: (as applying to pivot highs, the following is reversed for pivot lows)
-Short term highs (STH) are simple pivot highs, albeit refined from standard with the 'spikeyness' filter.
-Medium-term highs (MTH) are defined as having a lower STH on either side of them.
-Long-term highs (LTH) are defined as having a lower MTH on either side of them.
//Purpose:
-Education: Quick and easy visualization of the strength or importance of a pivot high or low; a way of grading them based on their larger context.
-Backtesting: use in combination with other trading methods when backtesting to see the relative significance and price sensitivity of LTHs/LTLs compared to lower grade highs and lows.
//Settings:
-Choose Pivot lookback/lookforward bars: One setting, the basis from which all further pivot calculations are done.
-Toggle on/off 'Spikeyness' condition to filter-out weak/rounded/unimpressive pivot highs or lows (default is ON).
-Toggle on/off each of STH, MTH, LTH, STL, MTL, LTL; and choose label text-styles/colors/sizes independently.
-Set text Vertically, horizonally, or simply use 'ʌ' or 'v' symbols if you want to declutter your chart.
//Usage notes:
-Pivots take time to print (lookback bars must have elapsed before confirmation). Fractally nested pivots as here (i.e. a LTH), take even longer to print/confirm, so please be patient.
-Works across timeframes & Assets. Different timeframes may require slightly tweaked lookback/forward settings for optimal use; default is 15 bars.
Example usage with just symbolic labels short-term, med-term, long-term with 1x, 2x and 3x ʌ/v respectively:
Dap's Oscillator- Short Term Momentum and Trend. BINANCE:BTCUSDT BYBIT:BTCUSDT BYBIT:ETHUSDT BINANCE:ETHUSDT
DAP's OSCILLATOR:
WHAT IS IT?
This Oscillator was created to inspire confidence in the short-term trend of traders. This will work very well with a volatility metric (I recommend BBWP by @The_Caretaker)
WHAT IS IT MADE OF?
1. Consists of a series of equations (mainly the difference between simple to exponential moving averages) and Standard deviations of these moving average differences (length equivalent to the length of sampled ma's)
2. These equations are then boiled down through an averaging process array, after averaging the covariants are equated against the variants of the positive side of the array. This is what is presented as the aqua line.
3. The RC average (yellow) is the sma following the DAP'S Oscillator at a specified length
4. The most important part of this indicator is simply the momentum oscillator represented as a green or red line based on the value relative to the Oscillators.
HOW DO I USE THIS?
As I mentioned before mixed with a volatility metric, it should set you up for a good decision based on short-term trends. I would say to be careful for periods of consolidation, with the consolidation the momentum often meets hands with DAP's Oscillator and can cause fake-outs. You want to spot divergences from the price to the momentum difference, as well as room to work down or upward to secure a good entry on a position.
CHEAT CODE'S NOTES:
I appreciate everyone who has boosted my previous scripts, it means a lot. If you want to translate words to pine script onto a chart, feel free to PM me. I would be happy to help bring an indicator to life. I may take a quick break but will be back shortly to help create more cheat codes for yall. Thanks!
-Cheat Code
Infiten's Adjusted Bull-Bear Power Oscillator An extension of TradingView's new ADR and bull-bear power indicators, this indicator is helpful for spotting abnormal bullish and bearish activity to get good contrarian entry points.
How to interpret the indicator
When the white columns cross over the red line, it's a bearish indicator since the asset has been overbought.
When the white columns cross under the green line, it's a bullish indicator since the asset has been oversold.
How it's calculated
The adjusted bull-bear power oscillator is calculated by multiplying the bull-bear power indicator by my NDO indicator, to adjust the bull-bear power for volume. The upper green line and lower red line are calculated as the product of a multiplier input and the average daily range indicator.
No-lose trading targets (Based on MFI) By Mustafa ÖZVERThis code shows expected reaction target prices after sudden moving based on MFI . Red area means the price is on overbought area, green area means the price is on oversold area. If you see red area under price, you can make short option to next to the horizontal beginning price of red area. If you see green area over price, you can make long option to next to the horizontal beginning price of green area.
When this code works
- The green area starts where mfi value is on oversold
- The red area starts where mfi value is on overbought
Of course, this code may be failed, do not forget the target may never come. But hopefully price will cross over the target.
And you (as developers) can develop this code by using anything instead of mfi to get up-down target prices.
But only this values can not guarantee good results for trading. BE CAREFUL
Cheat Code- Example 1; Short-Term; Follow the Trend BINANCE:BTCUSDT ; BINANCE:ETHUSDT ; BINANCE:FILUSDT ;
This strategy is simple and easy to read and takes advantage of conditional signs of trend reversals. It works best in 10-minute time frames for most large and mid-cap crypto. This code is a tutorial for creating a profitable yet easy strategy, and hopefully, it can be put to good use :)
ALMA cross signal by hk4jerry<< ALMA CROSS signal >>
*NONE REPAINT STRATEGY*
--As a result of testing for a month, using alma does not result in repainting--
--ALMA 크로스 결과는 한달간의 테스트 결과, 리페인팅되지 않습니다--
(ENGLISH description O)
==NOTE==
1. MA 크로스 지표는 잘못된 신호들이 자주 등장합니다. 정확성을 더 높일수 있는 방법은 없을까 고민을 해봤습니다. 더 낮은 가격에 매수하고, 더 높은 가격에서 매도하는 것이 중요했습니다. 우리가 흔히 저점, 고점을 알아내기 위한 지표이자, 선행지표인 RSI를 추가하는 방법을 연구했습니다.
2. 예를 들어, MA 크로스 매수 신호가 발생했을때, rsi값이 50이면 가격이 더 떨어질 가능성이 큽니다. 하지만, rsi값이 30이하인 경우에만 매수 신호가 발생한다면, 그 가격이 저점일 확률이 매우 높아지는 원리 입니다.
3. 신호는 확률입니다. 트레이딩에 100%는 없습니다. 그 확률을 높이는 것은 리스크 관리 입니다. 분할 매수 관점으로 포지션을 잡으시거나, 단기 매매로 가져가시는걸 추천드립니다.
==rsi ma source 설정==
1. 'rsi ma' 값의 소스입니다.
2. 'rsi 길이' 는 값이 클수록 더욱 정확한 시그널이 발생합니다.
3. EMA 길이가 짧을수록 더 많은 시그널이 발생합니다. 그러나, 정확도는 떨어집니다.
==rsi ma 설정==
1. rsi를 source로한 EMA입니다.
2. rsi와 유사한 성격을 가집니다.
3. 'rsi ma' 값이 30이하이면 과매도, 70이상이면 과매수 입니다.
4. ' rsi ma long value' 이 30이면 매수 신호가 rsi ma 값이 30 이하인 경우에만 발생함을 의미 합니다.
5. "rsi ma short value' 가 70이면 매도 신호가 rsi ma 값이 70 이상인 경우에만 발생함을 의미 합니다.
==rsi 설정==
1. 실제 rsi(14,close) 값을 의미합니다.
2. rsi ma value와 비슷한 기능입니다.
3. rsi 길이가 14이므로, 값은 40~50 사이가 적당합니다.
4. 30 또는 70으로 설정할 시, 신호가 거의 발생하지 않습니다.
(ENG)
==NOTE==
1. MA cross indicator often shows false signals. I was wondering if there is a way to increase the accuracy further. It was important to buy at a lower price and sell at a higher price. We studied how to add RSI, which is a leading indicator and an indicator to find lows and highs, often.
2. For example, when a buy MA cross signal occurs, if the rsi value is 50, the price is more likely to fall. However, if a buy signal occurs only when the rsi value is below 30, the probability that the price is at the bottom is very high.
3. A signal is a probability. There is no 100% in trading. Increasing that probability is risk management. It is recommended to hold a position from the perspective of a split buy or take it as a short-term trade.
==rsi ma source option==
1. The source of the 'rsi ma' value.
2. The larger the 'rsi length' value, the more accurate the signal is generated.
3. Shorter EMA lengths produce more signals. However, the accuracy is reduced.
==rsi ma options==
1. EMA with rsi as the source.
2. It has similar characteristics to rsi.
3. If the 'rsi ma' value is below 30, it is oversold, and if it is above 70, it is overbought.
4. If 'rsi ma long value' is 30, it means that a buy signal will only occur when the rsi ma value is less than or equal to 30.
5. If "rsi ma short value' is 70, it means that a sell signal will only occur when the rsi ma value is above 70.
==rsi option==
1. It means the actual rsi(14,close) value.
2. This function is similar to rsi ma value.
3. Since the rsi length is 14, a value between 40 and 50 is appropriate.
4. When set to 30 or 70, almost no signal is generated.
TradingGroundhog - Strategy & Fractal V1#-- Public Strategy - No Repaint - Fractals -- Short term
Here I come with another script, more simple than Wavetrend V1. You will love it.
#-- Synopsis --
Another simple idea, on a small time frame (15 min) we buy when the opening price goes below a Bottom fractals and sell when it goes over a Top fractals, but as this script do not use Wavetrends. You should stop by your self to use the script during long lasting downtrends.
I developed the strategy using BTC /EUR 3 MIN BINANCE but it can be applied to many other cryptos, I don't know for forex or others. You can use it for short term (to a month of uptrend) and automated trading.
#-- Graph reading --
And now, how to read it ?
Fractals:
Yellow Flags occur when the opening price goes below a Bottom fractal , it means Buy.
White Flags appear when the opening price goes over a Top fractal , it means Sell.
#-- Parameters --
*** Parameters have been intensively optimized using 10 cryptocurrency markets in order to have potent efficiency for each of them. I would recommend to only change the Can Be touch parameter. For the others, I don't recommend any modifications. The idea behind the script is to be able to switch between markets without having to optimize parameters, less work, easy to target active crypto and therefor limit the risks. ***
Can be touch :
'Filter fractals' : Activate or Disable the filtering fractal operation. If Enable, buy during less risky periods. (Activate is often better)
Can be touch but not necessary :
'VolumeMA' : The Volume corrector used by the fractals
'Extreme window' : The number of price individuals to look for if we want to remove extreme fractals.
Not to touch :
'Long Sop Loss (%)' : The minimal difference of price between a Fractal bottom and the opening price to buy.
#-- Time frame --
Should be used with the following time frames depending on the necessity:
1 MIN
3 MIN (Preferred with the parameters set)
5 MIN
#-- Last words --
The script can be set up to send Tradingview signals to 3comma just by adding comment = " " in strategy.close_all() and strategy.entry().
Good trades !
Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
***
# Here are the results from the 20rst of September 2021 with 100% of equity on the BTC /EUR 3 Min and with a capital of 10 000 EUR. So almost, one month.
# As I saw, it goes from +30% to more than +160% (the great SHIB) depending on the selected crypto. It may be negative if you spot a downtrend.
Momentum Indicator avg short return minus avg long returnAverage daily return over the period 2-12 months ago minus the average daily return over the period 1-5 years ago
=> a higher return 2-12 months ago indicates a higher return in coming months according to research, because of the momentum risk factor premium
=> a higher return 1-5 years ago indicates a lower return in coming months according to research, because of the momentum risk factor premium
Divergence shortterm swing daytrading I've added a few lines to Mawreez' RSI Divergence Detector.
I edited the visual and filtered the signals in same direction of the current candle.
this indicator shows long and short signals based on divergences. It's better not to trade against powerful trend.
Dumb Indicator 9 - Bitfinex Shorts X LongsThis is a way to study how the crypto market is going on Bitfinex, you can see the diference between the Long and Short terms on most popular pairs.
GDAX EMA Cross[26,12]This indicator allow to show the EMA of the price similar to GDAX user interface.
The purpose of this indicator is twice:
Allowing the user to show a double EMA with the possibility to show when a EMA crossing happens.
Showing in a more user friendly interface the GDAX ema line.
As a matter of fact is proven that those 2 EMA act as support/resistance during Bulls/Bear periods. The indicator works fine in the GDax timeframes, or rather 5m, 15m, 1h and daily excluding 3h and 6h as they're less used at the moment.
Momentuminator 1.0Here we have a general purpose momentum based long and short flip flop with optional profit target and maximum loss.
Program development: Boffin Hollow Lab
Author: Tarzan at tradingview.com
Release: Version 1.0 May 2016
Please Note: Past Performance is not necessarily indicative of future results
Ichimoku_on_steroids v 1.0 (Scalper's) OLAgain, ichimoku based signal generator, this time using the Kijun-sen (Base line) and the Tenkan-sen (Conversion line) to assess price action.
Works best on timeless charts (e.g. Point & Figure, Renko's, ...).
Use with caution !! ... or with very small TP targets !!
Steve Primo's "Robbery" Indicator (PET-D)Here is the Link to youtube video. Its free. www.youtube.com
I did not buy this indicator, I do not have the code. But Most likely this is what's is being calculated.
More Video here - www.protraderstrategies.com
Compare this indicator with his charts shown in the video
Save another $495 bucks.
NOTE:
This is not the actual code for this indicator. This is my perception of the code. Here in these free video There are few examples, you can compare the robbery pet-d with the actual PET-D
www.youtube.com
www.youtube.com
I have to agree, this is not perfect, Out of all the examples, There was one bar that did not match.