Posted By: strimp099
Higher for at least N days in a row - 02/22/21 07:53
How might I test if a price series is higher for at least N days in a row?
This gives my a price series higher for five days in a row starting yesterday...
How to generalize this to _at least_ five days starting yesterday?
This gives my a price series higher for five days in a row starting yesterday...
Code
bool risingFiveDays = (Prices[1] > Prices[2]) && (Prices[2] > Prices[3]) && (Prices[3] > Prices[4]) && (Prices[4] > Prices[5]) && (Prices[5] > Prices[6]);
How to generalize this to _at least_ five days starting yesterday?