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

[同花顺指标] 同花顺区间三分割主图指标公式

[同花顺指标] 同花顺区间三分割主图指标公式

  1.   起点:=60;终点:=10;切换:=5;

  2.   DRAWGBKLAST(1,STRIP(RGB(30,80,220),RGB(130,80,180),1));

  3.   nx:=CURRBARSCOUNT+1;

  4.   wz:=CURRBARSCOUNT+1=1;

  5.   wx:=CURRBARSCOUNT+1=起点;

  6.   wt:=BARSLAST(wx);

  7.   wxz:=IF(wt>=0,1,DRAWNULL);

  8.   QH:=IF(nx>=终点 AND nx<=起点,H,DRAWNULL);

  9.   QL:=IF(nx>=终点 AND nx<=起点,L,DRAWNULL);

  10.   XZ:=IF(nx>=终点,1,DRAWNULL);

  11.   //分割计算

  12.   ZH:=HHV(QH,0);

  13.   ZL:=LLV(QL,0);

  14.   HXT:=(ZH-ZL);

  15.   J1:=ZH-HXT*0.241;

  16.   J2:=ZH-HXT*0.382;

  17.   J3:=ZH-HXT*0.613;

  18.   J4:=ZH-HXT*0.786;

  19.   JXT:=(ZH-ZL)/8;

  20.   H1:=ZH-JXT*1;

  21.   H2:=ZH-JXT*2;

  22.   H3:=ZH-JXT*3;

  23.   H4:=ZH-JXT*5;

  24.   H5:=ZH-JXT*6;

  25.   H6:=ZH-JXT*7;

  26.   BXT:=(ZH-ZL)/10;

  27.   B1:=ZH-BXT*1;

  28.   B2:=ZH-BXT*2;

  29.   B3:=ZH-BXT*3;

  30.   B4:=ZH-BXT*4;

  31.   B5:=ZH-BXT*6;

  32.   B6:=ZH-BXT*7;

  33.   B7:=ZH-BXT*8;

  34.   B8:=ZH-BXT*9;

  35.   //股票k线

  36.   STICKLINE(OPEN,CLOSE ,OPEN,9,0 ),COLOR000000;

  37.   STICKLINE(OPEN>CLOSE ,CLOSE ,OPEN,8,0 ),COLOR007700;

  38.   STICKLINE(OPEN>CLOSE ,CLOSE ,OPEN,7,0 ),COLOR009900;

  39.   STICKLINE(OPEN>CLOSE ,CLOSE ,OPEN,5,0 ),COLOR00bb00;

  40.   STICKLINE(OPEN>CLOSE ,CLOSE ,OPEN,3,0 ),COLOR00dd00;

  41.   STICKLINE(OPEN>CLOSE ,HIGH,LOW,1.5 ,0 ),COLOR00ff00;

  42.   STICKLINE(CLOSE>=OPEN ,CLOSE,OPEN,8,0) ,COLOR000077;

  43.   STICKLINE(CLOSE>=OPEN ,CLOSE,OPEN,7,0) ,COLOR000099;

  44.   STICKLINE(CLOSE>=OPEN ,CLOSE,OPEN,5,0) ,COLOR0000bb;

  45.   STICKLINE(CLOSE>=OPEN ,CLOSE,OPEN,3,0) ,COLOR0000dd;

  46.   STICKLINE(CLOSE>=OPEN ,HIGH,LOW,1.5,0 ),COLOR0000FF;

  47.   STICKLINE(HIGH=LOW AND CLOSE>REF(CLOSE,1),HIGH-0.01,HIGH+0.01,8,0 ),COLOR0000FF;

  48.   STICKLINE(HIGH=LOW AND CLOSE<REF(CLOSE,1),HIGH-0.01,HIGH+0.01,8,0 ),COLOR00FF00;

  49.   //分割显示

  50.   IF 切换>=1 AND 切换<=3 THEN BEGIN

  51.   VERLINE(nx=终点 OR nx=起点,2),COLOR009fff;

  52.   x1:=IF(切换=1,J1,IF(切换=2,H1,IF(切换=3,B1,DRAWNULL)));

  53.   x2:=IF(切换=1,J2,IF(切换=2,H2,IF(切换=3,B2,DRAWNULL)));

  54.   x3:=IF(切换=1,J3,IF(切换=2,H3,IF(切换=3,B3,DRAWNULL)));

  55.   x4:=IF(切换=1,J4,IF(切换=2,H4,IF(切换=3,B4,DRAWNULL)));

  56.   高:BACKSET(IF(wz,ZH,DRAWNULL),起点-1)*wxz,COLORff88ff,LINETHICK2;

  57.   低:BACKSET(IF(wz,ZL,DRAWNULL),起点-1)*wxz,COLORff88ff,LINETHICK2;

  58.   中:BACKSET(IF(wz,(ZH+ZL)/2,DRAWNULL),起点-1)*wxz,COLORff88ff;

  59.   分1:BACKSET(IF(wz,X1,DRAWNULL),起点-1)*wxz,COLORffff00;

  60.   分2:BACKSET(IF(wz,X2,DRAWNULL),起点-1)*wxz,COLORffff00;

  61.   分3:BACKSET(IF(wz,X3,DRAWNULL),起点-1)*wxz,COLORffff00;

  62.   分4:BACKSET(IF(wz,X4,DRAWNULL),起点-1)*wxz,COLORffff00;

  63.   END;

  64.   IF 切换=2 OR 切换=3 THEN BEGIN

  65.   x5:=IF(切换=2,H5,B5);

  66.   x6:=IF(切换=2,H6,B6);

  67.   分5:BACKSET(IF(wz,X5,DRAWNULL),起点-1)*wxz,COLORffff00;

  68.   分6:BACKSET(IF(wz,X6,DRAWNULL),起点-1)*wxz,COLORffff00;

  69.   END;

  70.   IF 切换=3 THEN BEGIN

  71.   x7:=B7;

  72.   x8:=B8;

  73.   分7:BACKSET(IF(wz,X7,NULL),起点-1)*wxz,COLORffff00;

  74.   分8:BACKSET(IF(wz,X8,NULL),起点-1)*wxz,COLORffff00;

  75.   END;

  76.   //分割提示

  77.   DRAWTEXT(wz,高,‘`’+TOSTRING(高,2)+‘(高)’),COLORff88ff;

  78.   DRAWTEXT(wz,低,‘`’+TOSTRING(低,2)+‘(低)’),COLORff88ff;

  79.   DRAWTEXT(wz,中,‘`’+TOSTRING(中,2)+‘(中)’),COLORff88ff;

  80.   DRAWTEXT(wz,分1,‘`’+TOSTRING(分1,2)+‘(分1)’),COLORffffff;

  81.   DRAWTEXT(wz,分2,‘`’+TOSTRING(分2,2)+‘(分2)’),COLORffffff;

  82.   DRAWTEXT(wz,分3,‘`’+TOSTRING(分3,2)+‘(分3)’),COLORffffff;

  83.   DRAWTEXT(wz,分4,‘`’+TOSTRING(分4,2)+‘(分4)’),COLORffffff;

  84.   DRAWTEXT(wz,分5,‘`’+TOSTRING(分5,2)+‘(分5)’),COLORffffff;

  85.   DRAWTEXT(wz,分6,‘`’+TOSTRING(分6,2)+‘(分6)’),COLORffffff;

  86.   DRAWTEXT(wz,分7,‘`’+TOSTRING(分7,2)+‘(分7)’),COLORffffff;

  87.   DRAWTEXT(wz,分8,‘`’+TOSTRING(分8,2)+‘(分8)’),COLORffffff;

  88.   IF 切换=4 THEN BEGIN

  89.   AA5:MA(C,5),colorffffff;

  90.   AA10:MA(C,10),color00ffff;

  91.   AA20:MA(C,20),color009fff;

  92.   AA30:MA(C,30),colorffff00;

  93.   AA60:MA(C,60),color0000ff;

  94.   AA120:MA(C,120),color00ff00;

  95.   AA250:MA(C,250),colorff00ff;

  96.   zdx:=MAX(AA5,AA10,AA20,AA30,AA60,AA120,AA250);

  97.   ZXx:=MIN(AA5,AA10,AA20,AA30,AA60,AA120,AA250);

  98.   nhd:=(zdx/ZXx-1)*100;

  99.   中位线:=(AA5+AA10+AA20+AA30+AA60+AA120+AA250)/7;

  100.   PARTLINE(中位线,1,RGB(255,100,255),1,RGB(255,100,255)),LINETHICK2;

  101.   DRAWTEXT(CURRBARSCOUNT+1=1,中位线,‘``中位线:’+TOSTRING(中位线,2)+‘`\n``粘合度:’+TOSTRING(nhd,2)+‘%’),colorff88ff;

  102.   END;

  103.   IF 切换=5 THEN BEGIN

  104.   BOLL:MA(CLOSE,20),COLORcccccc;//曲线属性--输出线性--不输出

  105.   PARTLINE(BOLL,BOLL>BOLL[1],RGB(255,0,0),BOLL<=BOLL[1],RGB(0,255,255));

  106.   UB:BOLL+2*STD(CLOSE,20),COLORff88ff;

  107.   LB:BOLL-2*STD(CLOSE,20),COLOR00FFff;

  108.   DRAWTEXT(CURRBARSCOUNT+1=1,BOLL,‘``中轨值:’+TOSTRING(BOLL,2)+‘`\n``上下轨比:’+TOSTRING((UB/LB-1)*100,2)+‘%’),colorff88ff;

  109.   END;

  110.   DRAWTEXT_FIX(CURRBARSCOUNT=1,1/100,0,0,‘股旁网【分割图】 当前是’+IF(切换=1,‘[黄金分割]’,IF(切换=2,‘[江恩分割]’,

  111.   IF(切换=3,‘[百分比]’,IF(切换=4,‘[平均线]’,‘布林线’))))),color00ffff;
复制代码

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

返回列表