N1:=IF(PERIOD =6,3,IF(PERIOD =5,5,0));
N2:=IF(PERIOD =6,5,IF(PERIOD=5,13,IF(PERIOD 5,21,0)));
N3:=IF(PERIOD =6,8,IF(PERIOD=5,21,IF(PERIOD 5,34,0)));
N4:=IF(PERIOD =6,13,IF(PERIOD=5,34,IF(PERIOD 5,89,0)));
均价:(O+C+H+L)/4,COLORWHITE;
底1:REF(均价,BARSLAST(MACD.DIF=LLV(MACD.DIF,N1))),COLORYELLOW;
底2:REF(均价,BARSLAST(MACD.DIF=LLV(MACD.DIF,N2))),COLORMAGENTA;
底3:REF(均价,BARSLAST(MACD.DIF=LLV(MACD.DIF,N3))),COLORLIMAGENTA;
底4:REF(均价,BARSLAST(MACD.DIF=LLV(MACD.DIF,N4))),LINETHICK2,COLORRED;
顶1:REF(均价,BARSLAST(MACD.DIF=HHV(MACD.DIF,N1))),COLORLIBLUE;
顶2:REF(均价,BARSLAST(MACD.DIF=HHV(MACD.DIF,N2))),COLORCYAN;
顶3:REF(均价,BARSLAST(MACD.DIF=HHV(MACD.DIF,N3))),COLORLICYAN;
顶4:REF(均价,BARSLAST(MACD.DIF=HHV(MACD.DIF,N4))),LINETHICK2,COLORGREEN;