Hello,

I am trying to construct an algorithm that compares the values of the current bar with those of the previous bars.

Example:

I would like to check

if (low 3 bars ago is > than the current high) and the (current high is greater than the previous low)

 

How would i code these sorts of criteria in Python?

I appreciate any and all help.