Venice 82 posts msg #146972 - Ignore Venice modified |
3/17/2019 7:21:59 PM
Hi,
I hope i can explain what i mean by the title. I am trying to find the last occurrence of, say, a bull bar, then i need to get the high from that bull bar.
I can specify days ago, but that's not quite right, because I want to pragmatically figure out when it happened.
Something akin to this (i know this doesn't work in SF, but hopefully more programming related example will help:
set{bullBarDay, getBarDayWhen(close > open)}
set{bullBarHigh, high $bullBarDay days ago}
Thanks!
|
four 5,087 posts msg #146977 - Ignore four modified |
3/17/2019 11:25:14 PM
perhaps...
https://www.stockfetcher.com/forums/Indicators/Date-Based-References-DATE/126346
/* Reference a specific date */
DATE(20190211,close) > DATE(20190211,open)
set{var1,DATE(20190211,high)}
draw var1 on plot price
add column var1
|
Venice 82 posts msg #146987 - Ignore Venice |
3/18/2019 12:12:36 PM
Hey Four,
Thanks for taking a look. This still assumes I know when the bull bar is though; It's super painful trying to save price information and reference it later, if not impossible (that I know of).
Guess for this particular strategy, i'll just visually scan a set of personally picked stocks.
|
four 5,087 posts msg #146988 - Ignore four modified |
3/18/2019 12:21:47 PM
It allows you to
0. create watchlist and
1. pick a date and
2. require close > open on that date and
3. draw a line on that date high then
3. visually scan
--------------
Thanks for letting me give it a try--I don't use DATE
|
nibor100 1,046 posts msg #147001 - Ignore nibor100 |
3/19/2019 11:35:12 AM
@venice,
I'm a little lost following what you want to do, as once you have caught up to date on your personalized list of stocks, you could easily run a filter each night that finds just today's bull bar stocks and identifies their Highs for use in the rest of your filter.
Thanks,
Ed S.
|
Venice 82 posts msg #147039 - Ignore Venice modified |
3/21/2019 6:47:15 PM
Yeah, sorry about that - i gave a rather simple example just to see if it could be achieved.
So maybe to expand a bit more, Lets say we have the following filter...
low 10 days ago reached a new 30 day low.
^ Given that that reaches a new low, we can assume price is heading down. Now, I need the high of the last bull bar 11+ days ago. It could have happened 11 days ago, or it could have happened 20 days ago. It's at an unknown position/index. I then want to filter for stocks who have achieved some criteria against this high (lets say, reached the high) within the last 10 days.
So high within the last 10 days > high of the last bull bar (found between +11 and n days ago), while the low reached a new 30 day low between 11+ days and the last bull bar.
I bet there is some sort of math that could figure it out. But not quite sure what it is.
|
nibor100 1,046 posts msg #147055 - Ignore nibor100 |
3/24/2019 12:30:06 PM
@venice,
Implementing your last post I think the filter below crudely gets you what you described you were looking for:
a. the results are sorted by the number of days prior to the "low 10 days ago reached a new 30 day low" on which the prior Bull Bar occurred.
Running the filter, as is, today indicates that 1,081 stocks had a low 10 days ago reach a new 30 day low and column 5 indicates the farthest in the past a bull bar last occurred was 13 days prior.
b. So you look to the right of the # in the sorted column to find the high for that many days back that the Bull Bar occurred on. Zeros mean the Bull Bar occurred on a different numbered day.
c. To minimize scrolling etc. you can remove the comment symbols /* */ and change the number in the "var#' in the filters first comment line to your desired day in the past and rerun the filter to get a shorter list.
Let me know if this isn't what you wanted or if there are any questions.
Ed S.
|
Venice 82 posts msg #147075 - Ignore Venice |
3/25/2019 5:23:02 PM
Very cool; I think this is getting closer to what i want. Let me kick it around a little bit and see if i can get it tuned in to what i am trying to achieve!
Thanks a ton!
|