龙听期货论坛's Archiver

龙听 发表于 2022-11-2 13:50

【TDirec】

[code]Variables: var0(0), var1(0), var2(0);

var0 = Average(High, 20);
var1 = Average(Low, 20);
var2 = Average(Close, 50);

condition1 = (var0 > var0[1] AND var1 > var1[1] AND Close > var1)
        AND ((var0 > var2 AND var1 > var2) OR Close > var2);
If condition1 Then
        TDirec = 1
Else
begin
condition1 = (var0 < var0[1] AND var1 < var1[1] AND Close < var0)
        AND ((var0<var2 AND var1<var2) OR Close < var2);
If condition1 Then
        TDirec = -1;
end;
[/code]

页: [1]