COCO研究院

 找回密碼
 註冊
搜索
查看: 5256|回復: 2

AO動能指標 (顏色自己改吧)

[複製鏈接]
發表於 10-6-11 17:47 | 顯示全部樓層 |閱讀模式
  1. /* Exploration, System and Indicator */
  2. // Author: Steve Wiser
  3. // Email address: slwiserr@erols.com
  4. // May 5, 2001 */
  5. /*

  6. The Awesome Oscillator measures the immediate momentum of the last 5 price bars as
  7. compared to the last 34 price bars.
  8. Three types of signals are generated by the AO:
  9. The Saucer, the Cross, and Twin Peaks
  10. Above the Zero Line, the only signals generated are a Twin Peaks sell, a Saucer buy and
  11. a buy Cross.
  12. Below the Zero Line, the only signals generated are a Twin Peaks buy, Saucer sell, and a
  13. sell Cross.

  14. We color green any histogram bar that is higher than the previous
  15. histogram bar, and we color red any histogram bar that is lower than the previous bar.

  16. Saucer Signal:
  17. 1. Always read from left to right.
  18. 2. It takes a minimum of three bars to create a signal.
  19. 3. There is no limit to how many bars can be inside a saucer.
  20. 4. All bars in a Saucer must be above the zero line
  21. 5. The signal bar will be a Green Bar
  22. 6. You can not have a buy and sell at the same time.
  23. 7. After creating a signal, you MUST have a change of direction (color) before creating
  24. another signal.
  25. 8. Once you have created a signal, go to the corresponding price bar and add/subtract 1
  26. tick to the high/low.

  27. THE AO CROSS BUY
  28. buy when the histogram is "crossing" the zero line from a negative number to a positive
  29. number.

  30. Twin Peaks buy signal
  31. This is the only buy signal that can be created while the AO histogram is below the zero line
  32. a€¢ The first peak must be a larger negative number than the second peak.
  33. a€¢ Your trigger bar will be a Green Bar and a smaller negatille number than either peak.
  34. a€¢ If any bars cross the zero line in the Twin Peaks, the signal is invalid.
  35. a€¢ A Saucer Sell will be created before a Twin Peaks Buy.

  36. General Emphasis: You cannot sell on an AO signal if the current
  37. histogram bar is green, and you cannot buy any AO signals if the current histogram bar is red.
  38. */

  39. //outsidebar = Outside();
  40. //insidebar = H <= Ref(H,-1) AND L >= Ref(L,-1);
  41. //upbar = H > Ref(H,-1) AND L >= Ref(L, -1);
  42. //downbar = L < Ref(L,-1) AND H <= Ref(H,-1);
  43. //barcolor=IIf(outsidebar, 1,
  44. // IIf(downbar, 4,
  45. // IIf(upbar, 5,
  46. // IIf(insidebar,6, 0 ) ) ) );

  47. /*barcolor=
  48. iif(outsidebar, 1, iif(downbar, 4, iif(upbar,5, 0) ) );*/


  49. var1=MA( Avg , 34);
  50. var2=MA( Avg,5);
  51. diff = var2-var1;
  52. Graph0= diff;
  53. Graph0Name = "AO";
  54. Graph0Style=2+4;
  55. Graph1=Wilders(diff ,5);
  56. Graph1Style=4+1;
  57. UpBar = diff > Ref(diff,-1);
  58. DownBar = diff < Ref(diff,-1);
  59. Graph0BarColor=IIf(UpBar, colorred, colorblack);

  60. SoucerUp = Ref(diff,-2) > Ref(diff,-1) AND Ref(diff,-1) < diff;
  61. SoucerDown = Ref(diff,-2) < Ref(diff,-1) AND Ref(diff,-1) > diff;

  62. SoucerBuy = SoucerUp AND (diff > 0 AND Ref(diff,-1) > 0 AND Ref(diff,-2) > 0);
  63. SoucerSell = SoucerDown AND (diff < 0 AND Ref(diff,-1) < 0 AND Ref(diff,-2) < 0);

  64. CrossBuy = diff > 0 AND Ref(diff,-1) < 0;
  65. CrossSell = diff < 0 AND Ref(diff,-1) > 0;

  66. Buy = SoucerBuy OR CrossBuy;
  67. Sell = SoucerSell OR CrossSell;
  68. //PlotShapes( IIf(SoucerBuy ,shapeDigit1,0) ,colorBlue, 0, 0,-12);
  69. //PlotShapes( IIf(CrossBuy ,shapeDigit2,0) ,colorBlue, 0, 0,-12);
  70. //PlotShapes( IIf(SoucerSell ,shapeDigit1,0) ,colorOrange, 0, 0,12);
  71. //PlotShapes( IIf(CrossSell ,shapeDigit2,0) ,colorOrange, 0, 0,12);

  72. LatestLowPeak = IIf(diff < 0, Ref(LowestSince(CrossSell, diff, 1), -1), 0);
  73. TwinPeaksBuy = diff < 0 AND Ref(DownBar, -1) AND UpBar AND Ref(diff,-1) > LatestLowPeak;

  74. //Move latest lowest peak to the new one created now:
  75. LatestLowPeak = IIf(TwinPeaksBuy, Ref(diff,-1), LatestLowPeak);


  76. //PlotShapes( IIf(TwinPeaksBuy ,shapeDigit3,0) ,colorBlue, 0, 0,12);

  77. LatestHighPeak = IIf(diff > 0, Ref(HighestSince(CrossBuy, diff, 1), -1), 0);
  78. TwinPeaksSell = diff > 0 AND Ref(UpBar, -1) AND downBar AND Ref(diff,-1) < LatestHighPeak ;

  79. LatestHighPeak = IIf(TwinPeaksSell, Ref(diff,-1), LatestHighPeak );

  80. //PlotShapes( IIf(TwinPeaksSell ,shapeDigit3,0) ,colorOrange, 0, 0,-12);

  81. SuperAOBuy = Ref(DownBar, -3) AND Ref(UpBar, -2) AND Ref(UpBar, -1) AND UpBar;
  82. SuperAOSell = Ref(UpBar, -3) AND Ref(DownBar, -2) AND Ref(DownBar, -1) AND DownBar;
  83. //PlotShapes( IIf(SuperAOBuy ,shapeDigit4,0) ,colorBlue, 0, 0,12);
  84. //PlotShapes( IIf(SuperAOSell ,shapeDigit4,0) ,colorOrange, 0, 0,-12);

  85. /* Super AO Blue Light Special
  86. If you have a Super AO buy signal and it is not hit and the AO does not change color,
  87. and the next bar has a lower high then you will move your buy stop down to one tick above that high.
  88. You will continue to do this until the signal is hit or the AO changes color
  89. */

  90. //Commentary:
  91. WriteIf(SuperAOBuy,"Place Buy Stop to buy 1 unit if price rises to " + WriteVal(H+0.01)+" or higher. (AO+ SAO Add on)",
  92. WriteIf(SuperAOSell ,"Place Sell Stop to sell 1 unit if price falls to " + WriteVal(L-0.01)+" or lower. (AO- SAO Add on)",
  93. WriteIf(SoucerBuy ,"Place Buy Stop to buy 1 unit if price rises to " + WriteVal(H+0.01)+" or higher. (AO+ Soucer)",
  94. WriteIf(SoucerSell ,"Place Sell Stop to sell 1 unit if price falls to " + WriteVal(L-0.01)+" or lower. (AO- Soucer)",
  95. WriteIf(CrossBuy ,"Place Buy Stop to buy 1 unit if price rises to " + WriteVal(H+0.01)+" or higher. (AO+ Zero Cross)",
  96. WriteIf(CrossSell ,"Place Sell Stop to sell 1 unit if price falls to " + WriteVal(L-0.01)+" or lower. (AO- Zero Cross)",
  97. WriteIf(TwinPeaksBuy ,"Place Buy Stop to buy 1 unit if price rises to " + WriteVal(H+0.01)+" or higher. (AO+ Twin Peaks)",
  98. WriteIf(TwinPeaksSell ,"Place Sell Stop to sell 1 unit if price falls to " + WriteVal(L-0.01)+" or lower. (AO- Twin Peaks)",""))))))));
複製代碼
發表於 10-6-11 19:24 | 顯示全部樓層
本帖最後由 清茶無糖 於 10-6-11 07:25 PM 編輯

alexwang7777下午分享好多清茶小弟看沒有的東東
發表於 10-6-11 19:34 | 顯示全部樓層
好長一串最後這個;
複製不了要自己加上
謝謝分享呢
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-12-21 23:44

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 |