COCO研究院

 找回密碼
 註冊
搜索
查看: 5458|回復: 5

Aggressive AFL Code (ATR SYSYTEM)

[複製鏈接]
發表於 10-6-18 14:49 | 顯示全部樓層 |閱讀模式
  1. SetBarsRequired(1000000, 1000000);
  2. SetChartOptions(2,chartShowArrows|chartShowDates);
  3. SetTradeDelays(0,0,0,0);

  4. period = Param("Period", 13, 1, 240, 1);
  5. mult = Param("Multiplier", 1.7, 1, 240, 0.1);
  6. showPrice = ParamToggle("Show Price","No|yes",1);
  7. showArrows = ParamToggle("Show Arrows","No|yes",1);
  8. showRibbon = ParamToggle("Show Ribbon","No|yes",1);

  9. f=ATR(period);

  10. VS[0] = Close[0];
  11. trend[0] = 0;
  12. HighC[0]=0;
  13. Lowc[0]=0;


  14. for( i = period+1; i < BarCount; i++ )
  15. {

  16. vs[i] = vs[i-1];
  17. trend[i] = trend[i-1];
  18. highC[i] = HighC[i-1];
  19. lowc[i] = lowc[i-1];

  20. if ((trend[i]>=0) && ( C[i] <VS[i] ))
  21. {
  22. trend[i] =-1;
  23. HighC[i] = C[i];
  24. lowc[i] = C[i];
  25. }

  26. if ((trend[i]<=0) && (C[i] >VS[i]))
  27. {
  28. trend[i]=1;
  29. HighC[i] = C[i];
  30. lowc[i] = C[i];
  31. }

  32. if (trend[i]==-1)
  33. {
  34. if (C[i]<lowc[i]) lowc[i] = C[i];
  35. VS[i]= lowc[i]+ (mult*f[i]);
  36. }


  37. if (trend[i]==1)
  38. {
  39. if (C[i]>HighC[i]) HighC[i] = C[i];
  40. VS[i]= HighC[i]-(mult*f[i]);
  41. }

  42. }


  43. Buy=Cross(Trend,0);
  44. Sell=Cross(0, Trend);
  45. Short = Sell;
  46. Cover = Buy;

  47. if (ShowPrice) Plot(Close,"Close",colorBlack,styleCandle);
  48. Plot(VS, "Vol Stop",IIf(trend==1,10,11 ),styleThick);

  49. mkol = IIf( Trend==1, 10, 11);
  50. if (ShowRibbon) Plot(5, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel|styleNoTitle, 0, -5);

  51. shape = Buy * shapeUpArrow + Sell* shapeDownArrow;
  52. if (ShowArrows) PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low-f, High+f));
  53. AlertIf( Buy, "SOUND C:\\Windows\\Media\\timeout.wav", "Sell " + C,2,1+2,1);
  54. AlertIf( Sell, "SOUND C:\\Windows\\Media\\timeout.wav","Buy " + C,1,1+2,1);
複製代碼


1.jpg
 樓主| 發表於 10-6-18 14:50 | 顯示全部樓層
AlertIf( Buy, "SOUND C:\\Windows\\Media\\timeout.wav", "Sell " + C,2,1+2,1);

AlertIf( Sell, "SOUND C:\\Windows\\Media\\timeout.wav","Buy " + C,1,1+2,1);
買賣點會回報聲音........音效請自己改喔^^
發表於 10-6-18 17:31 | 顯示全部樓層
推 ~~~   好東西  ~~  謝謝分享  ~~~
發表於 12-4-29 14:31 | 顯示全部樓層
看看哦~~~~~~
發表於 12-8-17 03:13 | 顯示全部樓層
謝謝你的分享,研究學習看看
發表於 12-8-17 08:42 | 顯示全部樓層
不錯,很厲害
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-11-23 04:54

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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