jimdandy 13 posts msg #160479 - Ignore jimdandy |
8/4/2023 10:04:27 AM
Hello all,
I need help in terms of the following condition I want to implement:
Parabolic SAR(0.02,0.2) below price for 1 day
set{countPSARdec, days(Parabolic SAR(0.02,0.2) 2 days ago above price,5)}
What I try to achieve is: all stocks where Parabolic SAR is below the close yesterday and the 5 days before (so 2 to 6 days before today) Parabolic SAR was above the close.
The second phrase (set....) seems not be right. At least the result showing different things.
My second question is: if I am not wrong the phrase "close has not been increasing for 5 days" does not work. Can you help me with an alternative?
Thank you very much
Heiko
|
xarlor 581 posts msg #160480 - Ignore xarlor |
8/4/2023 10:51:45 AM
On your second question, we need more detail.
Do you mean close has been in a decline for 5 days?
Choppy during the last 5 days (sometimes close is above yesterday, other times below)?
It can be increasing 4 out of 5 days, but 1 of those days has to be decreasing?
|
jimdandy 13 posts msg #160481 - Ignore jimdandy |
8/4/2023 11:19:30 AM
Thanks Xarlor!
Actually it only should not increase above the close 5 days ago. But it does not matter if it ends up at the same closing than 5 days ago (went down and up again) or decreased for 5 days or any other possibility.
|
xarlor 581 posts msg #160483 - Ignore xarlor |
8/4/2023 12:06:33 PM
The definitive answer is:
Theoretically, this should work, but StockFetcher wonkiness is recalculating c5d as 5 days prior to whichever day it's checking. One would assume c5d stays constant as 5 days prior to today. See XLU, GNS, or GOLD as examples. Same problem if you use count.
|
jimdandy 13 posts msg #160488 - Ignore jimdandy |
8/4/2023 4:42:54 PM
Thanks xarlor!
|