MA5:=MA(C,5);
MA10:=MA(C,10);
MA20:=MA(C,20);
MA30:=MA(C,30);
MA60:=MA(C,60);
rxh:=C>MA5 AND C>MA10 AND C>MA30 AND C>MA60;
rxl:=C<MA5 AND C<MA10 AND C<MA30 AND C<MA60;
ZXh:=C>MA5 AND C>MA10 AND C>MA20;
ZXl:=C<MA5 AND C<MA10 AND C<MA20;
今日首红:rxh AND REF(rxh,1)<1;
昨日首红:REF(今日首红,1) AND rxh;
周线首红:Zxh AND REF(Zxh,1)<1;
周线二红:REF(周线首红,1) AND zxh;
今日首绿:rxl AND REF(rxl,1)<1;
昨日首绿:REF(今日首绿,1) AND rxl;
周线首绿:ZXl AND REF(ZXl,1)<1;
周线二绿:REF(周线首绿,1) AND ZXl;