以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  20天均线拐头卖出怎么表达  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=67576)

--  作者:worthytwo
--  发布时间:2014/7/18 15:24:53
--  20天均线拐头卖出怎么表达

 

 

enterlong:abc;

exitlong:ma(c,20)<ref(ma(c,20),1);

 

这样当20天线拐头向下以后天天都出卖出信号,怎么处理比较好?


--  作者:pyd
--  发布时间:2014/7/18 15:31:09
--  

你想让它怎么出信号?

可以加上holding持仓判断

aa:ma(c,20)<ref(ma(c,20),1);
if aa then
buyshort(abs(holding)<5,1,market);

[此贴子已经被作者于2014/7/18 15:55:25编辑过]

--  作者:worthytwo
--  发布时间:2014/7/18 16:10:07
--  

我不想做持仓判断,就想做一个“只显示买入后第一次均线拐头”


--  作者:jinzhe
--  发布时间:2014/7/18 16:19:37
--  

variable:n=0;

if holding>0 and aa then n:=n+1;

drawtext(n=1 and aa, close,\'第一次拐头\');

 

if 平仓条件 and 持仓判断 then begin

    平仓语句;

    n:=0;

end