以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请帮忙写个策略  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=66946)

--  作者:gsqh_zyp
--  发布时间:2014/7/4 11:23:28
--  请帮忙写个策略
1.日内交易1分钟周期
2.开多:均线ma5当天具有上穿LOWER,也有上穿UPPER时开多,不是同时上穿,而是先后上穿支撑位LOWER和阻力位UPPER
3.开空:均线ma5当天具有下穿UPPER,也有下穿LOWER时开空。
4.平仓:收盘前平仓
5.止损:波动10个点止损。

--  作者:jinzhe
--  发布时间:2014/7/4 13:14:03
--  

已经安排处理


--  作者:gsqh_zyp
--  发布时间:2014/7/4 13:53:16
--  
哦,要多久哈?还没好吗
--  作者:qq代人发帖
--  发布时间:2014/7/4 14:08:02
--  


MID:  MA(CLOSE,M);//布林中轨
UPPER: MID + K*STD(CLOSE,M);//布林上轨
LOWER: MID - K*STD(CLOSE,M);//布林下轨

VARIABLE:n:=0,s:=0;
ma5:ma(c,5);
k1:cross(ma5,lower);
k2:cross(ma5,upper);
if k1 then n:=1;
if n=1 and k2 then
begin
buy(holding=0,1,market);
n:=0;
end
kk1:cross(upper,ma5);
kk2:cross(lower,ma5);
if kk1 then s:=1;
if s=1 and kk2 then
begin
buyshort(1,1,market);
s:=0;
end
 if time>=145700 then
 sell(holding>0,holding,market);
 sellshort(holding<0,holding,market);
 
 if ENTERPRICE-l>=10*mindiff then
  sell(holding>0,holding,market);
 if h-ENTERPRICE>=10*mindiff then
sellshort(holding<0,holding,market);