check this code i use it
If i can replace pre market with this previous low and high
#Plot opening range high / low
input MarketOpenTime = 0930;
input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
#Plot yesterday's high / low
plot Yhigh = if ShowTodayOnly and !Today then Double.NaN else high(period = "day" )[1];
plot Ylow = if ShowTodayOnly and !Today then Double.NaN else low(period = "day" )[1];
Yhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Yhigh.SetDefaultColor(Color.GREEN);
Yhigh.SetLineWeight(2);
Ylow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Ylow.SetDefaultColor(Color.GREEN);
Ylow.SetLineWeight(2);
Alert(close>Yhigh, "buySignal",Alert.bar,Sound.Ding);
Alert(close<Ylow, "sellSignal",Alert.bar,Sound.Ding);
If i can replace pre market with this previous low and high
#Plot opening range high / low
input MarketOpenTime = 0930;
input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
#Plot yesterday's high / low
plot Yhigh = if ShowTodayOnly and !Today then Double.NaN else high(period = "day" )[1];
plot Ylow = if ShowTodayOnly and !Today then Double.NaN else low(period = "day" )[1];
Yhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Yhigh.SetDefaultColor(Color.GREEN);
Yhigh.SetLineWeight(2);
Ylow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Ylow.SetDefaultColor(Color.GREEN);
Ylow.SetLineWeight(2);
Alert(close>Yhigh, "buySignal",Alert.bar,Sound.Ding);
Alert(close<Ylow, "sellSignal",Alert.bar,Sound.Ding);