cond1:
REF
(
close
,
2
)>
REF
(
close
,
1
)
and
REF
(
low
,
2
)>
REF
(
low
,
1
)
and
(
close
-
REF
(
close
,
1
))>
2
and
(
low
-
REF
(
low
,
1
))>
2
;
cond2:
REF
(
close
,
2
)<
REF
(
close
,
1
)
and
REF
(
low
,
2
)<
REF
(
low
,
1
)
and
(
close
-
REF
(
close
,
1
))<
2
and
(
low
-
REF
(
low
,
1
))<
2
;
input
:多止损跳数(
5
,
1
,
100
,
1
),多移动止损跳(
2
,
1
,
100
,
1
),盈利浮度多(
20
,
1
,
100
,
1
);
input
:空止损跳数(
5
,
1
,
100
,
1
),空移动止损跳(
2
,
1
,
100
,
1
),盈利浮度空(
20
,
1
,
100
,
1
);
input
:多止盈跳数(
5
,
1
,
100
,
1
),多止盈跳数(
5
,
1
,
100
,
1
),手数(
1
,
1
,
100
,
1
);
if
cond1=
1
and
low
then
BEGIN
开多:
tbuy
(
tbuyholding
(
1
)>=
0
,手数,
lmt
,
o
);
end
if
cond2=
1
and
HIGH
then
BEGIN
平多:
tsell
(
tbuyholding
(
1
)>
0
,
tbuyholding
(
1
),
lmt
,
o
);
end
if
cond2=
1
and
HIGH
then
BEGIN
开空:
tbuyshort
(
tsellholding
(
1
)>=
0
,手数,
lmt
,
o
);
end
if
cond1=
1
and
low
then
BEGIN
平空:
tsellshort
(
tsellholding
(
1
)>
0
,
tsellholding
(
1
),
lmt
,
o
);
end
hh:=
hhv
(
h
,
tenterbars
+
1
);
xx:=hh-多移动止损跳*
mindiff
;
if
TOPENPROFIT
>=盈利浮度多*
mindiff
and
c
<=xx
and
tbuyholding
(
1
)>
0
then
tsell
(
1
,
tbuyholding
(
1
),
lmt
,
o
);
ll:=
llv
(
l
,
tenterbars
+
1
);
xx:=ll+空移动止损跳*
mindiff
;
if
TOPENPROFIT
>=盈利浮度空*
mindiff
and
c
>=xx
and
tsellholding
(
1
)>
0
then
tsellshort
(
1
,
tsellholding
(
1
),
lmt
,
o
);
if
c
<
tavgenterprice
-多止损跳数*
mindiff
and
tbuyholding
(
1
)>
0
then
tsell
(
1
,
0
,
lmt
,
o
);
if
c
>
tavgenterprice
+空止损跳数*
mindiff
and
tsellholding
(
1
)>
0
then
tsellshort
(
1
,
tsellholding
(
1
),
lmt
,
o
);
t3:=
time
>=
closetime
(
1
)
and
time
<
OPENTIME
(
2
)
or
(
time
>=
closetime
(
4
));
if
t3=
1
and
tbuyholding
(
1
)>
0
then
清多:
tsell
(
1
,
tbuyholding
(
1
),
mkt
);
t3:=
time
>=
closetime
(
1
)
and
time
<
opentime
(
2
)
or
(
time
>=
closetime
(
0
));
if
t3=
1
and
tsellholding
(
1
)>
0
then
清空:
tsellshort
(
1
,
tsellholding
(
1
),
mkt
);