以文本方式查看主题

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

--  作者:wjs
--  发布时间:2011/2/12 12:47:17
--  [求助]请教公式编写
当某一条件成立时,最后一根K线位置中某点的值做一标记,其后3-5根K线上穿或下穿时做另一标记。
例:当做空条件成立时,标记‘卖出’,其后2根K线如期发展,结果,第3~5根K线发生反转,其CLOSE
大于卖出点时,标记‘反转’或‘买入’。
谢谢!

--  作者:admin
--  发布时间:2011/2/12 13:28:26
--  

请稍等,我们的专家正在为您编写。

请耐心等待


--  作者:z7c9
--  发布时间:2011/2/12 14:12:02
--  

runmode:0;

variable:down=0;

if holding=0 then begin
 buyshort(1,1,limitr,close);
 drawtext(1,high,\'卖出\');
end 

if enterbars=1 and close<enterprice then
 down:=1;

if enterbars=2 and close<ref(close,1) then
 down:=down+1; 

if holding<0 then begin
 if down=2 and enterbars>=3 and enterbars<=5 and close>enterprice then begin
  sellshort(1,holding,limitr,close);
  drawtext(1,low,\'反转\');
 end
 
 if enterbars>=6 then
  sellshort(1,holding,limitr,close);
end


 


--  作者:董小球
--  发布时间:2011/2/12 14:13:38
--  

variable:x=1,y=2;
if 条件成立 then begin
DRAWTEXT(CLOSE/OPEN>1.01,LOW,\'标记1\');
end

if 空条件成立 then begin
DRAWTEXT(CLOSE/OPEN>1.01,LOW,\'卖出\');
x=BARPOS;
end

now:=BARPOS;

if now-x>=3 AND now-x<=5 AND 其后2根K线如期发展的条件成立 then begin
DRAWTEXT(CLOSE/OPEN>1.01,LOW,\'反转\');
end

 

 

大概的代码是这样 具体细节自己再推敲下


--  作者:wjs
--  发布时间:2011/2/12 19:29:37
--  
谢谢二位老师。