Previous day percent change


Category:
0
0

Hello Hahn,

 

I wanted to know if you could create a watch-list column that captures the previous days %change. This will be very helpful to quickly see if a stock has the ability for continuation.

The second part of this request is to create a highlight.. If the stock closed red the previous day then the color of the percentage text  will be red, if the stock closed green then the color of the percentage text will be green.

 

Best

Marked as spam
Posted by (Questions: 22, Answers: 63)
Asked on July 21, 2018 7:42 am
133 views
0
Private answer

plot priorPercentChange = 100 * (close[1] / close[2] -1);
priorPercentChange.AssignValueColor(if priorPercentChange > 0 then Color.GREEN else Color.RED);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 21, 2018 8:18 am
0

Thanks, I will test this for the next few days This will be great for capturing the previous days candle %growth

( at July 21, 2018 3:35 pm)
0

Hello Hahn,

So the code isnt capturing the data correctly for percent change of a stock from its previous day.

For example , If I view the column on a Wednesday, morning I would like to see the stocks %change at close on Tuesday from Mondays close.

I have included a screenshot of the behavior from below and how iI would like it to follow using finviz as a reference from 8am this morning,

Best

( at July 25, 2018 9:59 am)
0

I had the days reversed. Sorry about that. Been trying to memorize that percentage formula and I seem to have a mental block. I have corrected the code in my answer to compute the values correctly.

( at July 25, 2018 10:12 am)
0

works like a charm ?

( at July 25, 2018 11:45 am)