以文本方式查看主题

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

--  作者:13142159
--  发布时间:2017/3/14 13:54:33
--  请老师帮忙转换代码
 请老师帮我把下面的文华8代码转换成金字塔的代码
NN1:=BARSLAST(DATE<>REF(DATE,1))+1;
HH1:=REF(HHV(H,NN1),NN1);
LL1:=REF(LLV(L,NN1),NN1);

BF:=HH1-LL1;

CROSSUP(C,REF(O,NN1-1)+BF*1.2),BK;//BPK
CROSSDOWN(C,REF(O,NN1-1)-BF*1.2),SK;//SPK



C<=BKPRICE-60,SP;//止损
C>=SKPRICE+60,BP;//止损
C>=BKPRICE+95,SP;//止盈
C<=SKPRICE-95,BP;//止盈
CLOSEKLINE(0,6);
AUTOFILTER;

--  作者:jinzhe
--  发布时间:2017/3/14 14:05:25
--  

NN1:=BARSLAST(DATE<>REF(DATE,1))+1;
HH1:=REF(HHV(H,NN1),NN1);
LL1:=REF(LLV(L,NN1),NN1);

BF:=HH1-LL1;

if CROSS(C,REF(O,NN1-1)+BF*1.2) then buy(holding=0,1,market);//BPK
if CROSS(REF(O,NN1-1)-BF*1.2,c) then buyshort(holding=0,1,market);//SPK

 

if C<=enterprice-60 then sell(1,0,market);//止损
if C>=enterprice+60 then sellshort(1,0,market);//止损
if C>=enterprice+95 then sell(1,0,market);//止盈
if C<=enterprice-95 then sellshort(1,0,market);//止盈