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

[通达信指标/源码] [转载]波段之星 通达信源码

[通达信指标/源码] [转载]波段之星 通达信源码

公式:
  1. 拉升力:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,30)-LLV(LOW,36))*0.6*CLOSE;
  2. 拉升力A:=SMA(拉升力,6.3,1);
  3. 波峰波谷:SMA(拉升力A,3,1),COLORFF00FF;
  4. 拉升力B:=3*拉升力A-2.1*波峰波谷;
  5. 空方:=3*波峰波谷-1* 拉升力A;
  6. 做空:IF(空方>拉升力B,拉升力B,空方),LINETHICK2,COLOR00FF00;
  7. 做空周期:HHV(做空,21),COLORBLUE,LINETHICK2;
  8. 多头:IF(做空>=REF(做空,1) ,做空,DRAWNULL),COLORRED,LINETHICK3;
  9. DRAWICON(做空>=REF(做空,1) AND REF(做空,1)<REF(做空,2),做空,23);
  10. 空头:IF(做空<REF(做空,1),做空,DRAWNULL),COLORGREEN,LINETHICK3;
  11. {DRAWICON(做空<=REF(做空,1) AND REF(做空,1)>REF(做空,2),做空,19);}
  12. 短线:(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*20,LINETHICK0,COLORWHITE;
  13. 中线:(CLOSE-MA(CLOSE,4))/MA(CLOSE,4)*20,LINETHICK0,COLORYELLOW;
  14. 红柱:SMA(短线,3,1),LINETHICK0,COLOR0000FF;
  15. 蓝柱:SMA(中线,3,1),COLORSTICK,COLORFFFF00;
  16. {红柱}
  17. STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,2,0),COLOR888800;
  18. STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,1.5,0),COLORAAAA00;
  19. STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,0.8,0),COLORDDDD00;
  20. STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,0.3,0),COLORFFFF00;
  21. STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,2,0),COLOR000088;
  22. STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,1.5,0),COLOR0000AA;
  23. STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,0.8,0),COLOR0000DD;
  24. STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,0.3,0),COLOR0000FF;
  25. STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,2,0),COLOR008800;
  26. STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,1,0),COLOR00AA00;
  27. STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,0.8,0),COLOR00DD00;
  28. STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,0.3,0),COLOR00FF00;
  29. {蓝柱}
  30. STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,2,0),COLOR880088;
  31. STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,1.5,0),COLORAA00AA;
  32. STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,0.8,0),COLORDD00DD;
  33. STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,0.3,0),COLORFF00FF;
  34. STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,2,0),COLOR888800;
  35. STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,1.5,0),COLORAAAA00;
  36. STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,0.8,0),COLORDDDD00;
  37. STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,0.3,0),COLORFFFF00;
  38. STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,2,0),COLOR009999;
  39. STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,1.5,0),COLOR00BBBB;
  40. STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,0.8,0),COLOR00DDDD;
  41. STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,0.3,0),COLOR00FFFF;

  42. VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
  43. VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;
  44. VAR400:=EMA(VAR300,5);
  45. 操盘:=3*VAR300-2*VAR400;
  46. A1:=CROSS(操盘,VAR300) AND VAR300<2.1 AND C>O;
  47. STICKLINE(A1,5,0,4,0),COLOR770077;
  48. STICKLINE(A1,5,0,3,0),COLOR990099;
  49. STICKLINE(A1,5,0,2,0),COLORBB00BB;
  50. STICKLINE(A1,5,0,1,0),COLORDD00DD;
  51. STICKLINE(A1,5,0,0.3,0),COLORFF00FF;
  52. DRAWTEXT(A1,5.2,'全仓'),COLORRED;

  53. CYC13:=0.01*EXPMA(AMOUNT,13)/EXPMA(VOL,13);
  54. CYS:(CLOSE-CYC13)/CYC13*100;
  55. DRAWTEXT("ZXNH.ZXNH"=1 AND CYS<=-2,CYS,'B'),COLORRED;
  56. DRAWTEXT("ZXNH.ZXNH"=1 AND CYS>2,CYS,'S'),COLORGREEN;
复制代码



主图源码

N : 1 100 20
M : 1 100 32
P1: 1 100 80
P2: 1 100 100


  1. {机构进场+趋势买卖}
  2. VAR1:=(C+H+O+L)/4;

  3. {白线上面要关注,红线上面是买点,买错也要买。}
  4. VAR3:=LLV(HIGH,240);
  5. VAR4:=100*(CLOSE-VAR3)/VAR3;
  6. VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;
  7. VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;
  8. VAR7:=0;
  9. VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
  10. VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
  11. VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
  12. VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
  13. VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
  14. VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
  15. VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
  16. VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
  17. VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
  18. VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
  19. VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
  20. VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
  21. 买1:=VAR10;
  22. 买2:=(VAR11+VAR13+VAR15+VAR17);
  23. 卖1:=(VAR12+VAR14+VAR16+VAR18);
  24. B:IF(买1>0 OR 买2>0,LOW*0.99,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
  25. DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买'),COLORRED;
  26. S:IF(卖1>0,HIGH*1.01,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN;
  27. DRAWTEXT(卖1>0,HIGH*1.02,'卖'),COLORGREEN;
  28. DRAWICON((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)),LOW*0.98,1) ;
  29. DRAWICON((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)),HIGH*1.01,2);
  30. ZB:=EMA(EMA(VAR3,5),5)*3, COLORSTICK;
  31. VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);
  32. K:=EMA(VAR7,5)*2, , COLORFF00FF;
  33. D:=EMA(K,5), , COLORWHITE;
  34. J:=K*3-D*2, ,COLORYELLOW;
  35. VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;
  36. HS:=VOL/CAPITAL*100, , COLORGREEN;
  37. VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
  38. VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);
  39. DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'机构进场'),LINETHICK1,COLORFF00FF;
  40. VAR1A:=IF(VARE>0,VARE,0);
  41. VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;
  42. VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;
  43. DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,LOW*0.95,'大顶(底)') COLORWHITE;
  44. 趋势线:EMA(CLOSE,17),LINETHICK1,COLORFFFFFF;
  45. 牛熊分界线:EMA(CLOSE,50),LINETHICK1,COLORRED;


  46. 卖出:XMA(VAR1,N)*(1+P1/1000),COLORGREEN,LINETHICK2;
  47. 买入:XMA(VAR1,M)*(1-P2/1000),COLORMAGENTA,LINETHICK2;
  48. 幅度:100*(卖出-买入)/买入,NODRAW;
  49. MA1:=MA(VAR1,3);
  50. STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,MAX(卖出,MAX(OPEN,CLOSE)),3,0),COLORGREEN;
  51. STICKLINE(卖出>MIN(C,O) AND 卖出<MAX(C,O),卖出,MAX(OPEN,CLOSE),3,0),COLORGREEN;
  52. STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,HIGH,0,0),COLORGREEN;
  53. STICKLINE(卖出<LOW,OPEN,CLOSE,3,0),COLORGREEN;
  54. STICKLINE(卖出<LOW,HIGH,LOW,0,0),COLORGREEN;
  55. STICKLINE(买入>LOW AND 买入<HIGH,买入,MIN(MIN(OPEN,CLOSE),买入),3,0),COLORMAGENTA;
  56. STICKLINE(买入>MIN(C,O) AND 买入<MAX(C,O),买入,MIN(OPEN,CLOSE),3,0),COLORMAGENTA;
  57. STICKLINE(买入>LOW AND 买入<HIGH,买入,LOW,0,0),COLORMAGENTA;
  58. STICKLINE(买入>HIGH,OPEN,CLOSE,3,0),COLORMAGENTA;
  59. STICKLINE(买入>HIGH,HIGH,LOW,0,0),COLORMAGENTA;
复制代码




论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   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

返回列表