以文本方式查看主题

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

--  作者:hengzhi
--  发布时间:2016/9/8 8:04:26
--  请教代码转化
用文化编的止盈止损,用金字塔代码如何编写,谢谢!

止盈止损
DP:C>=BKPRICE+35*MINPRICE&&C<=BKHIGH-9*MINPRICE&&EVERY(C<MA5,3),SP;
KP:C<=SKPRICE-35*MINPRICE&&C>=SKLOW+9*MINPRICE&&EVERY(C>MA5,3),BP;

--  作者:jinzhe
--  发布时间:2016/9/8 8:51:41
--  

if c>=enterprice+35*mindiff and c<=hhv(h,enterbars+1)-9*mindiff and every(c<ma5,3) and holding>0 then sell(1,0,market);

if c<=enterprice-35*mindiff and c>=llv(l,enterbars+1)+9*mindiff and every(c>ma5,3) and holding<0 then sellshort(1,0,market);