I understand you want to compare the open of the current bar to the high of the bar two candles ago. I updated the title of the question because the phrase "previous to previous" was too difficult to understand clearly. Took me quite a bit of effort to understand it. I'm glad you took the time to explain it clearly in your question.
Here is the code to accomplish your request:
plot buySignal = open > high[2];
buySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buySignal.SetDefaultColor(Color.CYAN);
buySignal.SetLineWeight(3);
plot sellSignal = open < low[2];
sellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sellSignal.SetDefaultColor(Color.MAGENTA);
sellSignal.SetLineWeight(3);
Alert(buySignal, "Buy Signal", Alert.BAR, Sound.RING);
Alert(sellSignal, "Sell Signal", Alert.BAR, Sound.RING);
I have not tested this on a chart so let me know if anything is amiss.