<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[通达信公式怎么用：五步建一个，附四个常用公式]]></title><description><![CDATA[<p dir="auto">一直有人问通达信公式怎么弄。其实不复杂，建一次就会了。写几个我常用的，直接能粘。</p>
<p dir="auto"><img src="/assets/uploads/files/1795332927700-tdx-editor.png" alt="通达信公式编辑器示意：五步流程与代码框" class="img-markdown  img-fluid" width="1040" height="800" /></p>
<p dir="auto"><strong>怎么建（电脑版）</strong></p>
<p dir="auto"><code>Ctrl+F</code> 调出公式管理器 → 左侧选「技术指标公式」下的分类 → 右侧点「新建」→ 填名字、贴代码 → 点「测试公式」，通过了再确定。回到 K 线，键盘敲公式名首字母回车就能调出来。手机上没有测试和参数优化，建议在电脑建好再同步。</p>
<p dir="auto">两个坑先说在前头：符号全用英文（分号、括号、逗号），中文全角的一定报错；<code>:</code> 是画线，<code>:=</code> 是只赋值不画线，中间变量用后者。</p>
<p dir="auto"><strong>主图叠加和副图</strong>：均线、布林叠在 K 线上；MACD、KDJ 单独占一格。新建时「画线方法」那里选。</p>
<p dir="auto"><img src="/assets/uploads/files/1795332928324-tdx-chart.png" alt="主图叠加与副图的效果对照" class="img-markdown  img-fluid" width="1040" height="780" /></p>
<p dir="auto"><strong>一、均线（主图叠加）</strong></p>
<pre><code>MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:MA(CLOSE,20);
</code></pre>
<p dir="auto"><strong>二、MACD（副图）</strong></p>
<pre><code>DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
</code></pre>
<p dir="auto"><strong>三、KDJ（副图）</strong></p>
<pre><code>RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1);
D:SMA(K,3,1);
J:3*K-2*D;
</code></pre>
<p dir="auto"><strong>四、布林带（主图叠加）</strong></p>
<pre><code>MID:MA(CLOSE,20);
UPPER:MID+2*STD(CLOSE,20);
LOWER:MID-2*STD(CLOSE,20);
</code></pre>
<blockquote>
<p dir="auto">公式只是把规则写清楚，不会替你判断。测试通过只说明语法对，不代表信号管用——先对着历史 K 线看它怎么走，再谈用。</p>
</blockquote>
<p dir="auto">（配图为重绘示意，不是软件截图；对照图用的是真实日线数据。）</p>
]]></description><link>https://forum.klang.org.cn/topic/292/通达信公式怎么用-五步建一个-附四个常用公式</link><generator>RSS for Node</generator><lastBuildDate>Sun, 22 Nov 2026 21:10:55 GMT</lastBuildDate><atom:link href="https://forum.klang.org.cn/topic/292.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 22 Nov 2026 07:35:49 GMT</pubDate><ttl>60</ttl></channel></rss>