以文本方式查看主题

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

--  作者:赤焱
--  发布时间:2016/9/1 11:20:22
--  平仓公式
请问固定止盈、固定止损、开仓后固定周期平仓的公式表达式怎么写?
--  作者:jinzhe
--  发布时间:2016/9/1 11:27:39
--  

固定止损:

 

if holding>0 and c<enterprice-5 then sell(1,0,market);

if holding<0 and c>enterprice+5 then sellshort(1,0,market);

 

固定止盈:

if holding>0 and c>enterprice+5 then sell(1,0,market);

if holding<0 and c<enterprice-5 then sellshort(1,0,market);

 

开仓后固定周期:

if enterbars=5 then begin

   sell(1,0,market);

   sellshort(1,0,market);

end


--  作者:赤焱
--  发布时间:2016/9/1 11:35:29
--  
谢谢