以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  多单的回撤止盈怎么写》?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=67291)

--  作者:量化马甲
--  发布时间:2014/7/11 15:12:46
--  多单的回撤止盈怎么写》?
多单的利润从最高点回落20%后止盈,这个该怎么写啦?后台交易系统。
--  作者:jinzhe
--  发布时间:2014/7/11 15:19:50
--  

if (hhv(topenrpfit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and 持仓判断 then 平多语句;


--  作者:量化马甲
--  发布时间:2014/7/11 15:33:13
--  
到止盈全部平仓,这样写正确吗

if (hhv(topenprofit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and tbuyholdingex(\'\',cu1,1)>1 then begin
tsell(1,tbuyholdingex(\'\',cu1,1),mkt,0,0,\'\',cu1);
end

--  作者:jinzhe
--  发布时间:2014/7/11 15:41:30
--  

--  作者:量化马甲
--  发布时间:2014/7/11 15:43:11
--  
空单的止盈,是这样写吗
if (hhv(topenprofit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and tsellholdingex(\'\',cu1,1)>0 then begin
tsellshort(1,tsellholdingex(\'\',cu1,1),mkt,0,0,\'\',cu1);
end

--  作者:jinzhe
--  发布时间:2014/7/11 15:47:08
--  
也一样,就是当前浮赢比最大浮赢降低了20%