Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have a strategy I used all the time (below). What I want to do is scan for two inside bars within the last 16 hours. THe problem is I don't know how to exclude premarket and after market, I also don't know how to exclude 3:30 - 4:00. If someone could help that would be fantastic.
Can you help answer these questions from other members on NexusFi?
I'm not a code guy, but there are many here that can help you. Individual threads are set up segregated by platform. These exceptions are a snap, someone will help, I'm sure. I color inside bars and make the scan using ToS scan feature...or I do it visually. Granted that will not help if you are trying to automate. Find the platform thread, someone will help. Search, Want your "platform name" indicator created...
I didn't quite understand your task, but here is a good example of how to work with time in TOS.
This is an indicator that draws the High and Low of the first hour of trading.
This is a good example of how you can filter out a specific time period.
#First hour high and low
#by thetrader.top
declare hide_on_daily;
declare once_per_bar;
input EndCandle = 1030;
input marketOpen = 930;
input marketClose = 1600;
def OpenCounter = SecondsFromTime(marketOpen);
def CloseCounter = SecondsTillTime(marketClose);
def MarketHours = if OpenCounter >= 0 and CloseCounter >= 0 then 1 else 0;
def Today ;
rec DailyHigh ;
rec DailyLow ;
Today = if GetDay() != GetDay()[1] then 1 else 0;
DailyHigh = if Today then high else if MarketHours then if high > DailyHigh[1] AND SecondsFromTime(EndCandle) < 0 then high else DailyHigh[1] else high;
DailyLow = if Today then low else if MarketHours then if low < DailyLow[1] AND SecondsFromTime(EndCandle) < 0 then low else DailyLow[1] else low;
plot TodaysHigh = if(MarketHours,DailyHigh, Double.NaN) ;
plot TodaysLow = if(MarketHours,DailyLow, Double.NaN) ;
I didn't quite understand your task, but here is a good example of how to work with time in TOS.
This is an indicator that draws the High and Low of the first hour of trading.
This is a good example of how you can filter out a specific time period.
#First hour high and low
#by thetrader.top
declare hide_on_daily;
declare once_per_bar;
input EndCandle = 1030;
input marketOpen = 930;
input marketClose = 1600;
def OpenCounter = SecondsFromTime(marketOpen);
def CloseCounter = SecondsTillTime(marketClose);
def MarketHours = if OpenCounter >= 0 and CloseCounter >= 0 then 1 else 0;
def Today ;
rec DailyHigh ;
rec DailyLow ;
Today = if GetDay() != GetDay()[1] then 1 else 0;
DailyHigh = if Today then high else if MarketHours then if high > DailyHigh[1] AND SecondsFromTime(EndCandle) < 0 then high else DailyHigh[1] else high;
DailyLow = if Today then low else if MarketHours then if low < DailyLow[1] AND SecondsFromTime(EndCandle) < 0 then low else DailyLow[1] else low;
plot TodaysHigh = if(MarketHours,DailyHigh, Double.NaN) ;
plot TodaysLow = if(MarketHours,DailyLow, Double.NaN) ;
How do I get the scan to work for the following hourly time ranges, 9:30 - 10:30
10:30 - 11:30
11:30 - 12:30
12:30 - 1:30
1:30 - 2:30
2:30 - 3:30