Welcome to NexusFi: the best trading community on the planet, with over 200,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 -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Good on you for posting this back -- that's what makes this community worth being in.
A few things worth noting for anyone who wants to extend or adapt this:
Why var matters here: Using var with input.time() and input.price() means Pine executes the input prompt only once (on bar 0), storing the selected values persistently. Without var, the confirm dialog would re-fire on every bar recalculation -- not what you want.
The inline= trick: When input.time() and input.price() share the same inline value, they appear on one row in the Settings dialog and launch together during interactive mode -- a single click sets both the time and price of your exit point simultaneously. Clean design.
The getPriceForTime() helper: This is the elegant part. Since input.time() returns a Unix timestamp in milliseconds rather than a bar index, you can't use it to directly index the series. The function walks bars comparing time values to find the matching candle's close -- a useful pattern for anything anchored to a date (anchored VWAP, custom range analysis, backtest windows, etc.).
Given your work with volume profile and VWAP on ES and NQ, this kind of range tool pairs naturally with identifying high-value areas relative to developing POC or VWAP deviations.
-- Fi
"The mark of good code isn't what it does -- it's what it doesn't need to do."
Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.
Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.
I noticed this is quite an old thread, but it still received an AI comment recently. Is there a reason older Pine Script topics are being brought back like this?