Question: Implement the function to compute stock pressure. To compute positive stock pressure for each stock price, you should find the last day with the lower

Implement the function to compute stock pressure.
To compute positive stock pressure for each stock price, you should find the last day with the
lower (or equal) price. In other words, the positive stock pressure is the number of days since the
last day with a lower or equal price. Below is an example for 1 week of data.
| Price | Stock Pressure
------------------------------
| Day 1|100|1
------------------------------
| Day 2|90|2
------------------------------
| Day 3|95|1
------------------------------
| Day 4|100|1
-------------------------------
| Day 5|105|1
-------------------------------
| Day 6|110|1
-------------------------------
| Day 7|80|7
-------------------------------

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!