Repulsion Moving Average - Least Crosses MAA Moving Average With Less Whipsaws Signals
The cross of the price with a moving average is one of the easiest strategy in technical analysis and could have worked if market price wasn't so noisy (In general periods of 1 to 20 produces the most whipsaws) . So it is possible to create a moving average who can manage to escape those noisy periods and produce 0 whipsaws ?
This question was asked by one of my work colleagues and i responded : "well... almost 0".
The Motion Of A Moving Average
Moving Average estimate the Trend and will always have phase shift, they will still follow the price and cross it during high volatility or low volatility periods, and when a moving average cross the price during a low volatility period you can expect lot of crosses.
In order to fix this behaviour a simple calculation exist :
FixMa = LongPeriodMA + MediumPeriodMA - ShortPeriodMA
We can see things in that way, the medium term MA is high pass filtered (subtracted) with a short term MA and the result is summed to a long term MA. We give more reactivity to our long term MA and thus creating some kind of repulsion motion with the price. Of course this can sometimes make the filter kinda zero-lag to some price periods (when the long term MA is near the price) .
Comparison
In red a simple moving average of period 100 and in blue our repulsion moving average :
In the image the short term moving average period is 100, since the long term period of the moving average is equal to short term x 3 you could be interested to look at the comparison of our moving average with the actual long term moving average :
Less crosses, i think you can see it.
Something to notice is that its always a tradeoff between Signal Speed and Signal Numbers , a classic moving average create faster signals but also a high numbers of them, a classic trailing stop create less signals but slowest ones, our moving average is some kind of average between those indicators.
Improvement Methods - Choice of The Filter/More Terms
A bad behaviour of our filter can be fixed by using filters who tend to create less crosses with the price or by developing the formula of our filter by adding more terms as follow :
fixma = ma(Price,a) + ma(Price,b) + ma(Price,c) - ma(Price,d) - ma(Price,e)
where a > b > c > d > e . The number of subtractive terms is equal to the number of summing terms - 1.
Way To Use
This indicator can be used like any moving average with cross strategy. Can also be used as a trailing stop.
No tests have been made proving that this indicator provide support and resistance levels, such signals come from more centered indicators.
Hope you enjoy
For any questions/demands feel free to pm me, i would be happy to help you :)
Crossunder
Help Requested - "Time-Slot" Delay for Crossover StrategyHello Tradingview Community,
I've been playing around with some various volume-based indicators, and recently have been experiencing a delay in the entries for my strategy for 2 minutes in this scenario. If the time is adjusted, it also is delayed 2 bars.
In this example, the "Short" position should enter when the blue line Crosses under the upper green line, and visa vera for the "Long" position. A simplified Pine Script is available below as well.
I have Googled this issue and attempted to modify the code with => criteria instead, but too no avail. Would appreciate any help or anyone who could point me in the right direction on this Time Delay Issue. Thanks!
Pairs SMA Cross Over/UnderIndicator shows when a pair's SMAs cross-above or cross-under. You pick the pairs by changing the s#-corresponding to the p# matching the pair you want. The other variable numbers are out of order but it doesn't matter expect to the look of the script.