My apologies Elissa for the late response. Somehow your last reply on Sept 6th escaped my attention. I accidentally ran across this while searching the forum.
What I did here was to convert the code we published previously in this post: https://www.hahn-tech.com/thinkorswim-alert-high-low-version-two/
Converting it into a scan. I see you have requested a scan that alerts to new intraday highs and lows. This code should handle that quite well. The additional items you requested can be easily added as standard built in filters. So I will not cover the price range between 1 and 15 or the 2x relative volume. Whatever ‘relative volume’ means. If you can explain what that means I may provide a couple lines of code to include that.
Here is the code for new intraday highs and lows, to be used in a scan. If you want to know how to adjust the settings, be sure to view the original view I linked to at the beginning of my response.
input marketOpen = 930;
input marketClose = 1600;
input intraDaySpan = {Default "SameDay" , "OverNight"};
input numberOfDays = 1;
input numberOfYears = 0;
def okToPlot = GetLastDay() - numberOfDays <= GetDay() and GetLastYear() - numberOfYears <= GetYear() ;
def OpenCounter = SecondsFromTime(marketOpen);
def CloseCounter = SecondsTillTime(marketClose);
def MarketHours = if OpenCounter >= 0 and CloseCounter >= 0 then 1 else 0;
def beforeMidnight = OpenCounter >= 0 and CloseCounter <= 0;
def afterMidnight = OpenCounter <= 0 and CloseCounter >= 0 ;
def Today ;
def hideChartBubbles ;
rec DailyHigh ;
rec DailyLow ;
switch (intraDaySpan) {
case "SameDay":
Today = if GetDay() != GetDay()[1] then 1 else 0;
DailyHigh = if MarketHours then if high > DailyHigh[1] then high else DailyHigh[1] else high;
DailyLow = if Today then low else if MarketHours then if low < DailyLow[1] then low else DailyLow[1] else low; hideChartBubbles = MarketHours;
case "OverNight": Today = 0;
DailyHigh = if beforeMidnight or afterMidnight then if high > DailyHigh[1] then high else DailyHigh[1] else high;
DailyLow = if beforeMidnight or afterMidnight then if low < DailyLow[1] then low else DailyLow[1] else low;
hideChartBubbles = beforeMidnight or afterMidnight;
};
def TodaysHigh = if okToPlot and hideChartBubbles then DailyHigh else Double.NaN;
def TodaysLow = if okToPlot and hideChartBubbles then DailyLow else Double.NaN;
#Alert(DailyHigh > DailyHigh[1] and hideChartBubbles, "New High", Alert.BAR, Sound.RING);
#Alert(DailyLow < DailyLow[1] and hideChartBubbles, "New Low", Alert.BAR, Sound.RING);
# use this to scan for new intraday highs
plot scan = DailyHigh > DailyHigh[1] and hideChartBubbles;
# use this to scan for new intraday lows
#plot scan = DailyLow < DailyLow[1] and hideChartBubbles;
We have a video that shows new intraday highs and lows, yes. That video does not include volume data. Please explain “to be able to customize the price settings”. Have you searched the Q&A forum for similar posts? This sort of thing is requested very often.
By that I mean I’d like the scanner to only show me stocks over $1 and under $15, for example.