股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信实用小公式——仓位管控源码


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-9 11:03:59

以下是通达信实用小公式——仓位管控源码

{仓位管控}

M10:MA(C,10),COLORGREEN;
M30:MA(C,30),COLORYELLOW;

X:=CURRBARSCOUNT=1;
X1:DRAWTEXT(C>M10 AND C>M30 AND M10>M30 AND X,M30*0.98,'仓位:80%'),COLORWHITE;
X2:DRAWTEXT(C<M10 AND C>M30 AND M10>M30 AND X,M30*0.98,'仓位:50%'),COLORWHITE;
X3:DRAWTEXT(C<M10 AND C<M30 AND M10>M30 AND X,M30*0.98,'仓位:20%'),COLORWHITE;

X4:DRAWTEXT(C>M10 AND C>M30 AND M10<M30 AND X,M10*0.98,'仓位:50%'),COLORWHITE;
X5:DRAWTEXT(C>M10 AND C<M30 AND M10<M30 AND X,M10*0.98,'仓位:20%'),COLORWHITE;
X6:DRAWTEXT(C<M10 AND C<M30 AND M10<M30 AND X,M10*0.98,'仓位:空仓'),COLORWHITE;

XA:DRAWTEXT_FIX(1,0,0.88,0,'1、实际仓位高于80%、说明头脑发热;'),COLORWHITE,LINETHICK1;
XB:DRAWTEXT_FIX(1,0,1,0,'2、活下来最重要、能吃到鱼身已很好了;'),COLORYELLOW,LINETHICK1;

ZT:=C>=ZTPRICE(REF(CLOSE#DAY,1),0.1);
DT:=C<=DTPRICE(REF(CLOSE#DAY,1),0.1);

BA:STICKLINE(ZT,(H+L)/2,CLOSE,0,0),COLORYELLOW;
BC:STICKLINE(DT,(H+L)/2,CLOSE,0,0),COLORBLUE;

DA:=YEAR AND MONTH AND DAY;
AXA:=STRCAT(CON2STR(YEAR,0),'年');
AAB:=STRCAT(CON2STR(MONTH,0),'月');
AA33:=STRCAT(CON2STR(DAY,0),'日');
AA4:=STRCAT('【',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,
'四',IF(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));
AA1:=STRCAT(STRCAT(STRCAT(AXA,AAB),STRCAT(AA33,AA4)),'】');
S1:DRAWTEXT_FIX(DA,0.7,1,0,AA1),COLORFFAAFF;






回复

举报

QQ|

GMT+8, 2024-11-17 22:24

快速回复 返回顶部 返回列表