Seungdori_

Acceleration-Based MA Slope Prediction

Seungdori_ Diupdate   
Hello traders,
I developed this indicator while working on a trading strategy using moving average slope and acceleration, and I found the concept interesting enough to share it.

Let me briefly explain this indicator.


----About White Plot----

1. Calculate the first derivative approximation at the current point of the Moving Average, and then calculate the second derivative approximation to obtain the 'Acceleration'.

2. Where the acceleration is 0, it signifies a change in the force of the moving average.

3. Therefore, by drawing a parabola based on the acceleration at that time, can depict the parabolic shape of the moving average.
This is represented as a white circle on the indicator.


4. These circles are reset at the next point where the acceleration is 0, indicating a change in the parabolic force.
If the moving average rises more sharply than the predicted value of the rising parabola, a more drastic increase is expected.

5. In this case, you can start risk management around the time the drawn parabola breaks.
(The actual MA is represented by green/red lines)

6. Before the trend changes, i.e., before the direction of the moving average changes, there is a section where the acceleration is 0, and this is represented on the chart as follows.
(The lower indicator shows the acceleration of the corresponding parabola)

----About Red Plot----

1. Calculate the first derivative approximation of the moving average value, the 'slope'.

2. Where the slope is 0, it represents the extreme point of the parabola.

3. Therefore, by using the acceleration at that point as the coefficient of the quadratic function and setting the extreme point as a vertex, we can draw a quadratic function. This is represented as a red circle on the indicator.
(Keep in mind that the actual moving average is not a quadratic function; this is a "forced" quadratic function assuming the parabola is maintained)

4. These circles are reset at the next extreme point where the slope is 0, and a new quadratic function is created.
Based on the formula obtained in the above process, you can predict the future moving average through 'offset'.

5. That is, if the x value at the current point is 'k', you can predict the moving average one candle ahead by substituting (k+1) into the quadratic function.
The predicted value at the past position is shown as a red circle.

6. The smoother the chosen moving average, the fewer extreme points will appear, and the higher the likelihood of the parabola fitting.
For the T3 set as the default value, it shows very high accuracy even when predicting about 20 candles ahead.

On the other hand, rough moving averages like SMA have limited prediction value.
(SMA 60, offset = 10)

--------
The moving average with a very high level of accuracy is JMA (Jurik Moving Average). However, since the code for this moving average is not public, I recommend those interested to check it through my code.

Additionally, I believe the code of this indicator I've uploaded has significant utility.

As an example, you can use the breaking point of the parabola predicted by the acceleration to determine when the force changes again for entries/losses. There are many other possible applications as well.

I look forward to seeing more excellent results from this indicator.




--------



안녕하세요 트레이더여러분.
이 지표는, 제가 이동평균선의 기울기와 가속도를 이용하여 매매를 하기 위한 지표를 개발하다가, 흥미로운 내용이라고 판단하여 만들게 되었습니다.

이 지표에 대해 간단히 설명드리겠습니다.


----하얀색 플롯에 대해----
1. 이동평균선이 진행되는 현재 시점에서 미분의 근사값을 구하고, 다시 한 번 미분의 근사값을 구해서 '가속도'를 얻습니다.

2. 가속도가 0이 되는 곳은, 곧 해당 이동평균선의 힘이 바뀌는 곳을 의미합니다.

3. 따라서, 그 당시 시점 기준으로 포물선을 그려낸다면, 가속도를 이용하여 해당 이동평균선의 포물선을 그려낼 수 있습니다. 이것은 지표의 하얀색점로서 표기됩니다.

4. 이 때, 이러한 점들은 다음의 가속도가 0이 되는 지점, 즉 포물선의 힘이 바뀌는 곳에서 다시 초기화됩니다.

5. 올라가고 있던 포물선에서의 예측치보다 이동평균선이 더 급하게 올라간다면, 더욱 급격한 상승이 예상됩니다. 이 경우, 그려지고있는 포물선이 깨질 때쯤부터 리스크 관리를 시작할 수 있습니다.
(녹색/빨간색의 선으로 실제 MA를 표현했습니다. 거슬리시면 '모습'가셔서 끄셔도 좋습니다. )

6. 추세가 변경되기 전, 즉 이동평균선의 방향이 바뀌기 전에는 가속도가 0이 되는 구간이 존재하고, 그것이 차트 위에 다음과같이 표현됩니다.
(하단의 지표는, 해당 포물선의 가속도을 나타냅니다)

----붉은색 플롯에 대해----
1. 이동평균선 값을 미분 근사값 즉, '기울기'를 구합니다.

2. 기울기가 0이 되는 곳은, 포물선이 극점이 되는 곳을 뜻합니다.

3. 따라서, 해당 시점의 가속도를 2차함수의 계수로 하여, 또한 해당 극점을 하나의 꼭지점으로 설정하여,이차함수를 그려낼 수 있습니다. 이것은 지표의 빨간색점으로서 표현됩니다.
(실제 이동평균선은 2차함수가 아니기에, 포물선이 유지된다는 가정 하에 "억지로"만들어낸 이차함수입니다)

4. 이 때, 이러한 점은 다음 극점이 0이 되는 곳에서 초기화되고 이차함수가 만들어집니다.

5. 위의 과정에서 얻은 식을 바탕으로 'offset'을 통해 미래의 이동평균선을 예측할 수 있습니다.
즉, 현재시점의 x값을 'k'라고 한다면, (k+1)을 이차함수에 대입하여 1캔들 앞의 이동평균선을 예측할 수 있습니다.
해당 예측치가 지나간 자리는, 빨간색점을 통해 보여집니다.

6. 선택한 이동평균선이 스무스할수록 극점은 덜 등장하게되고, 포물선의 위치가 맞아들어갈 가능성이 높습니다.
현재 디폴트값으로 설정된 T3의 경우, 약 20캔들 앞을 예측해도 매우 높은 정확도를 보여줍니다.
반면에, SMA와 같이 울퉁불퉁한 이동평균선은 가능한 예측치가 크지 않습니다.
(SMA 60, offset=10)

--------

매우 높은 수준의 정확도를 보여준 이동평균선은 JMA(Jurik Moving Average)입니다. 다만 이 이동평균선은 코드가 공개되지 않았기때문에, 관심있으신 분은 저의 코드를 통해 한번 확인해보시길 권장드립니다.

추가로, 제가 올린 이 지표의 코드는 이용가치가 높다고 생각합니다.

하나의 예시로서, 가속도로 예측한 포물선이 깨지는 곳을 기준으로, 힘이 다시 한 번 바뀌는 것을 이용해 진입/로스를 할 수 있습니다. 그 외에도 매우 다양한 활용이 가능합니다.

이 지표를 통해 더욱 좋은 새로운 결과물이 나오길 기대해봅니다.
Catatan Rilis:
- Updated the code to reduce the calculation time and made it more purposeful.

- Some plot colors were overlapping and difficult to see, so I changed some of the colors.
Skrip open-source

Dalam semangat TradingView, penulis dari skrip ini telah mempublikasikannya ke sumber-terbuka, maka trader dapat mengerti dan memverifikasinya. Semangat untuk penulis! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.

Inggin menggunakan skrip ini pada chart?