以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  [求助]请问文华此模型如何改写成金字塔能用的  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=182030)

--  作者:HOPEWX
--  发布时间:2020/9/4 8:55:18
--  [求助]请问文华此模型如何改写成金字塔能用的
如题,请老师帮忙看下,谢谢。

N1:=6;

N2:=21;

N3:=25;

TR := MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));

ATR := EMA(TR,N1);

EF:=(HHV(CLOSE,N2)-LLV(CLOSE,N2))/SUM(ABS(CLOSE-REF(CLOSE,1)),N2);

RSV:=(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100;

BACKGROUNDSTYLE(1);

K:=SMA(RSV,30,1);

D:=SMA(K,30,1);

J:=3*K-2*D;

TR>MAX(ATR*(1.5-(EF-0.5)*(N3/10)),ATR)&&HIGH>REF(HIGH,1)&&CLOSE>OPEN&&TIME>0905&&TIME<1455,BPK;

TR>MAX(ATR*(1.5-(EF-0.5)*(N3/10)),ATR)&&LOW<REF(LOW,1)&&CLOSE<OPEN&&TIME>0905&&TIME<1455,SPK;

EXIST(J<10,5)&&J<D&&COUNT(J>REF(J,1),1)=1,BP;

EXIST(J>90,5)&&J>D&&COUNT(J<REF(J,1),1)=1,SP;

TIME>1455,BP;

TIME>1455,SP;

AUTOFILTER;


--  作者:FireScript
--  发布时间:2020/9/4 9:02:59
--  
 N1:=6;

N2:=21;

N3:=25;

TRx := MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR := EMA(TRx,N1);

EF:=(HHV(CLOSE,N2)-LLV(CLOSE,N2))/SUM(ABS(CLOSE-REF(CLOSE,1)),N2);

RSV:=(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100;



K:=SMA(RSV,30,1);

D:=SMA(K,30,1);

J:=3*K-2*D;

if TR>MAX(ATR*(1.5-(EF-0.5)*(N3/10)),ATR) and HIGH>REF(HIGH,1) and CLOSE>OPEN and TIME>130500 and TIME<185500 then
begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);    
end


if TR>MAX(ATR*(1.5-(EF-0.5)*(N3/10)),ATR) and LOW<REF(LOW,1) and CLOSE<OPEN and TIME>130500 and TIME<185500 then
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);    
end


sellshort(EXIST(J<10,5) and J<D and COUNT(J>REF(J,1),1)=1 and holding<0,holding,market);
sell(EXIST(J>90,5) and  J>D and COUNT(J<REF(J,1),1)=1,holding,market);

if time>=185500 then
begin
sell(holding>0,holding,MARKET);
sellshort(holding<0,holding,market);    
end



替换部分函数的使用方式即可。

--  作者:HOPEWX
--  发布时间:2020/9/4 9:24:05
--  
谢谢您,我来好好学习下