公式网-网站导航


网站搜索:  

股票公式指标网 发表于2010/3/18 7:18:56

老鼠出洞(主图)

 

C/C++ www.gszb.com 股票公式指标网提供 Code复制内容到剪贴板
  1. input: n(4,1,255),m(13,1,255);   
  2.   
  3. aa:=ref(h,n)=hhv(h,2*n+1);   
  4. aaa:=filter(aa,n);   
  5. bb:=backset(aaa,n+1);   
  6. cc1:=filter(bb,n);   
  7. cc:=cc1 or BARSTATUS=2;   
  8. aa2:=ref(l,n)=llv(l,2*n+1);   
  9. aaa2:=filter(aa2,n);   
  10. bb2:=backset(aaa2,n+1);   
  11. cc22:=filter(bb2,n);   
  12. cc2:=cc22 and not(cc1);   
  13. ea:=backset(cc,ref(barslast(cc2),1)+1);   
  14. eb:=ea>ref(ea,1);   
  15. ee:=backset(eb,2);   
  16. ff1:=ee>ref(ee,1);   
  17. ee2:=backset(ff1 and count(cc,ref(barslast(cc2),1)+2)=0,ref(barslast(cc2),1)+2);   
  18. ff2:=ee2>ref(ee2,1);   
  19. ee3:=backset(ff2 and count(cc,ref(barslast(cc2),1)+2)=0,ref(barslast(cc2),1)+2);   
  20. ff3:=ee3>ref(ee3,1);   
  21. js:=if(cc,count(cc2,ref(barslast(cc),1)+1),0);   
  22. g1:=if(js=1 and cc,barslast(ff1),0);   
  23. ga:=if(cc and ref(l,barslast(ff1))>=ref(l,barslast(ff2)),barslast(ff2),barslast(ff1));   
  24. g2:=if(js=2 and cc,ga,0);   
  25. g3:=if(js>=3 and cc,if(cc and ref(l,ga)>=ref(l,barslast(ff3)),barslast(ff3),ga),0);   
  26. gg:=g1+g2+g3;   
  27. ja:=backset(cc,gg);   
  28. jb:=ja>ref(ja,1);   
  29. jj:=backset(jb,2);   
  30. ld:=jj>ref(jj,1);   
  31. ld1:=ld or BARSTATUS=2;   
  32. hea:=backset(ld1,ref(barslast(cc),1)+1);   
  33. heb:=hea>ref(hea,1);   
  34. hee:=backset(heb,2);   
  35. hff1:=hee>ref(hee,1);   
  36. hee2:=backset(hff1 and count(ld1,ref(barslast(cc),1)+2)=0,ref(barslast(cc),1)+2);   
  37. hff2:=hee2>ref(hee2,1);   
  38. hee3:=backset(hff2 and count(ld1,ref(barslast(cc),1)+2)=0,ref(barslast(cc),1)+2);   
  39. hff3:=hee3>ref(hee3,1);   
  40. hjs:=if(ld1,count(cc1,ref(barslast(ld1),1)+1),0);   
  41. hg1:=if(hjs=1 and ld1,barslast(hff1),0);   
  42. hga:=if(ld1 and ref(h,barslast(hff1))<=ref(h,barslast(hff2)),barslast(hff2),barslast(hff1));   
  43. hg2:=if(hjs=2 and ld1,hga,0);   
  44. hg3:=if(hjs>=3 and ld1,if(ld1 and ref(h,hga)<=ref(h,barslast(hff3)),barslast(hff3),hga),0);   
  45. hgg:=hg1+hg2+hg3;   
  46. hja:=backset(ld1,hgg);   
  47. hjb:=hja>ref(hja,1);   
  48. hjj:=backset(hjb,2);   
  49. hd:=hjj>ref(hjj,1);   
  50. x1:=backset(BARSTATUS=2,barslast(ld)+1);   
  51. x2:=x1>ref(x1,1);   
  52. y1:=backset(BARSTATUS=2,barslast(hd)+1);   
  53. y2:=y1>ref(y1,1);   
  54. z1:=if(barslast(x2)<barslast(y2),x2,y2);   
  55. z2:=if(barslast(x2)<barslast(y2),l,h);   
  56. drawline(z1,z2,BARSTATUS=2,c,0),pointdot,colorff9900;   
  57. uu:=backset(BARSTATUS=2,barslast(ld)+1);   
  58. vv:=uu>ref(uu,1);   
  59. ww:=backset(vv,ref(barslast(ld),1)+2);   
  60. xx:=ww>ref(ww,1);   
  61. drawline(xx,l,vv,l,1),color00ffff;   
  62. uu2:=backset(BARSTATUS=2,barslast(hd)+1);   
  63. vv2:=uu2>ref(uu2,1);   
  64. ww2:=backset(vv2,ref(barslast(hd),1)+2);   
  65. xx2:=ww2>ref(ww2,1);   
  66. drawline(xx2,h,vv2,h,1),color00ffff;   
  67. drawicon(hd and xx2,h*1.01,10),ALIGN1;   
  68. drawicon(ld and xx,l*1.01,9),ALIGN1;   
  69. 高1:ref(h,barslast(vv2)),pointdot,color99ff66;   
  70. 高2:ref(h,barslast(xx2)),pointdot,colorff66ff;   
  71. 低1:ref(l,barslast(vv)),pointdot,color99ff66;   
  72. 低2:ref(l,barslast(xx)),pointdot,colorff66ff;   
  73. ok:=ema(o,60);   
  74. cg:=ema(c,60);   
  75. pdu:=if(ok>ref(ok,1) and cg>ref(cg,1),1,0);   
  76. pdd:=if(ok<ref(ok,1) and cg<ref(cg,1),1,0);   
  77. pdm:=if(pdu=0 and pdu=0,1,0);   
  78. z1:=ma(c,m);   
  79. zx:=ref(z1,m/2+1);   
  80. 顶选:cross(c,zx),LINETHICK0;   
  81. life:=(ema(c,60)+ema(c,90))/2;   
  82. var1:=(2*c+h+l)/4;   
  83. snook:=ema(var1,99)*0.91;   
  84. a1:=(c-ref(c,1))/ref(c,1)*100;   
  85. ma5:=barslast(a1>3);   
  86. ma20:=if(ma5>0,1,0);   
  87.   
  88. drawicon(cross(c,zx),l*0.99,4),ALIGN1;   
  89. drawicon(cross(zx,c),h*1.01,5),ALIGN1;   
  90. by20:=ma(c,5);   
  91. k1:=llv(l,barslast(DISPSTATUS=1)+1);   
  92. k2:=hhv(h,barslast(DISPSTATUS=1)+1);   
  93. 招财猫:ma(c,20),color00ffff;   
  94. 鼠变异:if(by20>招财猫,招财猫,by20),color808080;   
  95. 选股:cross(c,zx) and c>zx and ma20=0 ,LINETHICK0;   
  96. partline(鼠变异,鼠变异>ref(鼠变异,1) and 鼠变异=招财猫),Linethick2,colorff66ff;   
  97. partline(鼠变异,鼠变异>ref(鼠变异,1) and 鼠变异=招财猫 and pdu=1),Linethick2,color0000ff;   
  98. partline(鼠变异,鼠变异>ref(鼠变异,1) and 鼠变异<>招财猫),color00ff00;   
  99. t1:=c>zx and c>=life;   
  100. t2:=c>zx and c>snook and c<life;   
  101. t3:=c>zx and c<=snook;   
  102. t4:=c<=zx;   
  103. t5:=鼠变异>ref(鼠变异,1) and 鼠变异<>招财猫 ;   
  104. t6:=鼠变异>ref(鼠变异,1) and 鼠变异=招财猫 and pdu<>1;   
  105. t7:=鼠变异>ref(鼠变异,1) and 鼠变异=招财猫 and pdu=1;   
  106. t8:=c>zx and ma20=0 ;   
  107. eee:=t1+t2+t3+t4+t5+t6+t7+t8 ;   
  108. e:=(k2-k1)/(eee+4) ;   
  109. DRAWTEXT(C>0 and t1>0 and BARSTATUS=2,k2-e,'老鼠出洞了,'),color0000ff;   
  110. DRAWTEXT(C>0 and t1>0 and BARSTATUS=2,k2-e*2,'逮住它!'),color0000ff;   
  111. DRAWTEXT(C>0 and t2>0 and BARSTATUS=2,k2-e,'老鼠玩猫猫,'),colorff7700;   
  112. DRAWTEXT(C>0 and t2>0 and BARSTATUS=2,k2-e*2,'守着它!'),colorff7700;   
  113. DRAWTEXT(C>0 and t3>0 and BARSTATUS=2,k2-e,'老鼠露尾巴,'),color00ff00;   
  114. DRAWTEXT(C>0 and t3>0 and BARSTATUS=2,k2-e*2,'动作快!'),color00ff00;   
  115. DRAWTEXT(C>0 and t4>0 and BARSTATUS=2,k2-e,'老鼠没有了,'),color808080;   
  116. DRAWTEXT(C>0 and t4>0 and BARSTATUS=2,k2-e*2,'打个盹!'),color808080;   
  117. DRAWTEXT(C>0 and t5>0 and BARSTATUS=2,k2-e*3,'发现鼠迹!'),color00ff00;   
  118. DRAWTEXT(C>0 and t6>0 and BARSTATUS=2,k2-e*3,'瞬间鼠影!'),colorff66ff;   
  119. DRAWTEXT(C>0 and t7>0 and BARSTATUS=2,k2-e*3,'恶鼠难遁!'),color0000ff;   
  120. DRAWTEXT(C>0 and t8>0 and BARSTATUS=2,k2-e*4,'老鼠去哪里,'),color00ffff;   
  121. DRAWTEXT(C>0 and t8>0 and BARSTATUS=2,k2-e*5,'思考哦!'),color00ffff;   

 002127.gif



网站搜索:  



Copyright © 2009-2010 gszb.com ™,All Rights Reserved. 
公式网-www.gszx.com.cn-股票指标公式网