jjmcguire 22 posts msg #158238 - Ignore jjmcguire |
12/26/2021 7:20:11 PM
How can I count the days below a fixed value similar to the price line value?
This code won't work, but I am wanting something like this that counts the days that are below a fixed value such as the low 60 day low as of today:
Below the chart I simply want to see if the close price is below the price line value (MinLow on today) or not. Any assistance is much appreciated.
Thanks!
Jason
|
Cheese 1,374 posts msg #158241 - Ignore Cheese modified |
12/26/2021 10:22:43 PM
https://www.stockfetcher.com/forums/General-Discussion/Count-Days-below-a-Fixed-Price/158238
======================
This example by TRO might give you something close to what you might be looking for:
https://www.stockfetcher.com/forums/General-Discussion/how-to-find-lowest-low-over-X-number-of-days/98517
TheRumpledOne modified 1/10/2011 9:50:32 AM
|
nibor100 1,031 posts msg #158242 - Ignore nibor100 |
12/27/2021 1:36:35 AM
First, you don’t need “ price line at“ in your second set.statement.
Secondly I don’t believe you will ever find a daily close in the last 60 days below the low 60 day low unless I’m missing something.
Ed S
|
Mactheriverrat 3,153 posts msg #158244 - Ignore Mactheriverrat |
12/27/2021 11:34:42 AM
@Ed S
I was thinking the same thing about finding stocks below the 60 day low.
He could try
show stocks at low 60 day low
Then watch at stocks go lower.
Same as
show stocks at high 60 day high
Then watch at stocks go higher.
|
jjmcguire 22 posts msg #158245 - Ignore jjmcguire |
12/27/2021 11:55:44 AM
Hi Nibor, I am wanting to compare the close from any time period to a value that is derived only from today (similar to how price line does it). So if the price line (calculated as the 60 day low for example) is at $280 for MSFT, then I want to compare that value to the close from historical time periods, ie. 70, 80, 90 days ago close compared to the price line value.
The price line value is not a set, but a value that is only applicable to today. If I use a Low 60 day low instead of price line, then that value is different for all historical time periods, which is not what I want. I want to compare historical close prices to the only the Low value measured from today, but unfortunately I am not able to use the Price Line in any calculations.
Thanks!
Jason
|
nibor100 1,031 posts msg #158247 - Ignore nibor100 |
12/27/2021 4:50:57 PM
Jason,
I'm following you better now, but depending on your specific uses of past closes in comparison to a set numeric value from today SF has limitations since it processes data in order from the past to the present.
So, assuming the count function returns 25 closes > than your numeric value from today.
what then do you need to know or do with those 25 different closes?
thanks,
Ed S.
|
nibor100 1,031 posts msg #158252 - Ignore nibor100 |
12/27/2021 10:25:17 PM
here are some example codes of options you can play around with:
the code below uses the rarely used VarOffset function to retrieve specific past values using a variable, perhaps with mods it can work for you.
Ed S.
|
jjmcguire 22 posts msg #158264 - Ignore jjmcguire modified |
12/28/2021 12:06:34 PM
Thanks Nibor and Cheese. I haven't been able do what I am wanting from the code you provided although the code has been helpful for other things.
Here is an example of how I want the chart to display:
The BelowMinLow shows every day that the close is below the 60 day low taken on 12/28/2021. I can't use a fixed value for my scan, but I included it so you can see what I'm looking for in the final chart.
In this example, I'm trying to identify the lower portion of the yearly chart so I can then filter for interesting events happening in that region.
Thanks,
Jason
|