I am trying to include a condition into a code whereby Close[0] would be greater than the first Close going backwards that is greater than Close[3] and occurs before Close[3]. I don’t think I can use Most Recent Occurrence (MRO) to do this, as that works back from Close[0] as far as I understand, and so may pick up Close[1] or Close[2]. Currently the code would look something like this:
if ((Close[4] > Close[3] && Close[0] > Close[4]) || (Close[5] > Close[3] && Close[0] > Close[5]))
Is there an easier way of doing this? Any help would be much appreciated.
Thank you.
Comment