等级: 新手上路
- 注册:
- 2021-6-7
- 曾用名:
|
楼主 |
发表于 2021-6-29 18:12
|
显示全部楼层
VARIABLE : trend_direction := '无';//全局变量
aaa: trend_direction;
//前20根K的最高价
H_20 := REF(HHV(H,20),1);
//前20根K的最低价
L_20 := REF(LLV(L,20),1);
//如果没有方向则计算
IF trend_direction = '无' THEN BEGIN
IF C>H_20 THEN BEGIN
trend_direction = '多';
END
IF C<L_20 THEN BEGIN
trend_direction = '空';
END
END
IF trend_direction = '多' THEN BEGIN
IF C<L_20 THEN BEGIN
trend_direction = '空';
END
END
IF trend_direction = '空' THEN BEGIN
IF C>H_20 THEN BEGIN
trend_direction = '多';
END
END |
|