等级: 新手上路
- 注册:
- 2021-5-31
- 曾用名:
|
DIFF:=(2*C+11*STKINDI('','DJB.EMA12',0,21,-1))/13-(2*C+25*STKINDI('','DJB.EMA26',0,21,-1))/27;
DEA:=(2*DIFF+8*STKINDI('','MACD.DEA',0,21,-1))/10;
MACD := 2*(DIFF-DEA);
MA10:=(STKINDI('','DJB.MA1',0,21,-1)*9+C)/10;
MA30:=(STKINDI('','DJB.MA2',0,21,-1)*29+C)/30;
MA60:=(STKINDI('','DJB.MA3',0,21,-1)*59+C)/60;
MA250:=(STKINDI('','DJB.MA4',0,21,-1)*249+C)/250;
KCOND1:MA30<STKINDI('','MA.MA2',0,21,-1) AND C<MA60 AND DIFF<0 AND DEA<0 AND C<MA30 AND C<MA10 AND MA10<MA30 AND MA60<STKINDI('','MA.MA3',0,21,-1) AND MA30<MA60 AND MA10<STKINDI('','MA.MA1',0,21,-1) AND MA10<MA250;
DCOND1:MA30>STKINDI('','MA.MA2',0,21,-1) AND C>MA60 AND DIFF>0 AND DEA>0 AND C>MA30 AND C>MA10 AND MA10>MA30 AND MA60>STKINDI('','MA.MA3',0,21,-1) AND MA30>MA60 AND MA10>STKINDI('','MA.MA1',0,21,-1) AND MA10>MA250;
最后一行变量 DCOND1 的输出结果永远是零,KCOND1 的输出结果正常,而如果将最后两行代码换个位置
写成这样
DCOND1:MA30>STKINDI('','MA.MA2',0,21,-1) AND C>MA60 AND DIFF>0 AND DEA>0 AND C>MA30 AND C>MA10 AND MA10>MA30 AND MA60>STKINDI('','MA.MA3',0,21,-1) AND MA30>MA60 AND MA10>STKINDI('','MA.MA1',0,21,-1) AND MA10>MA250;
KCOND1:MA30<STKINDI('','MA.MA2',0,21,-1) AND C<MA60 AND DIFF<0 AND DEA<0 AND C<MA30 AND C<MA10 AND MA10<MA30 AND MA60<STKINDI('','MA.MA3',0,21,-1) AND MA30<MA60 AND MA10<STKINDI('','MA.MA1',0,21,-1) AND MA10<MA250;
那么变量 KCOND1 的输出结果就永远是零了,DCOND1 的输出结果正常
|
-
-
|