: | : | :期货量化学习 | :期货量化 |
返回列表 发帖

[大智慧指标] [转载]坚胜金线(主黄金线)

[大智慧指标] [转载]坚胜金线(主黄金线)

坚胜金线(主黄金线)

有个股所属板块、大盘涨跌家数、黄金分割线、市场成本线、彩色K线(黄色涨停,兰色跌停)、短波顶低信号提示、股价上穿成本线有笑脸、支撑和压力参考值、买入卖出天数等

  1. {主黄金线}
  2. input:K(1,1,3);           
  3. T:=BARSLAST(DISPSTATUS=1)+1;
  4. A:=DISPSTATUS=2;HH:=HHV(H, T);LL:=LLV(L, T);HL:=HH-LL;wH:=HHVBARS(H, T);wL:=LLVBARS(L, T);
  5. KK:=wH-wL;mHL:=HH-HL*0.5;
  6. if K=1 then begin
  7. HL191:=(HH-LL)*0.191;HL382:=(HH-LL)*0.382;HL618:=(HH-LL)*0.618;HL809:=(HH-LL)*0.809;
  8. if KK<0 then begin
  9. a1:=HH-HL191;a2:=HH-HL382;a3:=HH-HL618;a4:=HH-HL809;
  10. end else begin
  11. a1:=LL+HL191;a2:=LL+HL382;a3:=LL+HL618;a4:=LL+HL809;
  12. end end
  13. if k=1 then begin
  14. HL125:=(HH-LL)*0.125;HL250:=(HH-LL)*0.25;HL375:=(HH-LL)*0.375;HL625:=(HH-LL)*0.625;HL750:=(HH-LL)*0.75;HL875:=(HH-LL)*0.875;
  15. if kk<0 then begin
  16. b1:=HH-HL125;b2:=HH-HL250;b3:=HH-HL375;b4:=HH-HL625;b5:=HH-HL750;b6:=HH-HL875;
  17. end else begin
  18. b1:=LL+HL125;b2:=LL+HL250;b3:=LL+HL375;b4:=LL+HL625;b5:=LL+HL750;b6:=LL+HL875;
  19. end end  
  20. DRAWTEXT(A and K<>3,HH, '最高价:'+HH),ALIGN2,ColorFF00FF;
  21. DRAWTEXT(A and K<>3,LL, '最低价:'+ll),ALIGN2,VALIGN2,Color00FF00;
  22. DRAWTEXT(A and K<>3,mHL,'50%:'+mHL),ALIGN2,ColorFF8000;
  23. DRAWTEXT(A and K=1, a1, '0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 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,ColorFF8000,linethick7;
  34. DRAWTEXT(A and K=1, a1, '﹊﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊  ﹊ ﹊ ﹊﹊'),ALIGN2,color208FFF,linethick0;
  35. DRAWTEXT(A and K=1, a2, '﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊'),ALIGN2,color208FFF,linethick0;
  36. DRAWTEXT(A and K=1, a3, '﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊﹊'),ALIGN2,color208FFF,linethick0;
  37. DRAWTEXT(A and K=1, a4, '﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊﹊'),ALIGN2,color208FFF,linethick0;
  38. DRAWTEXT(A and K=1, b1, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;
  39. DRAWTEXT(A and K=1, b2, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;
  40. DRAWTEXT(A and K=1, b5, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;
  41. DRAWTEXT(A and K=1, b6, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;
  42. 市场成本:DMA(AMOUNT/V/100,V/CAPITAL),Color0080FF,LINETHICK1;
  43. DRAWICON(CROSS(C,市场成本),L,1),ALIGN1;
  44. PT:= REF(HIGH,1)-REF(LOW,1);
  45. 重心:=(HIGH + LOW + CLOSE)/3;
  46. 压力Ⅰ:=2*重心-LOW;压力Ⅱ:= 重心 + PT;
  47. 支撑Ⅰ:=2*重心-HIGH;支撑Ⅱ:= 重心 - PT;
  48. DRAWTEXTABS(50,68,'  重心:'+重心),Color208FFF;
  49. DRAWTEXTABS(20,87,'   支  撑'),Color00FF00;
  50. DRAWTEXTABS(20,104,'   '+支撑Ⅰ),Color00FF00;
  51. DRAWTEXTABS(20,122,'   '+支撑Ⅱ),Color00FF00;
  52. DRAWTEXTABS(40,87,'           压  力'),ColorFF00FF;
  53. DRAWTEXTABS(40,104,'           '+压力Ⅰ),ColorFF00FF;
  54. DRAWTEXTABS(40,122,'           '+压力Ⅱ),ColorFF00FF;
  55. DRAWTEXTABS(25,65,'│'),Color00FFFF;
  56. DRAWTEXTABS(25,77,'│'),Color00FFFF;
  57. DRAWTEXTABS(25,89,'│'),Color00FFFF;
  58. DRAWTEXTABS(25,101,'│'),Color00FFFF;
  59. DRAWTEXTABS(25,113,'│'),Color00FFFF;
  60. DRAWTEXTABS(25,125,'│'),Color00FFFF;
  61. DRAWTEXTABS(145,65,'│'),Color00FFFF;
  62. DRAWTEXTABS(145,77,'│'),Color00FFFF;
  63. DRAWTEXTABS(145,89,'│'),Color00FFFF;
  64. DRAWTEXTABS(145,101,'│'),Color00FFFF;
  65. DRAWTEXTABS(145,113,'│'),Color00FFFF;
  66. DRAWTEXTABS(145,125,'│'),Color00FFFF;
  67. DRAWTEXTABS(96,85,'│'),Color00FFFF;
  68. DRAWTEXTABS(96,89,'│'),Color00FFFF;
  69. DRAWTEXTABS(96,101,'│'),Color00FFFF;
  70. DRAWTEXTABS(96,113,'│'),Color00FFFF;
  71. DRAWTEXTABS(96,125,'│'),Color00FFFF;
  72. DRAWTEXTABS(30,60,'──────────'),Color00FFFF;
  73. DRAWTEXTABS(30,80,'──────────'),Color00FFFF;
  74. DRAWTEXTABS(30,97,'──────────'),Color00FFFF;
  75. DRAWTEXTABS(30,114,'──────────'),Color00FFFF;
  76. DRAWTEXTABS(30,131,'──────────'),Color00FFFF;
  77. G:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);
  78. X:=ZIG(3,5)<REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)>=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);
  79. ED:=barslast(G);
  80. EF:=barslast(X);
  81. DRAWTEXTREL(35,450,'买入:'+NUMTOSTR(ED) +'天'+'  卖出:'+NUMTOSTR(EF) +'天'   ),colorFfff00;
  82. {K线优化}
  83. STICKLINE(close>=open,open,close,8,1),colorred;
  84. STICKLINE(open>close,close,open,8,0 ),ColorFFFF00;
  85. STICKLINE(close>=open,close,HIGH,0.5 ,0 ),colorred;
  86. STICKLINE(close>=open,open,low,0.5 ,0),colorred;
  87. STICKLINE(open>close,close,low,0.5 ,0 ),ColorFFFF00;
  88. STICKLINE(open>close,open,HIGH,0.5 ,0 ),ColorFFFF00;
  89. C2:=REF(C,1);
  90. 涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
  91. STICKLINE(涨停,OPEN,CLOSE,8,0),Color00FFFF;
  92. 跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);
  93. STICKLINE(跌停,OPEN,CLOSE,8,0),ColorFF8000;
  94. {粉兰色K线};
  95. F:=100*(C-REF(C,1))/REF(C,1);
  96. 今小昨:=IF(C<REF(O,1) AND f<0,1,0);
  97. p1:=今小昨;
  98. 今小前:=IF(C<REF(O,2) AND f<0,1,0);
  99. p2:=今小前;
  100. stickline(P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1,open,CLOSE,6,0),COLORMAGENTA;
  101. stickline(P1=1 AND REF(P1,1)=0 AND P2=1  AND REF(P2,1)=0,open,CLOSE,3,0),COLORBLUE;
  102. DRAWTEXT(G,L*0.997,'△'),ALIGN1,VALIGN0,Color00FF00;
  103. DRAWTEXT(G,L,' ̄'),ALIGN1,VALIGN0,Color00ff00;
  104. DRAWTEXT(X,H*1.002,'▽'),ALIGN1,VALIGN2,ColorFF00FF;
  105. DRAWTEXT(X,H,' ̄'),ALIGN1,VALIGN0,ColorFF00FF;
  106. DRAWTEXTREL(180,25,'所属板块:'+BKNAME),COLORFFFFFF;
  107. 今市上涨家数:=INDEXADV;
  108. 平盘家数:=DYNAINFO(68);
  109. 今市下跌家数:=INDEXDEC;
  110. WW:=BARSLAST(DISPSTATUS=1);
  111. DRAWTEXTABS(210,32,'◇目前可见K线:'+NUMTOSTRN(WW+1,0)+'天'),COLORYELLOW;

  112. DRAWTEXTABS(30,10,'今市上涨:'+今市上涨家数+' 家'),ColorFFFF00,linethick2;
  113. DRAWTEXTABS(58,25,'平盘:'+平盘家数+' 家'),ColorFFFF00,linethick2;
  114. DRAWTEXTABS(58,40,'下跌:'+NUMTOSTRN(今市下跌家数,0)+' 家'),ColorFFFF00,linethick2;

  115. DRAWGBKLAST(CLOSE>0,  strip(RGB(1,70,100), RGB(1,30,10),2));
复制代码


微信截图_20181010094856.png

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   1.本站发布源码(包括函数、指标、策略等)均属开放源码,用意在于让使用者学习程序化语法撰写,使用者可以任意修改语法內容并调整参数。仅限用于个人学习使用,请勿转载、滥用,严禁私自连接实盘账户交易
  2.本站发布资讯(包括文章、视频、历史记录、教材、评论、资讯、交易方案等)均系转载自网络主流媒体,内容仅为作者当日个人观点,本网转载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。本网不对该类信息或数据做任何保证。不对您构成任何投资建议,不能依靠信息而取代自身独立判断,不对因使用本篇文章所诉信息或观点等导致的损失承担任何责任。
  3.本站发布资源(包括书籍、杂志、文档、软件等)均从互联网搜索而来,仅供个人免费交流学习,不可用作商业用途,本站不对显示的内容承担任何责任。请在下载后24小时内删除。如果喜欢,请购买正版,谢谢合作!
  4.龙听期货论坛原创文章属本网版权作品,转载须注明来源“龙听期货论坛”,违者本网将保留追究其相关法律责任的权力。本论坛除发布原创文章外,亦致力于优秀财经文章的交流分享,部分文章推送时若未能及时与原作者取得联系并涉及版权问题时,请及时联系删除。联系方式:http://www.qhlt.cn/thread-262-1-1.html
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

返回列表