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)
First, I am posting as study so you can figure out if it is giving you the open and close that you want. After you load the study, set the PercentageChange parameter to 100, so the Signal plot doesn't give a result. Otherwise your chart might be squished vertically, depending on the instrument.
Note that TOS indexes bars by their start time, not the close time. So the close of 930 bar on a 15 minute chart, will be at 945. As discussed, you will need to indicate the time frame in the scan settings.
Second, it looks like you are in a different time zone, so see line 3 in the code below. You want to edit the 0300 to shift to your time zone. I am PST, so if you are EST, for example, then it should be either 0000 or 0600. Not sure which way you need it to shift, so you will have to play with it.
If satisfactory, you can delete the last 3 lines of the code and put in scan and give it a good workout in OnDemand and/or simulation before going live.
If not what you want, please let me know, will try my best. ;-)
You are awesome! Apologies for getting back to you so late. I'm gonna mess around with this and plug it into a scanner later tonight and tomorrow. I'm only 1hr behind, so no big deal.
Also, question? Does this code particularly scan for any stocks that had a 15min price drop within the last 30 days? Or does it scan for stocks on the day it was initiated?
Strictly today. For 30 days, only way I can think would be to create separate formulas for each day and then reference those number of specific periods back within each formula, e.g. close[26], close[52], etc. Would have to think how to do that. Regardless, you will definitely have to do the legwork on that one as that would take some time and be pretty tedious.
That might be something you want to post on thinkscript forum, they may have much better solution than I do.
Strictly today. For 30 days, only way I can think would be to create separate formulas for each day and then reference those number of specific periods back within each formula, e.g. close[26], close[52], etc. Would have to think how to do that. Regardless, you will definitely have to do the legwork on that one as that would take some time and be pretty tedious.
That might be something you want to post on thinkscript forum, they may have much better solution than I do.
Absolutely! Just looking at it and I see the open and close and what you’re referencing. Again, thank you so much, this really helped me out a ton!
In most languages I've learned how to use a "for" statement to this kind of thing, but not available in thinkscript. Maybe another way, but I don't know it.
There is BarNumber(), and believe can use that, but problem being if there are bars missing, this will give erroneous results, and you wouldn't know it unless you validated every scan result...every time. Can't see that being practical.
Not sure how often stocks have missing bars, but I know with futures and currencies it happens often enough. So I don't recommend this approach.
At this point, I need help. If someone else can chime in or you can find another study that references prior days' intraday bars, then I can look at it.