INPUT
:N1(
30
,
1
,
1000
,
1
),N2(
150
,
1
,
1000
,
1
),N3(
1
,
1
,
100
,
1
),SS(
1
,
1
,
100
,
1
);
VAR2:=
MA
(
C
,N2);
VAR3:=
MA
(VAR2,N1);
VAR4:=
IF
((
H
+
L
)<=(
REF
(
H
,
1
)+
REF
(
L
,
1
)),
0
,
MAX
(
ABS
(
H
-
REF
(
H
,
1
)),
ABS
(
L
-
REF
(
L
,
1
))));
VAR5:=
IF
((
H
+
L
)>=(
REF
(
H
,
1
)+
REF
(
L
,
1
)),
0
,
MAX
(
ABS
(
H
-
REF
(
H
,
1
)),
ABS
(
L
-
REF
(
L
,
1
))));
VAR6:=
SUM
(VAR4,N1)/(
SUM
(VAR4,N1)+
SUM
(VAR5,N1));
VAR7:=
SUM
(VAR5,N1)/(
SUM
(VAR4,N1)+
SUM
(VAR5,N1));
VAR8:=VAR6-VAR7;
VAR9:=
MA
(VAR8,
2
*N1);
VAR10:=
MA
(VAR9,N1);
CONKD:=
BARPOS
>N2
AND
C
>VAR2
AND
VAR2>VAR3
AND
VAR8>
0
AND
VAR9>VAR10;
CONKK:=
BARPOS
>N2
AND
C
<VAR2
AND
VAR2<VAR3
AND
VAR8<
0
AND
VAR9<VAR10;
CONPD:
C
<VAR2
AND
C
>
ENTERPRICE
*(
1
+
0.03
*N3);
CONPK:
C
>VAR2
AND
C
<
ENTERPRICE
*(
1
-
0.03
*N3);
DTZS:=
C
<
ENTERPRICE
*(
1
-
0.03
*N3);
KTZS:=
C
>
ENTERPRICE
*(
1
+
0.03
*N3);
SELL
(
HOLDING
>
0
AND
CONPD,
HOLDING
,
MARKET
);
SELLSHORT
(
HOLDING
<
0
AND
CONPK,
HOLDING
,
MARKET
);
BUY
(
HOLDING
=
0
AND
CONKD,SS,
MARKET
);
BUYSHORT
(
HOLDING
=
0
AND
CONKK,SS,
MARKET
);
SELL
(
HOLDING
>
0
AND
DTZS,
HOLDING
,
MARKET
);
SELLSHORT
(
HOLDING
<
0
AND
KTZS,
HOLDING
,
MARKET
);