roadskater
New member
Thanks to those who have contributed posts about counting consecutive and cumulative conditions and other articles on the site, about how to color bars based on conditions. I am having a bit of trouble understanding how to use a static variable (for today's low) and compare that successively with previous days' lows into the past until finding the most recent bar as low or lower than the low of the currently building bar.
Like when the cohosts banter about the volatility:
"Well you know, Adam, if you thought you had missed out, [AAPL, for example] hasn't been this low since [bars] days (bars) ago."
"Right, Eve, on [date]."
After deciding I wanted this, I did go looking extensively here, and in looking, I found the following on tradingview, which is more than I had wanted initially, but it's nice. I'd be looking for something like this Goo Search for this...
QyPmcjKa-Lowest-Highest-From-Widget/
I've seen how to go backward in time comparing each bar to the previous bar using the recursive variables to find consecutive instances of a condition. But I want to repeatedly compare today's (or this bar's) low (or high) to previous candles until finding a lower (or higher) one. I'd want to create a label with the number of bars and the date for each, at least when in daily aggregation. (I'm not as worried about the time, even intraday, as that complicated it...mainly by thinking in bars I'm allowing for it to be used on other aggregations). I can do most of this, but I have not cracked the piece that repeatedly compares the LATEST bar to the 2nd latest, then the 3rd latest, &c.
I would be using AddLabel to put this info on the chart (how many bars, at least), I guess, but am open to other cool ways of showing this info, and the learning that comes with it. I would likely eventually used a trimmed down version to show days since hh or ll in a watchlist, which is beyond that for which I am asking help currently.
I know that there are easy ways using thinkorswim functions to find the lowest low for a certain number of bars, and I had considered using a counter within that command to increase the number of periods until I got a match. I'm still working on these ideas, but decided to give in and ask if anyone with more thinkorswim chops to throw me an idea or two.
I'll take as little or as much as you want to offer, and I will learn it and use it again. The key piece is how to keep comparing the latest bar with successively more distant in the past bars. I'm sure I've repeated myself, in hopes of being clear!
Thanks in advance.
Like when the cohosts banter about the volatility:
"Well you know, Adam, if you thought you had missed out, [AAPL, for example] hasn't been this low since [bars] days (bars) ago."
"Right, Eve, on [date]."
After deciding I wanted this, I did go looking extensively here, and in looking, I found the following on tradingview, which is more than I had wanted initially, but it's nice. I'd be looking for something like this Goo Search for this...
QyPmcjKa-Lowest-Highest-From-Widget/
I've seen how to go backward in time comparing each bar to the previous bar using the recursive variables to find consecutive instances of a condition. But I want to repeatedly compare today's (or this bar's) low (or high) to previous candles until finding a lower (or higher) one. I'd want to create a label with the number of bars and the date for each, at least when in daily aggregation. (I'm not as worried about the time, even intraday, as that complicated it...mainly by thinking in bars I'm allowing for it to be used on other aggregations). I can do most of this, but I have not cracked the piece that repeatedly compares the LATEST bar to the 2nd latest, then the 3rd latest, &c.
I would be using AddLabel to put this info on the chart (how many bars, at least), I guess, but am open to other cool ways of showing this info, and the learning that comes with it. I would likely eventually used a trimmed down version to show days since hh or ll in a watchlist, which is beyond that for which I am asking help currently.
I know that there are easy ways using thinkorswim functions to find the lowest low for a certain number of bars, and I had considered using a counter within that command to increase the number of periods until I got a match. I'm still working on these ideas, but decided to give in and ask if anyone with more thinkorswim chops to throw me an idea or two.
I'll take as little or as much as you want to offer, and I will learn it and use it again. The key piece is how to keep comparing the latest bar with successively more distant in the past bars. I'm sure I've repeated myself, in hopes of being clear!
Thanks in advance.
Last edited: