Can you help in modifying this code

Hi,

I wrote this code given below. It works well but gives trading signal within the selected time frame. I want the signal to appear only after the time frame / candle is completed.

SET PIVOT = (HHV(5)+LLV(5)+CLOSE)/3

SET ROCSUM = PROC(PIVOT,11) + PROC(PIVOT,14)

SET WMAROC = WMA(ROCSUM,10)

SET SMAVG = SMA(WMAROC,5)

CROSSOVER(WMAROC,SMAVG) = TRUE

For Sell - CROSSOVER(SMAVG,WMAROC) = TRUE​


Please help me modify code for this purpose.

if you want to plot the signal after the end of the candle then just refer it with CLOSE of candle like

SET PIVOT = (HHV(5)+LLV(5)+CLOSE)/3

SET ROCSUM = PROC(PIVOT,11) + PROC(PIVOT,14)

SET WMAROC = WMA(ROCSUM,10)

SET SMAVG = SMA(WMAROC,5)

CLOSE>CROSSOVER(WMAROC,SMAVG) = TRUE