![Rank: 8](static/image/common/star_level3.gif) ![Rank: 8](static/image/common/star_level3.gif)
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
//
//中间变量
DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,9);
MACD :2*(DIFF-DEA);
if macd>0 and close<ref(close,1) and holding<=0 then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
end
if close>ENTERPRICE+3*mindiff or close<ENTERPRICE-3*mindiff then sell(1,holding,marketr);
if macd>0 and close>ref(close,1) and holding>=0 then buyshort(1,1,marketr);
if close>ENTERPRICE+3*mindiff or close<ENTERPRICE-3*mindiff then
begin
sell(1,holding,marketr);
buyshort(1,1,marketr);
end
if close>ENTERPRICE+3*mindiff or close<ENTERPRICE-3*mindiff then sellshort(1,holding,marketr); |
|