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

[大智慧指标] [转载]顶背离(看各类资金持仓 副图 源码)

[大智慧指标] [转载]顶背离(看各类资金持仓 副图 源码)


公式如下:

  1. SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
  2. DRAWTEXTREL(12,5,'量能饱和度:'+NUMTOSTRN(SAT,0)),LINETHICK3,Color8000FF;
  3. AA10:MA(CLOSE,8),color0000FF;
  4. AA12:MA(CLOSE,12),color0000FF;
  5. BB10:=((ATAN((AA10 - REF(AA10,1))) * 3.1416) * 10);
  6. BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) * 10);
  7. MA13:=MA(CLOSE,13);
  8. FILLRGN(AA10,AA12,(((AA12 <= AA10) AND (BB12 >= 1)) AND (BB10 >= 1))),Color0098FF;
  9. FILLRGN(AA10,AA12,(((AA12 >= AA10) AND (BB10 <= 1)) AND (BB10 <= 1))),color00FF00;
  10. x1:=(C+L+H)/3;
  11. bb13:=atan(ema(x1,13)-ref(ema(x1,13),1))*3.1416*10;
  12. ema8:=ema(c,8);
  13. DRAWTEXT(filter(bb13>1 and ema(x1,13)>ref(ema(x1,8),1),10),
  14. ema8,'∠45上升'),colorwhite;
  15. 压力:MA(REF(HHV(C,30),1),2),Color9DFFFF;
  16. 支撑:MA(REF(LLV(C,30),1),2),ColorABFF46;
  17. AA1:=AMOUNT/V;
  18. BB1:=L<AA1*0.9;
  19. CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;
  20. DD1:=L<MA(C,5)*0.921;
  21. EE1:=V<MA(V,5)*1.5;
  22. FF1:=BB1 AND CC1 AND DD1 AND EE1;
  23. DRAWTEXT(ff1,(LOW* 0.99),'老鼠仓'),Color4080FF;
  24. A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
  25. 黑码线:=EMA(A51,5);
  26. A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
  27. 趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));
  28. DRAWTEXT(CROSS(趋势线,0)AND 黑码线<40,(HIGH* 0.97),'▲大黑码'),COLORYELLOW;
  29. LC:=REF(CLOSE,1);
  30. RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
  31. FF:=EMA(CLOSE,3);
  32. MA15:=EMA(CLOSE,21);
  33. DRAWTEXT(CROSS(FF,MA15),(LOW * 0.99),'底背离'),ColorA6E500;
  34. DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'顶背离'),Color1880FF;
  35. VAR2:=LLV(LOW,27);
  36. VAR3:=HHV(HIGH,34);
  37. VAR4:=EMA((CLOSE-Var2)/(Var3-Var2)*4,4)*25;
  38. 注意买:=IF((Var4<10),80,100);
  39. RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
  40. K:=SMA(RSV,3,1);
  41. D:=SMA(K,3,1);
  42. J:=3*K-2*D;
  43. 超跌:=IF(J<0,10,0);
  44. BDDD:=LLV(J,2)=LLV(J,8);
  45. 买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0);
  46. DRAWTEXT(买入 AND 注意买=100 AND 超跌=0,low,'短线'),Color8000FF;
  47. MTM:=C-REF(C,1);
  48. DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
  49. 买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
  50. DRAWTEXT(filter(买=1,5),LOW-0.03,'拉升'),ColorFFDE00;
  51. STICKLINE(CLOSE>OPEN,OPEN,LOW,0.5,0 ),COLOR0000FF;
  52. STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.5 ,0 ),COLOR0000FF;
  53. STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.5 ,0 ),COLOR00FF00;
  54. STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.5 ,0 ),COLOR00FF00;
  55. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLORff7700;
  56. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLORff9900;
  57. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLORffbb00;
  58. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLORffcc00;
  59. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLORffdd00;
  60. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLORffee00;
  61. STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLORffFF00;
  62. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLOR000055;
  63. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLOR000066;
  64. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLOR000077;
  65. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLOR000099;
  66. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLOR0000bb;
  67. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000dd;
  68. STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLOR0000ff;
  69. var9Q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3)) or ref(c,1)=hhv(c,4) and close>=ref(c,2) or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1) or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
  70.      stickline(var9Q,c,(o+c)/2,7,0),color000055;
  71.      stickline(var9Q,c,(o+c)/2,6,0),color000066;
  72.      stickline(var9Q,c,(o+c)/2,5,0),color000077;
  73.      stickline(var9Q,c,(o+c)/2,4,0),color000099;
  74.      stickline(var9Q,c,(o+c)/2,3,0),color0000bb;
  75.      stickline(var9Q,c,(o+c)/2,2,0),color0000dd;
  76.      stickline(var9Q,c,(o+c)/2,1,0),color0000ff;
  77. varaQ:=c=hhv(c,4) and ref(c,1)=llv(c,4);
  78.      stickline(varaQ,c,(o+c)/2,7,0),colorff11ff;
  79.      stickline(varaQ,c,(o+c)/2,6,0),colorff33ff;
  80.      stickline(varaQ,c,(o+c)/2,5,0),colorff55ff;
  81.      stickline(varaQ,c,(o+c)/2,4,0),colorff77ff;
  82.      stickline(varaQ,c,(o+c)/2,3,0),colorff99ff;
  83.      stickline(varaQ,c,(o+c)/2,2,0),colorffbbff;
  84.      stickline(varaQ,c,(o+c)/2,1,0),colorffddff;
  85. varbQ:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3)) or ref(c,1)=llv(c,4) and c<ref(c,2) or ref(c,2)=llv(c,4) and ref(c,1)<>hhv(c,4) and c<ref(c,1) or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
  86.      stickline(varbQ,c,(o+c)/2,7,0),color333333;
  87.      stickline(varbQ,c,(o+c)/2,6,0),color555555;
  88.      stickline(varbQ,c,(o+c)/2,5,0),color777777;
  89.      stickline(varbQ,c,(o+c)/2,4,0),color999999;
  90.      stickline(varbQ,c,(o+c)/2,3,0),colorbbbbbb;
  91.      stickline(varbQ,c,(o+c)/2,2,0),colordddddd;
  92.      stickline(varbQ,c,(o+c)/2,1,0),colorffffff;
  93. varcQ:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4) and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
  94.      stickline(varcQ,o,(o+c)/2,7,0),color003300;
  95.      stickline(varcQ,o,(o+c)/2,6,0),color005500;
  96.      stickline(varcQ,o,(o+c)/2,5,0),color007700;
  97.      stickline(varcQ,o,(o+c)/2,4,0),color009900;
  98.      stickline(varcQ,o,(o+c)/2,3,0),color00bb00;
  99.      stickline(varcQ,o,(o+c)/2,2,0),color00dd00;
  100.      stickline(varcQ,o,(o+c)/2,1,0),color00ff00;
  101. vardQ:=ref(c,1)=hhv(c,4) and c<ref(c,2) or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3) or ref(c,3)=hhv(c,4) and ref(c,1)>ref(c,2)) and ref(c,2)>=ref(c,4) and c<ref(c,1);
  102. stickline(vardQ,o,(o+c)/2,7,0),colorff1100;
  103. stickline(vardQ,o,(o+c)/2,6,0),colorff3300;
  104. stickline(vardQ,o,(o+c)/2,5,0),colorff5500;
  105. stickline(vardQ,o,(o+c)/2,4,0),colorff7700;
  106. stickline(vardQ,o,(o+c)/2,3,0),colorff9900;
  107. stickline(vardQ,o,(o+c)/2,2,0),colorffbb00;
  108. stickline(vardQ,o,(o+c)/2,1,0),colorffdd00;


  109. DRAWGBKLAST(CLOSE>0,  strip(RGB(1,70,100), RGB(1,30,10),2));
  110. {资金}
  111. TODAY:=DYNAINFO(7)=CLOSE and (ORDER(1)=0 and ORDER(2)=0);{判断是否有理想数据}
  112. {TODAY:="ddx.ddx"=0;}{判断是否有正版数据}
  113. Ddmr:=IF(TODAY,("DDEDATA@BIGORDER"(1,2)-"DDEDATA@BIGORDER"(2,2)),(bigorder(1,2)-bigorder(2,2)))*vol/capital*100;
  114. Ddmrs:=sum(Ddmr,0);
  115. Chb:=IF(TODAY,"DDEDATA@BIGORDER"(1,3),bigorder(1,3))*AMOUNT;
  116. Dhb:=IF(TODAY,("DDEDATA@BIGORDER"(1,2)-"DDEDATA@BIGORDER"(1,3)),(bigorder(1,2)-bigorder(1,3)))*AMOUNT;
  117. Zhb:=IF(TODAY,("DDEDATA@BIGORDER"(1,1)-"DDEDATA@BIGORDER"(1,2)),(bigorder(1,1)-bigorder(1,2)))*AMOUNT;
  118. Xhb:=IF(TODAY,(1-"DDEDATA@BIGORDER"(1,1)),(1-bigorder(1,1)))*AMOUNT;
  119. Chs:=IF(TODAY,"DDEDATA@BIGORDER"(2,3),bigorder(2,3))*AMOUNT;
  120. Dhs:=IF(TODAY,("DDEDATA@BIGORDER"(2,2)-"DDEDATA@BIGORDER"(2,3)),(bigorder(2,2)-bigorder(2,3)))*AMOUNT;
  121. Zhs:=IF(TODAY,("DDEDATA@BIGORDER"(2,1)-"DDEDATA@BIGORDER"(2,2)),(bigorder(2,1)-bigorder(2,2)))*AMOUNT;
  122. Xhs:=IF(TODAY,(1-"DDEDATA@BIGORDER"(2,1)),(1-bigorder(2,1)))*AMOUNT;
  123. 散资:=(xhb-xhs)/10000;
  124. 中资:=(zhb-zhs)/10000;
  125. 大资:=(dhb-dhs)/10000;
  126. 超资:=(chb-chs)/10000;
  127. 超资增仓:=超资;
  128. 大资增仓:=大资;
  129. 中资增仓:=中资;
  130. 散资增仓:=散资;
  131. BBD净额:=(超资+大资);
  132. DRAWTEXTREL(5,85,'BBD (万):'+NUMTOSTRN(BBD净额,0)),LINETHICK1,Color0080FF;
  133. DRAWTEXTREL(5,155,'超资(万):'+NUMTOSTRN(超资增仓,0)),LINETHICK1,COLORYELLOW;
  134. DRAWTEXTREL(5,225,'大资(万):'+NUMTOSTRN(大资增仓,0)),LINETHICK1,Color62FFFF;
  135. DRAWTEXTREL(5,295,'中资(万):'+NUMTOSTRN(中资增仓,0)),LINETHICK1,ColorACFFFF;
  136. DRAWTEXTREL(5,365,'散资(万):'+NUMTOSTRN(散资增仓,0)),LINETHICK1,ColorFFFFFF;

  137. DRAWRECTABS(0,118,270,0,1),COLOR00FF00;
  138. zln:=REF(IF(TODAY,IF(TODAY,"DDEDATA@BIGORDER"(1,2),SELFDATA('特大买入')+SELFDATA('大单买入')),bigorder(1,2)),0);
  139. zlm:=REF(IF(TODAY,IF(TODAY,"DDEDATA@BIGORDER"(2,2),SELFDATA('特大卖出')+SELFDATA('大单卖出')),bigorder(2,2)),0);
  140. tdn:=REF(IF(TODAY,IF(TODAY,"DDEDATA@BIGORDER"(1,3),SELFDATA('特大买入')),bigorder(1,3)),0);
  141. tdm:=REF(IF(TODAY,IF(TODAY,"DDEDATA@BIGORDER"(2,3),SELFDATA('特大卖出')),bigorder(2,3)),0);
  142. ddn:=REF(IF(TODAY,IF(TODAY,("DDEDATA@BIGORDER"(1,2)-"DDEDATA@BIGORDER"(1,3)),SELFDATA('大单买入')),(bigorder(1,2)-bigorder(1,3))),0);
  143. ddm:=REF(IF(TODAY,IF(TODAY,("DDEDATA@BIGORDER"(2,2)-"DDEDATA@BIGORDER"(2,3)),SELFDATA('大单卖出')),(bigorder(2,2)-bigorder(2,3))),0);
  144. zdn:=REF(IF(TODAY,IF(TODAY,("DDEDATA@BIGORDER"(1,1)-"DDEDATA@BIGORDER"(1,2)),SELFDATA('中单买入')),(bigorder(1,1)-bigorder(1,2))),0);
  145. zdm:=REF(IF(TODAY,IF(TODAY,("DDEDATA@BIGORDER"(2,1)-"DDEDATA@BIGORDER"(2,2)),SELFDATA('中单卖出')),(bigorder(2,1)-bigorder(2,2))),0);
  146. sdn:=REF(IF(TODAY,IF(TODAY,1-("DDEDATA@BIGORDER"(1,1)),1-(SELFDATA('特大买入')+SELFDATA('大单买入')+SELFDATA('中单买入'))),1-(bigorder(1,1))),0);
  147. sdm:=REF(IF(TODAY,IF(TODAY,1-("DDEDATA@BIGORDER"(2,1)),1-(SELFDATA('特大卖出')+SELFDATA('大单卖出')+SELFDATA('中单卖出'))),1-(bigorder(2,1))),0);
  148. tdj:=tdn-tdm;
  149. ddj:=ddn-ddm;
  150. zdj:=zdn-zdm;
  151. sdj:=sdn-sdm;
  152. zlj:=zln-zlm;
  153. DRAWTEXTREL(140,85,'占'+numtostrn(((zlj))*100,1)+'%'),Color0080FF;
  154. DRAWTEXTREL(140,155,'占'+numtostrn((tdj)*100,1)+'%'),COLORYELLOW;
  155. DRAWTEXTREL(140,225,'占'+numtostrn((ddj)*100,1)+'%'),Color62FFFF;
  156. DRAWTEXTREL(140,295,'占'+numtostrn((zdj)*100,1)+'%'),ColorACFFFF;
  157. DRAWTEXTREL(140,365,'占'+numtostrn((sdj)*100,1)+'%'),ColorFFFFFF;
  158. DRAWTEXTREL(200,85,numtostrn(((zlj))*V,0)+'手'),Color0080FF;
  159. DRAWTEXTREL(200,155,numtostrn((tdj)*V,0)+'手'),COLORYELLOW;
  160. DRAWTEXTREL(200,225,numtostrn((ddj)*V,0)+'手'),Color62FFFF;
  161. DRAWTEXTREL(200,295,numtostrn((zdj)*V,0)+'手'),ColorACFFFF;
  162. DRAWTEXTREL(200,365,numtostrn((sdj)*V,0)+'手'),ColorFFFFFF;
  163. DRAWTEXTREL(280,85,'仓 '+NUMTOSTRN(50+Sum((VOL/CAPITAL)*100*((zlj)),0),1)+'%'),Color0080FF;
  164. DRAWTEXTREL(280,155,'仓 '+NUMTOSTRN(25+Sum((VOL/CAPITAL)*100*(tdj),0),1)+'%'),COLORYELLOW;
  165. DRAWTEXTREL(280,225,'仓 '+NUMTOSTRN(25+Sum((VOL/CAPITAL)*100*(ddj),0),1)+'%'),Color62FFFF;
  166. DRAWTEXTREL(280,295,'仓 '+NUMTOSTRN(25+Sum((VOL/CAPITAL)*100*(zdj),0),1)+'%'),ColorACFFFF;
  167. DRAWTEXTREL(280,365,'仓 '+NUMTOSTRN(25+Sum((VOL/CAPITAL)*100*(sdj),0),1)+'%'),ColorFFFFFF;
复制代码

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

返回列表