老师请帮忙! (文华财经WH8赢智V8.2)

投资者咨询:老师请帮忙! (文华财经WH8赢智V8.2)
来源:文华财经  日期:2018-6-10 10:36
 runmode:0; 

input:length(20); 

variable:stopline=0; 

if barpos<=30 then exit; 

up:=count(close>ref(close,1),length); 
down:=count(close 
entrylongcond:=up/down>=2/3; 
entryshortcond:=down/up>=2/3; 

upperband:=ref(hhv(high,length),1); 
lowerband:=ref(llv(low,length),1); 

hh:=ref(high,1); 
ll:=ref(low,1); 

if holding=0 then begin 
if ref(entrylongcond,1) then begin 
buy(1,1,limitr,open); 
stopline:=lowerband; 
end 

if ref(entryshortcond,1) then begin 
buyshort(1,1,limitr,open); 
stopline:=upperband; 
end 
end 

if holding>0 and enterbars>=1 then begin 
//if lowerband>stopline then 
stopline:=lowerband; 

if low<=stopline then 
sell(1,holding,limitr,min(open,stopline)); 
end 

if holding<0 and enterbars>=1 then begin 
//if upperband stopline:=upperband; 

if high>=stopline then 
sellshort(1,holding,limitr,max(open,stopline)); 
end 

ss:stopline,linethick0; 
drawicon(holding<>0,stopline,11); 
盈亏:asset-500000,noaxis,coloryellow,linethick2; 
改一下WH8用的
技术人员回复
日期:2018-6-10 11:12
改写比较复杂,需要一些时间,预计明天17:00前回复,请耐心等待 
投资者咨询:老师请帮忙! (文华财经WH8赢智V8.2)
来源:文华财经  日期:2018-6-10 10:36
 好的老师辛苦了!!!
技术人员回复
日期:2018-6-11 12:37

不同软件函数机制不同,效果可能略有差异,参考:

 

VARIABLE:STOPLINE:=0;
IF BARPOS<=30 THEN  BEGIN
UP:=COUNT(CLOSE>REF(CLOSE,1),20);
DOWN:=COUNT(CLOSE<REF(CLOSE,1),20); 
ENTRYLONGCOND:=UP/DOWN>=2/3;
ENTRYSHORTCOND:=DOWN/UP>=2/3;
UPPERBAND:=REF(HHV(HIGH,20),1);
LOWERBAND:=REF(LLV(LOW,20),1);
HH:=REF(HIGH,1);
LL:=REF(LOW,1);
END
IF BKVOL=0&&SKVOL=0 THEN BEGIN
IF REF(ENTRYLONGCOND,1) THEN BEGIN
//BUY(1,1,LIMITR,OPEN);
1,BK;
STOPLINE:=LOWERBAND;
END
END
IF REF(ENTRYSHORTCOND,1) THEN BEGIN
//BUYSHORT(1,1,LIMITR,OPEN);
1,SK;
STOPLINE:=UPPERBAND;
END
IF BKVOL>0 AND BARSBK>=1 THEN BEGIN
//IF LOWERBAND>STOPLINE THEN
STOPLINE:=LOWERBAND;
IF LOW<=STOPLINE THEN  BEGIN
1,SP;
END
END
IF SKVOL>0 AND BARSSK>=1 THEN BEGIN
//IF UPPERBAND STOPLINE:=UPPERBAND;
IF HIGH>=STOPLINE THEN BEGIN
1,BP;
END
END
SS:STOPLINE,LINETHICK1;
DRAWICON(BKVOL>0||SKVOL>0,STOPLINE,11);
盈亏:MONEYTOT-500000,NODRAW,COLORYELLOW,LINETHICK2;
AUTOFILTER;

投资者咨询:老师请帮忙! (文华财经WH8赢智V8.2)
来源:文华财经  日期:2018-6-10 10:36
 木有任何信号了!也没有开平仓
技术人员回复
日期:2018-6-11 14:20

这样改下,

 

VARIABLE:STOPLINE:=0;
IF BARPOS>30 THEN  BEGIN
UP:=COUNT(CLOSE>REF(CLOSE,1),20);
DOWN:=COUNT(CLOSE<REF(CLOSE,1),20); 
ENTRYLONGCOND:UP/DOWN>=2/3;
ENTRYSHORTCOND:DOWN/UP>=2/3;
UPPERBAND:=REF(HHV(HIGH,20),1);
LOWERBAND:=REF(LLV(LOW,20),1);
HH:=REF(HIGH,1);
LL:=REF(LOW,1);
END
IF BKVOL=0&&SKVOL=0 THEN BEGIN
IF REF(ENTRYLONGCOND,1) THEN BEGIN
1,BK;
STOPLINE:=LOWERBAND;
END
END
IF REF(ENTRYSHORTCOND,1) THEN BEGIN
1,SK;
STOPLINE:=UPPERBAND;
END
IF BKVOL>0 AND BARSBK>=1 THEN BEGIN
STOPLINE:=LOWERBAND;
IF LOW<=STOPLINE THEN  BEGIN
1,SP;
END
END
IF SKVOL>0 AND BARSSK>=1 THEN BEGIN
IF HIGH>=STOPLINE THEN BEGIN
1,BP;
END
END
SS:STOPLINE,LINETHICK1;
DRAWICON(BKVOL>0||SKVOL>0,STOPLINE,11);
盈亏:MONEYTOT-500000,NODRAW,COLORYELLOW,LINETHICK2;
AUTOFILTER;