There is only 1 obs which satisfied the criteria for the third condition & as you were facing problem with the third condition, I worked only on that. The approach is pretty similar to what I did in your last post i.e. using a hash table.
Create a hash table with key= _N_ i.e. the number of obs. When the criteria for third condition is met, I created a variable called tp (short for transaction price) which stores the current price. Then program starts looking for prices in the hash table where obs number is less than the current obs number. For example, in our only case the observation number is 152. Therefore, the program will look at each value in the hash table starting from 152 backwards to 1 till it finds a value that is different from the current price. Once it finds a different value then it stores that value in tp and exits the loop. The label is decided based on value of tp compared with current price.