Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:均线融合

1楼
llq 发表于:2018/12/28 10:39:51
 老师们好,KD金叉,收盘价在30日均线之上开多,怎么编写  KD死叉,收盘价在30日均线下方怎么编写,收盘价跌破30均线平多,收盘价上涨突破30均线平空的公式怎么编写
2楼
FireScript 发表于:2018/12/28 11:09:46
 input:n(9,1,100,10),p1(3,2,40,4),p2(3,2,40,4);//参数设置

ma30:ma(c,30);
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,P1,1);
D:SMA(K,P2,1);
J:3*K-2*D;

kdjjc:cross(k,d);//kdj金叉
kdjsc:cross(d,k);//kdj死叉

if   kdjjc and c>ma30 then
begin
buy(holding=0,1,MARKET);//开多
end

if  kdjsc and c<ma30 then
begin
buyshort(holding=0,1,MARKET);//开空
end

if cross(c,ma30) and holding<0 then sellshort(1,holding,market);//平空
if cross(ma30,c) and holding>0 then sell(1,holding,market);//平多
共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.02344 s, 3 queries.