Hello, I would like to have a custom column for my scan/watchlist just like the default %Change. That show green when the percentage is positive and red when the percentage is negative.
But I would like one for 5 days % of Change & 1 month of change.
I know the formula should be fairly straight forward, but I'm not that good at coding.
It would be really helpful if I can get some help.
Thank you guys so much!!!
This is all I have so far, but it doesn't show the quote as % nor does it have the color function.
But I would like one for 5 days % of Change & 1 month of change.
I know the formula should be fairly straight forward, but I'm not that good at coding.
It would be really helpful if I can get some help.
Thank you guys so much!!!
This is all I have so far, but it doesn't show the quote as % nor does it have the color function.
Code:
input price = close;
input percent = 2.0;
input length = 5;
def x = 100*(price / price[length]-1);
plot PercentChg = 100*(price / price[length]-1);