等级: 免费版
- 注册:
- 2021-5-30
- 曾用名:
|
老师好,请问我这段代码最后一行为什么没执行出来呀,其他都没问题了
TRx :=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR :=MA(TRx,20);
B1:ref(HHV(C,10),1),COLORBLUE,LINETHICK2;
B2:ref(LlV(C,10),1),COLORBLUE,LINETHICK2;
A1:ref(HHV(C,20),1),COLORRED,LINETHICK2;
A2:ref(LlV(C,20),1),COLORRED,LINETHICK2;
if C>A1 then buy(holding=0,2,THISCLOSE);
if C<B2 AND C>=A2 then sell(holding>0,holding,THISCLOSE);
if C<B2 AND C<A2 then
begin
sell(holding>0,holding,THISCLOSE);
buyshort(holding=0,2,THISCLOSE);
end
if C<ENTERPRICE-ATR*2 then sell(holding>0,holding,THISCLOSE);
if C>ENTERPRICE+ATR*5 then sell(holding=2,1,THISCLOSE);
if C<A2 then buyshort(holding=0,2,THISCLOSE); ;
if C>B1 AND C<=A1 then sellshort(holding<0,holding,THISCLOSE);
if C>B1 AND C>A1 then
begin
sellshort(holding<0,holding,THISCLOSE);
buy(holding=0,2,THISCLOSE);
end
if C>ENTERPRICE+ATR*2 then sellshort(holding<0,holding,THISCLOSE);
if C<ENTERPRICE-ATR*5 then sellshort(holding=2,1,THISCLOSE);
就是这最后一行,K线上反映不出来,老师看看是什么问题,多谢
|
|