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

[大智慧指标] 大智慧主黄金线主图指标源码[大智慧公式]

[大智慧指标] 大智慧主黄金线主图指标源码[大智慧公式]

使用说明:我从论坛上学习了网友们的许多线’指标,内容丰富:有个股所属板块、大盘涨跌家数、黄金分割线、市场成本线、彩色K线(黄色涨停,兰色跌停)、短波顶低信号提示、股价上穿成本线有笑脸、支撑和压力参考值、买入卖出天数等。

{大智慧主黄金线主图指标源码}

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



微信截图_20181215102649.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

返回列表