Thinkorswim Overnight Range Scan Alert
A quick Google search on the term “Overnight Range Trading Setups” nets some very interesting results. So I spent some time writing code and looking at charts. I think there is some real evidence to support the inclusion of the overnight range in your trading setups. I’m not here to show you how to trade the overnight range. However I did build you the best tool I can dream up, given my current knowledge and experience. The rest is up to you.
In this video named Thinkorswim Overnight Range Scan Alert, we show you many examples of how this tool may be applied. In addition to some special levels, we also include the ability to build custom scans based on its signals. As if that wasn’t enough, we throw in a bonus by showing how you can generate real time alerts based on the scan results. I am really excited to be able to present this material. I think this may end up being a valuable tool for many. It was a real eye-opener for me.
The code for the scan is included at the very bottom of this post. So be sure when you are done watching the video to scroll down past the video to get to that code. In the video we show you how to use that code to build your own custom scans, with alerts!
TD Ameritrade provides financial services including the trading of Stocks, Futures, Options and Forex.
Please be sure to share this page with your friends and colleagues. Leaving comments below is the best way to help make the content of this site even better.
Watch the video, Thinkorswim Overnight Range Scan Alert below:
input alertPeriodStart = 730;
input alertPeriodEnd = 930;
input minimumRange = 10;
input alertOnBreak = yes;
input alertOnPullBack = yes;
input numberOfDays = 0;
input numberOfYears = 0;
def okToPlot = GetLastDay() - numberOfDays <= GetDay() and GetLastYear() - numberOfYears <= GetYear() ;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
def regularSessionHours = RegularTradingStart(GetYYYYMMDD()) <= GetTime();
def extendedSessionHours = RegularTradingStart(GetYYYYMMDD()) >= GetTime();
def extendedSessionStart = regularSessionHours and extendedSessionHours;
def regularSessionStart = extendedSessionHours and regularSessionHours;
def extendedSessionHigh = CompoundValue(1, if extendedSessionStart then high else if extendedSessionHours then Max(high, extendedSessionHigh) else extendedSessionHigh, 0);
def extendedSessionLow = CompoundValue(1, if extendedSessionStart then low else if extendedSessionHours then Min(low, extendedSessionLow) else extendedSessionLow, 0);
def regularSessionHigh = CompoundValue(1, if regularSessionStart then high else if regularSessionHours then Max(high, regularSessionHigh) else regularSessionHigh, 0);
def regularSessionLow = CompoundValue(1, if regularSessionStart then low else if regularSessionHours then Min(low, regularSessionLow) else regularSessionLow, 0);
def overnightHigh = if okToPlot and regularSessionHours then extendedSessionHigh else Double.NaN;
def overnightLow = if okToPlot and regularSessionHours then extendedSessionLow else Double.NaN;
def breakOfHigh = extendedSessionHigh > regularSessionHigh and regularSessionHigh > extendedSessionHigh;
def breakOfLow = extendedSessionLow < regularSessionLow and regularSessionLow < extendedSessionLow;
def pullbackToHigh = low > extendedSessionHigh and low < extendedSessionHigh;
def pullbackToLow = high < extendedSessionLow and high > extendedSessionLow;
def overnightRange = overnightHigh - overnightLow;
plot scan = if alertPeriod and overnightRange >= minimumRange * TickSize() then breakOfHigh or breakOfLow else no;
#plot scan = if alertPeriod and overnightRange >= minimumRange * TickSize() then pullbackToHigh or pullbackToLow else no;