以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  关于止盈止损触发价的问题  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=54037)

--  作者:he3617
--  发布时间:2013/7/17 15:50:40
--  关于止盈止损触发价的问题

论坛高手们,我想知道我下面写的止盈止损的交易价格是当周的收盘价还是触发价格?测试的时候是按照哪个价格?

 

VARIABLE:maxprofit=0;
win:=0;
win2:=0;

if holding>0 and enterbars>0 then begin
    win:=c-enterprice;
    if win>maxprofit then
     maxprofit:=win;
     win2:=(maxprofit-win)/maxprofit*100;
   end
     if holding>0 and enterbars>0 then begin
   多止损:sell(win<=-10,0);
   多止盈:sell(maxprofit>20 and win2>=60 and openprofit>0,0);
  end

  if holding<0 and enterbars>0 then begin
    win:=enterprice-c;
    if win>maxprofit then
    maxprofit:=win;
    win2:=(maxprofit-win)/maxprofit*100;
  end
  if holding<0 and enterbars>0 then begin
    空止损:sellshort(win<=-10,0);
    空止盈:sellshort(maxprofit>20 and win2>=60 and openprofit>0,0);
   end  


--  作者:jinzhe
--  发布时间:2013/7/17 15:51:44
--  

这个写法是偷懒不推荐使用的写法,

这样的写法是按照市价下单,测评时是当周期收盘价

 


--  作者:he3617
--  发布时间:2013/7/17 15:56:18
--  
您推荐用怎么写?请指点,谢谢!
--  作者:he3617
--  发布时间:2013/7/17 16:01:32
--  
还有有什么办法可以让止盈止损的测试也采用触发价格,这样是不是会更真实一点?