Filter = 1;
AddColumn(Ref(ROC(C,1),-5), "change%5" + Date() ,1.2,IIf(Ref(ROC(C,1),-5)>0, textcolor = colorwhite,colorwhite),IIf(Ref(ROC(C,1),-5)<0,bkgndcolor= colorRed,colorGreen));
Hello all,
I am using the above code to populate a column with the change in price from 5 days ago. It displays as in image below (see last column title). Problem is the date is todays date and I don't know how to reference the date five days ago. I have tried ref(date(),-1) but it gives an error. I have tried using datetime() but the syntax is beyond me. Any thoughts? TIA.