hd1:=
stkindiex
(
stklabel
,
'BOLL布林带交易系统.ho'
,
0
,
1
,-
1
,
500
);
hd2:=
stkindiex
(
stklabel
,
'BOLL布林带交易系统.ho'
,
0
,
1
,-
2
,
500
);
hd3:=
stkindiex
(
stklabel
,
'BOLL布林带交易系统.ho'
,
0
,
3
,-
1
,
500
);
hd4:=
stkindiex
(
stklabel
,
'BOLL布林带交易系统.ho'
,
0
,
3
,-
2
,
500
);
ho1:hd1+hd3;
ho2:hd2+hd4;
tbuyho:
tbuyholdingex
(
''
,
STKLABEL
,
1
);
tsellho:
tsellholdingex
(
''
,
STKLABEL
,
1
);
is_order:
TGLOBALSUBMITEX
(
0
,
''
,
stklabel
,
0
);
if
is_order
or
(ho1=ho2)
then
exit
;
else
BEGIN
if
ho1>=
0
and
tsellho>
0
then
tsellshort
(
1
,tsellho,
mkt
);
if
ho1>
0
and
ho1>tbuyho
then
BEGIN
tbuy
(
1
,ho1-tbuyho,
mkt
);
END
if
ho1>
0
and
ho1<tbuyho
then
BEGIN
tsell
(
1
,tbuyho-ho1,
mkt
);
END
if
ho1<=
0
and
tbuyho>
0
then
tsell
(
1
,tbuyho,
mkt
);
if
ho1<
0
and
abs
(ho1)>tsellho
then
BEGIN
tbuyshort
(
1
,
abs
(ho1)-tsellho,
mkt
);
END
if
ho1<
0
and
abs
(ho1)<tsellho
then
BEGIN
tsellshort
(
1
,tsellho-
abs
(ho1),
mkt
);
END
END