Hello All. Thank you for your time and interest in helping others.
I try to findout the % gain / loss after close crosses above hullmovingavg(close,200) till now.
I am getting an error "Only constants expected here: cnt CL function indexer of close at 2:25".
My code is as follows:
def cnt = if close > hullmovingavg(close,200) then 0 else cnt[1] + 1;
plot a= ((close / close[cnt])-1)*100;
Thank you again!!
I try to findout the % gain / loss after close crosses above hullmovingavg(close,200) till now.
I am getting an error "Only constants expected here: cnt CL function indexer of close at 2:25".
My code is as follows:
def cnt = if close > hullmovingavg(close,200) then 0 else cnt[1] + 1;
plot a= ((close / close[cnt])-1)*100;
Thank you again!!