以文本方式查看主题

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

--  作者:citscwb
--  发布时间:2015/3/11 0:10:09
--  求助修改成金字塔模型!!!
C>VALUEWHEN(DATE<>REF(DATE,1),OPEN)&&TIME<0910,BK;
C<VALUEWHEN(DATE<>REF(DATE,1),OPEN)&&TIME<0910,SK;
AA:=HHV(H,BARSBK+1);
BB:=LLV(L,BARSSK+1);
(C<BKPRICE*(1-N/1000)||
(AA-BKPRICE>BKPRICE*N/1000&&C<=BKPRICE+(AA-BKPRICE)*N/100))
&&BKPRICE>0||TIME>=1455,SP;
(C>SKPRICE*(1+N/1000)||
(BKPRICE-BB>BKPRICE*N/1000&&C>=BKPRICE+(BKPRICE-BB)*N/100))
&&BKPRICE>0||TIME>=1455,BP;
AUTOFILTER;

--  作者:jinzhe
--  发布时间:2015/3/11 8:58:12
--  
请问n是多少?
--  作者:CITSCWB
--  发布时间:2015/3/12 21:52:28
--  
N是1
--  作者:pyd
--  发布时间:2015/3/13 9:04:53
--  

|| 这是什么意思?


--  作者:pyd
--  发布时间:2015/3/13 9:19:31
--  

||是或者的意思吧?改成or了。

你代码中用的时间是北京时间,在软件里工具-》选项-》视图里勾选北京本地时间,重启金字塔生效。

n:=1;

if C>VALUEWHEN(DATE<>REF(DATE,1),OPEN) and TIME<091000 then buy(holding=0,1,market);

if C<VALUEWHEN(DATE<>REF(DATE,1),OPEN) and TIME<091000 then buyshort(holding=0,1,market);
AA:=HHV(H,enterbars+1);
BB:=LLV(L,enterbars+1);
if (C<enterPRICE*(1-N/1000) or
(AA-enterPRICE>enterprice*N/1000 and C<=enterprice+(AA-enterprice)*N/100))
 and enterprice>0 or TIME>=145500 then sell(HOLDING>0,holding,market);
if (C>enterPRICE*(1+N/1000) or (enterprice-BB>enterprice*N/1000 and C>=enterprice+(enterprice-BB)*N/100))
 and enterprice>0 or TIME>=145500 then sellshort(HOLDING<0,holding,market);

 

[此贴子已经被作者于2015/3/13 9:20:17编辑过]