concept stock price in category fortran
appears as: stock prices, stock price, stock price

This is an excerpt from Manning's book Modern Fortran: Building efficient parallel applications.
The main trick we’ll use for this challenge is to determine all array indices where the stock price is greater than its moving average, as well as those where the stock price is smaller than its moving average. We can then combine these two conditions and find all the indices where the stock price changes from smaller to greater, and vice versa. Figure 5.5 illustrates this algorithm.
Figure 5.5. Finding indices where the stock price crosses its moving average
![]()