njjstocks 8 posts msg #161210 - Ignore njjstocks |
7/11/2024 11:28:38 AM
Any pointers on how to implement an if function in SF?
Here's the psudo logic :
set{bear_fvg_sum, sum(if(bearish_fvg > 0, high, 0), 30)}
Essentially, if this condition bearish_fvg > 0 is met I want to return High else 0 and I want the sum of it over 30 days so that i can average it.
Thanks a lot.
|
nibor100 1,044 posts msg #161232 - Ignore nibor100 |
7/13/2024 1:12:55 PM
This old Cegis post might help. or you search for old TRO posts on logic. Ed S.
|
xarlor 587 posts msg #161233 - Ignore xarlor |
7/13/2024 6:20:02 PM
https://www.stockfetcher.com/forums/General-Discussion/A-COMPLETE-LOGIC-SYSTEM-ANOTHER-GIFT-FROM-AVERY/28017/-1/28017
|
njjstocks 8 posts msg #161241 - Ignore njjstocks |
7/16/2024 4:39:24 AM
Thanks both for the pointers. Here's the implementation for the psudo logic above
set {if, count(bear_fvg_check > 0 ,1)}
set {then, bear_fvg_check * high}
set {bear_fvg_sum, sum(then, 30)}
|
nibor100 1,044 posts msg #161243 - Ignore nibor100 |
7/16/2024 11:07:28 AM
You may want your 2nd line to use the "if" instead of " bear_fvg_check".
Ed S.
|
njjstocks 8 posts msg #161245 - Ignore njjstocks |
7/16/2024 6:15:38 PM
My bad. Thank you @nibor100
|