Rss & SiteMap

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

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

标题:老师帮写下程序

1楼
huanglei2011 发表于:2016/11/8 15:29:48
1.定义三条均线;
5日均线
10日均线
20日均线

2.求5日均线、10日均线、20日均线三者的最大值与最小值

3.当价格大于3条均线的最大值,平空做多;
  当价格小于3条均线的最大值,平多做空;

4.当根K线跌幅超过2%,(当根K线收盘价与上一K线收盘价的比值)平多;
  当根K线涨幅超过2%,(当根K线收盘价与上一K线收盘价的比值)平空;
2楼
jinzhe 发表于:2016/11/8 15:57:58

ma1:=ma(c,5);
ma2:=ma(c,10);
ma3:=ma(c,20);
h3:=max(ma1,max(ma2,ma3));
l3:=min(ma1,min(ma2,ma3));
if close<h3 then begin
 sellshort(1,0,thisclose);
 buy(holding=0,1,thisclose);
end

if close>h3 then begin
 sell(1,0,thisclose);
 buyshort(holding=0,1,thisclose);
end

if (c-ref(c,1))/ref(c,1)<=-0.02 then sell(1,0,thisclose);
if (c-ref(c,1))/ref(c,1)>=0.02 then sellshort(1,0,thisclose);

共2 条记录, 每页显示 10 条, 页签: [1]


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