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

大智慧停损指标 永不套牢的停损[大智慧公式]

大智慧停损指标 永不套牢的停损[大智慧公式]

  1. B1:=MA(C,1);
  2. B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1) ;
  3. SMA2:=MA(B2,3) ;
  4. 停损下限:IF(LLV(MA(B2,7),3)<B2,LLV(MA(B2,7),3),B2) ;
  5. FILLRGN(b2,sMA2,b2>sMA2,RGB(255,255,0),b2<SMA2,RGB(0,255,0));
  6. snakeA:HHV(MA(B2,1),13),ColoryelLOW;
  7. Var1:=(2*CLOSE+HIGH+LOW)/4;
  8. Var2:=MA(Var1,7);
  9. Var3:=Var2-MA(Var1,7/2)<0;
  10. Var4:=Var2-MA(Var1,7/2)>0;
  11. Var5:=BARSLAST(Var3);
  12. Var6:=0-BARSLAST(Var4);
  13. Var7:=IF(Var3<=0,Var5,Var6);
  14. STICKLINE(snakea>b2 AND b2>SMA2,snakea,b2,1,1),colorwhite;
  15. STICKLINE(snakea>SMA2 AND b2<SMA2,SNAKEA,SMA2,1,1),COLORWHITE;
  16. Var11:=(CLOSE*2+HIGH+LOW)/4;
  17. Var21:=EMA(Var11,13)-EMA(Var11,34);
  18. Var31:=EMA(Var21,5);
  19. STICKLINE((C>=O),OPEN,LOW,1,0),color0726CA;
  20. STICKLINE((C>=O),CLOSE,HIGH,1,0),color0726CA;
  21. STICKLINE((C<O),CLOSE,LOW,1,0),COLORDE9100;
  22. STICKLINE((C<O),OPEN,HIGH,1,0),COLORDE9100;
  23. STICKLINE((C<O),CLOSE,OPEN,8,0),COLORFF5B00;
  24. STICKLINE((C<O),CLOSE,OPEN,10,0),COLOR000000;
  25. STICKLINE((C<O),CLOSE,OPEN,7,0),COLORFF6C00;
  26. STICKLINE((C<O),CLOSE,OPEN,6,0),COLORFF7B00;
  27. STICKLINE((C<O),CLOSE,OPEN,5,0),COLORFF9C00;
  28. STICKLINE((C<O),CLOSE,OPEN,4,0),COLORFFBE00;
  29. STICKLINE((C<O),CLOSE,OPEN,2.5,0),COLORFFCC00;
  30. STICKLINE((C<O),CLOSE,OPEN,1.5,0),COLORFFFF00;
  31. STICKLINE((C>O),CLOSE,OPEN,8,0),color070084;
  32. STICKLINE((C>O),CLOSE,OPEN,10,0),color000000;
  33. STICKLINE((C>O),CLOSE,OPEN,7,0),color0000A3;
  34. STICKLINE((C>O),CLOSE,OPEN,6,0),color0000B7;
  35. STICKLINE((C>O),CLOSE,OPEN,5,0),color0000CD;
  36. STICKLINE((C>O),CLOSE,OPEN,4,0),color0000E9;
  37. STICKLINE((C>O),CLOSE,OPEN,2,0),color0754E9;
  38. STICKLINE((C>O),CLOSE,OPEN,1.5,0),color076EF3;
  39. STICKLINE((C>O),CLOSE,OPEN,1,0),color077BF3;
  40. VAR2:=((CLOSE > ref(CLOSE,1)) AND (CLOSE > ref(CLOSE,2))) ;
  41. VAR3:=((ref(VAR2,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  42. VAR4:=((ref(VAR3,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  43. VAR5:=((ref(VAR4,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  44. VAR6:=((ref(VAR5,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  45. VAR7:=((ref(VAR6,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  46. VAR8:=((ref(VAR7,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  47. VAR9:=((ref(VAR8,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  48. VARA:=((ref(VAR9,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  49. VARB:=((ref(VARA,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  50. VARC:=((ref(VARB,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  51. VARD:=((ref(VARC,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  52. VARE:=((CLOSE < ref(CLOSE,1)) AND (CLOSE < ref(CLOSE,2)));
  53. VARF:=((ref(VARE,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  54. VAR10:=((ref(VARF,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  55. VAR11:=((ref(VAR10,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  56. VAR12:=((ref(VAR11,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  57. VAR13:=((ref(VAR12,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  58. VAR14:=((ref(VAR13,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  59. VAR15:=((ref(VAR14,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  60. VAR16:=((ref(VAR15,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  61. VAR17:=((ref(VAR16,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  62. VAR18:=((ref(VAR17,1) AND (CLOSE <= ref(CLOSE,1))) AND (CLOSE >= ref(CLOSE,2)));
  63. VAR19:=((ref(VAR18,1) AND (CLOSE >= ref(CLOSE,1))) AND (CLOSE <= ref(CLOSE,2)));
  64. VAR1A:=(ref((((((((((((VARE OR VARF) OR VAR10) OR VAR11) OR VAR12) OR VAR13) OR VAR14) OR VAR15) OR VAR16) OR VAR17) OR VAR18) OR VAR19),1) AND VAR2);
  65. STICKLINE(var1a,O,O+(C-O)/3,8,0),color0000ff;
  66. STICKLINE(var1a,O,O+(C-O)/3,7,0),color1029ff;
  67. STICKLINE(var1a,O,O+(C-O)/3,6,0),color1040ff;
  68. STICKLINE(var1a,O,O+(C-O)/3,5,0),color1083ff;
  69. STICKLINE(var1a,O,O+(C-O)/3,4,0),color10abff;
  70. STICKLINE(var1a,O,O+(C-O)/3,3,0),color10d0ff;
  71. STICKLINE(var1a,O,O+(C-O)/3,2,0),color10ffff;
  72. STICKLINE(var1a,O,O+(C-O)/3,1,0),color00ffff;
  73. AA:=(ref((((((((((((VAR2 OR VAR3) OR VAR4) OR VAR5) OR VAR6) OR VAR7) OR VAR8) OR VAR9) OR VARA) OR VARB) OR VARC) OR VARD),1) AND VARE);

  74. STICKLINE(aa,O,O+(C-O)/3,8,0),color008800;
  75. STICKLINE(aa,O,O+(C-O)/3,7,0),color009900;
  76. STICKLINE(aa,O,O+(C-O)/3,6,0),color00aa00;
  77. STICKLINE(aa,O,O+(C-O)/3,5,0),color00bb00;
  78. STICKLINE(aa,O,O+(C-O)/3,4,0),color00cc00;
  79. STICKLINE(aa,O,O+(C-O)/3,3,0),color00dd00;
  80. STICKLINE(aa,O,O+(C-O)/3,2,0),color00ee00;
  81. STICKLINE(aa,O,O+(C-O)/3,1,0),color00ff00;

  82. a13:=EMA(CLOSE,55);
  83. a14:=MA(CLOSE,75);
  84. a15:=EMA(a14,3);
  85. a16:=EMA(a15,3);
  86. a17:=(HIGH + LOW) / 5;
  87. a18:=(MA(a17,4)) - (MA(a17,34));
  88. a19:=CROSS(a18,0);
  89. a20:=CROSS(0,a18);
  90. a21:=BARSLAST(a19);
  91. a22:=BARSLAST(a20);
  92. a23:=ref(a19,1);
  93. a24:=ref(a20,1);
  94. a25:=BARSLAST(a23);
  95. a26:=BARSLAST(a24);
  96. a27:=IF((a25 < a26),(ref((HHV(HIGH,2)),a25)),(ref((LLV(LOW,2)),a26)));
  97. a28:=(((ref(CLOSE,1)) <= (ref(a27,1))) AND (CLOSE > a27)) AND (a21 < a22);
  98. a29:=(((ref(CLOSE,1)) >= (ref(a27,1))) AND (CLOSE < a27)) AND (a22 < a21);
  99. a30:=a28 AND ((COUNT(a28,a21)) = 1);
  100. a31:=a29 AND ((COUNT(a29,a22)) = 1);
  101. a32:=a30 AND ((ref(BARSLAST(a31),1)) < (ref(BARSLAST(a30),1))) ;
  102. a33:=a31 AND ((ref(BARSLAST(a31),1)) > (ref(BARSLAST(a30),1)));
  103. DRAWTEXT(a32,SMA2*0.99,'←═╬∝'),coloryelLOW;
  104. ac:=amount/(VOL);
  105. yy:=MA(ac,13);
  106. lll:=(C-yy)/yy*100;
  107. MIDc := MA(CLOSE,22);
  108. UPPERc:= MIDc + 2*STD(C,22);
  109. LOWERc:= MIDc - 2*STD(C,22);
  110. bba:=(C-LOWerc)/(upperc-LOWerc);
  111. bbc:=FORCAST(bba,3);
  112. LIFENGcyc:=(ref(lll,1)<-15 AND ref(bba,1)<0 AND lll>ref(lll,1)) ;
  113. STICKLINE(lifengcyc>0,C,O,8,0),colorred;
  114. STICKLINE(lifengcyc>0,C,O,7,0),color1029FF;
  115. STICKLINE(lifengcyc>0,C,O,6,0),color1040FF;
  116. STICKLINE(lifengcyc>0,C,O,4,0),color1083FF;
  117. STICKLINE(lifengcyc>0,C,O,2,0),color10ABFF;
  118. STICKLINE(lifengcyc>0,C,O,1.5,0),color10D0FF;
  119. STICKLINE(lifengcyc>0,C,O,1,0),color10FFFF;
  120. DRAWTEXT(LIFENGcyc>0,LOW*0.99,'☆'),colordd00dd;
复制代码

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

返回列表