以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  金字塔直接反手如何写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=57266)

--  作者:qq代人发帖
--  发布时间:2013/10/8 11:13:22
--  金字塔直接反手如何写
请教:金字塔直接反手如何写?

--  作者:vermouth
--  发布时间:2013/10/8 11:18:09
--  
if cond then begin
sell();
buyshort();
end



--  作者:jinzhe
--  发布时间:2013/10/8 11:18:34
--  

举例:

 


input:m(5),n(20);
ma5:ma(c,m);
ma20:ma(c,20);

if cross(c,ma20) then begin
 sellshort(holding<0,0,thisclose);
 buy(holding=0,1,thisclose);
end

if cross(ma20,c) then begin
 sell(holding>0,0,thisclose);
 buyshort(holding=0,1,thisclose);
end

 

 

说明:20均线和5均线上下穿进行反手,以上是范例


--  作者:zzsg
--  发布时间:2013/10/8 11:56:31
--  
谢谢
非常感谢