COCO研究院

 找回密碼
 註冊
搜索
查看: 6574|回復: 10

[程式碼]KDJ指標

[複製鏈接]
發表於 11-3-25 21:42 | 顯示全部樓層 |閱讀模式
這是之前在AFL Library看到的,現在要註冊才能進去看
這種計算方式似乎與精業版的KDJ相似,而與AB原有的KD不太一樣
  1. _SECTION_BEGIN("Stochastic %J");
  2. printf("The KDJ indicator is actually a derived form of the Stochastic with the
  3. only difference being an extra line called the J line." +
  4. " The J line represents the divergence of the %D value from the %K. The value
  5. of J can go beyond [0, 100] for %K and %D lines on the chart." +
  6. "\nTrading Signals: A negative value of J combined with %K and %D at the bottom
  7. range indicates a strong over sold signal." +
  8. " Likewise, when the J value goes above 100, combined with %K and %D at the top
  9. range, it will indicate a strong over bought signal. " +  
  10. "\nSettings: Default:  14 period, 3 period, 1 period");


  11. N         = param("Range", 9, 2, 20, 1);
  12. M1         = param("%K Period", 3, 1, 20, 1);
  13. M2        = param("%D Period", 3, 1, 20, 1);

  14. RSV        = (CLOSE - LLV(LOW, N))/(HHV(HIGH, N)- LLV(LOW, N)) * 100;
  15. K         = EMA(RSV, M1);
  16. D         = EMA(K, M2);
  17. J         = 3 * K-2 * D;
  18. plot(J, "Stochastic %J", colorred);
  19. plot(D, "Stochastic %D", colorblue);
  20. plot(K, "Stochastic %K", colorgreen);
  21. plot(80, "", colorblack);
  22. plot(20, "", colorblack);
  23. _SECTION_END();
複製代碼
順便問一下,KD指標還有分快、慢不同版本(不是指快、慢線),這其中的區別何在?
發表於 11-3-25 21:55 | 顯示全部樓層
本帖最後由 飛砂風中轉 於 11-3-25 10:19 PM 編輯

"快速KD"作法是以KD線的快線作慢線..而KD線的快線不作平滑處理所形成快線所畫成的..其用法跟KD線一樣。
發表於 11-3-26 00:34 | 顯示全部樓層
我把我的策略化為簡單的電腦程式。長線賺錢其實不難。順勢而為
發表於 11-3-26 12:58 | 顯示全部樓層
我把我的策略化為簡單的電腦程式。長線賺錢其實不難。順勢而為
bbdcd 發表於 11-3-26 12:34 AM



   厲害喔! 恭喜啦~~
發表於 11-3-26 15:03 | 顯示全部樓層
非常感謝樓上的幾位大大.程式真的學無止境,永遠都有改善的空間.
發表於 11-3-27 10:01 | 顯示全部樓層
本帖最後由 gofeel168 於 11-3-27 10:11 AM 編輯

感謝!又給小弟一個新的思考方向!
發表於 11-3-27 10:32 | 顯示全部樓層
謝謝fygul大分享指標
發表於 11-3-27 21:30 | 顯示全部樓層
謝fygul大詳細說明
謝fygul大
 樓主| 發表於 11-3-28 22:28 | 顯示全部樓層
回復 2# 飛砂風中轉


    原來如此。以前看到Slow KD就傻眼了。因有些券商提供的KD指標只有Slow版,用起來還真不習慣。
發表於 11-3-29 08:48 | 顯示全部樓層
一定有甚麼玄機~有甚麼玄機~
 樓主| 發表於 11-4-15 18:03 | 顯示全部樓層
上面的RSV要改一下,不然會出問題
  1. v1=HHV(High, Range);
  2. v2=LLV(Low, Range);
  3. RSV = IIf((V1==V2), 50, (Close - v2)/ (v1- v2) * 100);
複製代碼
還有,這與精業版的不一樣,之前弄錯了
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-5-14 18:58

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook