以文本方式查看主题

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

--  作者:13142159
--  发布时间:2017/1/7 15:11:51
--  请帮忙编写一个简单策略
 一分钟周期

第一根K线收盘为阳线做多,收盘为阴线做空。

止损:最新价小于等于-5个点平多,大于等于5个点平空。

止盈:最新价大于等于10个点平多,小于等于-10个点平空。

--  作者:jinzhe
--  发布时间:2017/1/9 9:03:13
--  

收盘前平仓吗?还是要一定等到满足直营止损条件?


--  作者:13142159
--  发布时间:2017/1/9 11:11:47
--  
 下午收盘前10分钟平仓。只做白盘
--  作者:jinzhe
--  发布时间:2017/1/9 11:18:20
--  

第一根K线收盘为阳线做多,收盘为阴线做空。

止损:最新价小于等于-5个点平多,大于等于5个点平空。

止盈:最新价大于等于10个点平多,小于等于-10个点平空。

 

sj:=time>=130000 and time<=185000;

 

if barslast(time=closetime(1))=1 and isup then buy(holding=0,1,marketr);

if barslast(time=closetime(1))=1 and isdown then buyshort(holding=0,1,marketr);

 

if enterprice-c>=5 and sj then sell(1,0,marketr);

if c-enterprice>=10 and sj then sell(1,0,marketr);

 

if c-enterprice>=5  and sj then sellshort(1,0,marketr);

if enterprice-c>=10 and sj  then sellshort(1,0,marketr);

 

if time>185000 then begin

   sell(1,0,marketr);

   sellshort(1,0,marketr);

end