7 Closes above/below 5 SMA

This script looks for 7 consecutive closes above/below the 5-period SMA. The indicator is inspired by legendary trader Linda Raschke's work.

The script can can be used in three main ways. I think you will find more uses.

First are the two models for which the indicator was created, both inspired by Raschke:

1) Persistency of trend / Extended run setup.
Around 10-12 times per year we get a persistency of trend in instruments in general.
After 7 consecutive closes above/below the 5-period as price pulls back we can look to enter in the direction of the main trend as it moves up/down above/below 5 ma again. You should use price action trading to pinpoint the entries. Now try to hold this as long as possible. Way longer than you can percieve or think is possible. Up to 24-28 periods is what we are looking for in these cases.

2) Normal usage.
When the trend is not persistent, it is possible to use this as an oscillating signal, for a shorter term trade, where we can look for a short or long term reversal setup in price action.

3) I also use it at as a learning to see the swing trades clearer. You can also use it as a visual aid for developing new variances of the classic swing trading setup.

Read and listen to Linda Raschkes work to learn more.

TIme frames
The principles works in all time frames but may change depending on calendar differences. We will see more instances/year in shorter time frames.

Why closes above the 5 SMA
As you may or may not know the 5 SMA is a very important indicator. You can think of it like this, If price is above 5, it is innocent until proven guilty but if price is below 5 we use the french law system which means it is guilty until proven innocent. 7 closes above 5 is a very good predictor of possible short term direction changes.

Use together with:
I prefer to use this indicator together with either regular SMA:s, one short and one macro term. For example 10 ma and 100 ma.
Or you can use it with a a Hull 21-period MA together with a 240-period WMA.

I added settings so you can change preferences for changing shape, where to display the shape and in what color

Visual aid
I wanted to keep one dot for each consecutive day, this way we will get a grouping of days and dots. The amount in this group can be of use in itself to inform you of the strength of trend. This can inform you if this oscillation predicts a short term eversal or a continuation. You need skills in reading price action to use this to your advantage.

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?