You would run a historical chart scan, and use
.fctbNone{ color:#000000; }
.fctbStyle7{ color:#800000; }
.fctbStyle5{ color:#0000ff; }
.fctbStyle8{ color:#000000; } DefinePaintbarParameter("Period", "Period", true, 1, 100, 1, 5);
var num = Convert.ToInt32(GetPaintbarParameter("Period"));
if (Open > Max(1, num, High))
{
SetScanResult("O>HH");
}