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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信海龟交易公式源码


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

以下是通达信海龟交易公式源码

UPQK:=LOW-REF(HIGH,1);
STICKLINE(CLOSE>REF(CLOSE,1) AND UPQK>0,REF(HIGH,1),LOW,15,1),COLORYELLOW;
DOWNQK:=REF(LOW,1)-HIGH;
STICKLINE(CLOSE<REF(CLOSE,1) AND DOWNQK>0,REF(LOW,1),HIGH,15,1),COLORGREEN;
MA10:MA(CLOSE,170),COLOR0000FF;
MA20:MA(CLOSE,350),COLORFF0080;
DRAWKLINE(H,O,L,C);
N:=20;T:=20;
M1:=MA(C,N);
HPB:=REF(HHV(H,N),1);
LPB:=REF(LLV(L,T),1);
{多头交易}
BUYIN:=H>HPB ;
BUYEXIT:=L<LPB;
SINGAL:=IF(BUYIN,1,IF(BUYEXIT,-1,0));
CURRSIGN:=REF(SINGAL,BARSLAST(SINGAL));
UPTREND:=CURRSIGN= 1;
DWTREND:=CURRSIGN=-1;
{跟踪止损}
空平:=IF(DWTREND,HPB,M1),LINETHICK5;
多止:=IF(UPTREND,LPB,M1),LINETHICK2;
信号持续:=IF(DWTREND,BARSLAST(UPTREND),BARSLAST(DWTREND)),LINETHICK5;
DRAWICON(BARSLAST(DWTREND)=1,多止,4);
DRAWICON(BARSLAST(UPTREND)=1,空平,5);
{DRAWGBKLAST(CLOSE>0,STRIP(RGB(95,95,95),RGB(0,0,0),0))}
VAR1:=AMOUNT/VOL/100;
指导: EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA
(CLOSE,24))/4,2),COLORWHITE;
界: MA(CLOSE,27),COLORYELLOW;
红轨道:MA(MA(CLOSE,3),1),LINETHICK1,COLOR0000FF;
绿轨道:MA(MA(CLOSE,3),3),LINETHICK1,COLOR00FF00;
{波动}
TRTR:= MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR := MA(TRTR,10);
STICKLINE((TRTR>ATR*1.5) AND (C <O),O,C,4,0),COLOR00FF00;
STICKLINE((TRTR>ATR*1.5) AND (C >O),O,C,4,0),COLORMAGENTA;




回复

举报

QQ|

GMT+8, 2024-11-17 15:31

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