我有这段简单的代码,因为我不想重复同一个警报,当前一个警报不是1时,它将是buy=true,如果前一个警告不是-1,它将为sell=true
我有一段代码:
buy = mmf > mmfEma and lastAlert != 1
sell = mmf < mmfEma and lastAlert != -1
if (buy)
    lastAlert := 1
if (sell)
    lastAlert := -1
alertcondition(buy,  "M Long",  "M Long")
alertcondition(sell, "M Short", "M Short")
但“and lastAlert!=1”似乎不起作用,因为它发送了相同的警报。
非常感谢。