Seungdori_

MA Slope : New Method

Seungdori_ Güncellendi   
1 . Introduction


Hello, traders.

This indicator is designed to measure the slope of a moving average line.
I imagine many of you who use Pine Script have struggled with this; measuring the slope of a moving average line can be quite challenging.

Firstly, this is because while the x-axis is fixed to the 'number of candles', the price scale on the y-axis can be adjusted freely.
Secondly, while the concept of differentiation could simplify the measurement process, the resulting value will differ from the conventional derivative we are familiar with since 'delta x' is fixed to '1'.

Consequently, I've put a lot of thought into how to configure the x-axis and y-axis in order to measure a slope that aligns with our perception of 'slope'.
After some reflection, I, like many others, realized that many people measure the slope based on the pivot of the moving average line.

This indicator is the product of that reflection.


2. Description


A. Setting
First, select the moving average line for which you want to check the slope. While SMA is commonly used, T3 is set as the default because it best visualizes the slope.

If you check 'Show MA Slope Average Pivot Range?' in the input window, it displays the average of the recent 30 slope pivot highs and pivot lows.

In other words, it shows 'On average, this level of slope was produced in the recent 30 waves.'

B. Usage


A cross from 0 in the slope indicates a 'reversal in the slope of the curve', which is the most crucial value when observing the slope.
Thus, fundamentally, it's important to look at the points where the slope becomes "0". Furthermore, when the slope starts to curve after rising, it signifies a change in acceleration, suggesting an imminent slope reversal.
(Note that acceleration was omitted from the indicator representation due to its tendency to overly complicate the data.)

While a shorter length of the moving average line may provide more useful slope data for actual trading, a less smooth moving average line may cross around 0 too often, making it less useful.

Therefore, it's crucial to adjust the 'Smoothing Length' in the input values to find a value that you believe is appropriate.

3. Conclusion

I always contemplate how to find a value in Pine Script that is similar to the perceived slope.

I made this script thinking that it might be a novel approach, but there are still many areas that need improvement.

If you have any innovative ideas about the slope, please feel free to provide feedback anytime.

Thank you.



--------

1. 서론

트레이더 여러분 안녕하세요. 이 지표는 이동평균선의 기울기를 측정하는 지표입니다.

아마 파인스크립트를 다루는 많은 분들이 같은 고민을 하셨을 것 같은데, 이동평균선의 기울기를 측정하는 것은 매우 어렵습니다.

그 이유로 첫번째는 x축은 '캔들 갯수'로 고정되어있는 반면, y축의 가격 스케일은 유동적으로 바꿀 수 있기 때문입니다.
두번째로는, 미분 개념을 이용하면 훨씬 수월하게 구할 수 있을테지만, 델타x가 '1'로 고정되어있기 때문에 우리가 알고있는 미분과 다른 값이 나옵니다.

따라서 x축과 y축을 어떻게 하면 실제 우리가 인식하는 '기울기'에 가깝도록 구성할 수 있을지에 대해 고민해보았습니다.
고민해본 결과 저 역시 그러하고, 많은 사람들이 이동평균선의 피벗을 기준으로 기울기를 측정한다는 사실을 알게되었습니다.

이 지표는 그 고민의 결과물입니다.


2. 내용 설명


A. 셋팅

먼저, 기울기를 확인하고싶은 이동평균선을 선택해주세요.
일반적으로 SMA를 많이 보시겠지만, T3가 기울기로 표현할 때 가장 아름다운 모습이 나오기 때문에 기본 설정을 T3로 설정했습니다.

Input창에 있는 'Show MA Slope Average Pivot Range?'를 체크하면, 최근 30개의 기울기 피벗 하이와 피벗 로우의 평균을 보여줍니다.
즉, '평균적으로, 최근 30개의 파동에서는 이 정도의 기울기가 만들어졌다'라는 것을 보여줍니다


B. 사용법


기울기가 0에서 크로스 된다는 것은, "곡선의 기울기가 반전"된다는 것이기에 기울기를 봄에 있어서 가장 중요한 값입니다. 따라서 가장 기본적으로는, 기울기가 "0"이 되는 곳을 보는 것이 중요하고
또 기울기가 올라갔다 꺾이기 시작할 때는, 가속도가 바뀌고 있다는 뜻이므로, 곧 기울기가 반전될 것을 의미합니다.
(다만 가속도를 지표로 표현하기엔, 너무나도 데이터가 지저분해져서 생략하였습니다)

이동평균선의 길이를 짧게 할수록 더 실제 트레이딩에 유용한 기울기 데이터를 얻을 수 있으나,
부드럽지 못한 이동평균선은 기울기가 0 근처에서 크로스 되는 모습이 지나치게 많이 나올 것이기에 유용하지 않을 수 있습니다.

따라서, input값에 있는 'Smoothing Length'를 조절해가면서 자신이 생각하기에 맞는 값을 고르는 것이 중요합니다.

3. 맺음말

파인스크립트에서 어떻게하면 실제 인식하는 기울기와 유사한 값을 찾을 수 있을까를 항상 고민합니다. 나름 새로운 접근방법이라 생각해서 이렇게 스크립트로 만들었으나, 여전히 아쉬운 부분이 많이 존재합니다.
기울기에 대한 좋은 아이디어가 있다면 언제든 피드백 해주세요.

감사합니다.
Sürüm Notları:
Minor Improved
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?