以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  老师来看看,对不对  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=24798)

--  作者:漫步金字塔
--  发布时间:2012/8/30 10:03:47
--  老师来看看,对不对

if maxseqloss<2 then begin
  if cound1 then begin
    if holding=-1 then sellshort(1,1,limitr,min(ll+20,enterprice+15));
    if holding=0 then buy(1,1,limitr,min(ll+20,enterprice+15));
  end
  if cound2 then begin
    if holding=1 then sell(1,1,limitr,max(hh-20,enterprice-15));
    if holding=0 then buyshort(1,1,limitr,max(hh-20,enterprice-15));
  end
end
if maxseqloss=2 then begin
  if cound2 and (hh-20)>=enterprice then begin
    if holding=1 then sell(1,1,limitr,hh-20);
    if holding=0 then buy(1,1,limitr,hh-20);
  end
  if cound1 and (ll+20)<=enterprice then begin
    if holding=-1 then sell(1,1,limitr,ll+20);
    if holding=0 then buyshort(1,1,limitr,ll+20);
  end
  if cound2 and (hh-20)<enterprice then begin
    if holding=1 then sell(1,1,limitr,max(hh-20,enterprice-15));
maxseqloss=maxseqloss-3;
  end
  if cound1 and ll+20>enterprice then begin
    if holding=-1 then sellshort(1,1,limitr,min(ll+20,enterprice+15));
  end
maxseqloss=maxseqloss-3;
end

 

意思是连续亏损三次就出场等待新的信号!上面有错吗??没有开仓信号啊!


--  作者:漫步金字塔
--  发布时间:2012/8/30 10:26:50
--  

老师在吗?解答一下,在线等。谢谢老师了!!!!!

老师在吗?解答一下,在线等。谢谢老师了!!!!!


--  作者:jinzhe
--  发布时间:2012/8/31 9:07:06
--  

你把最外面的连亏<2写进下单公式里面,不要作为一个全局的条件