Input
:N(
12
,
1
,
100
,
1
);
Num:=
1
;
Ma10:
Ma
(
c
,N);
Std1:=
Std
(
c
,N);
Upper:=Ma10+Std1;
Bottom:=Ma10-Std1;
BuyCond:=
h
>
ref
(
h
,
1
)
and
l
>
ref
(
l
,
1
)
and
l
<=Bottom
and
ma10<
close
;
SellCond:=
h
<
ref
(
l
,
1
)
and
l
<
ref
(
l
,
1
)
and
h
>=Upper
and
ma10>
close
;
if
BuyCond
then
begin
Sellshort
(
holding
<
0
,
0
,
market
);
Buy
(
holding
=
0
,Num,
market
);
end
if
SellCond
then
begin
Sell
(
holding
>
0
,
0
,
market
);
BuyShort
(
holding
=
0
,Num,
market
);
end
Win_Buy:=
h
-
enterprice
>=
2
;
Win_Sell:=
enterprice
-
l
>=
2
;
Lose_Buy:=
enterprice
-
l
>=
1.25
;
Lose_Sell:=
h
-
enterprice
>=
1.25
;
if
Win_Buy
and
holding
>
0
then
多止盈:
Sell
(
enterbars
>
0
,
0
,
market
);
if
Win_Sell
and
holding
<
0
then
空止盈:
Sellshort
(
enterbars
>
0
,
0
,
market
);
if
Lose_Buy
and
holding
>
0
then
多止损:
Sell
(
enterbars
>
0
,
0
,
market
);
if
Lose_Sell
and
holding
<
0
then
空止损:
Sellshort
(
enterbars
>
0
,
0
,
market
);