Optuma Forums › Optuma Scripting › Price Range Script Error › Reply To: Price Range Script Error
March 21, 2022 at 9:28 am
#67727
- Topics: 5
- Replies: 609
- Posts: 614
Hi Tim,
I would calculate the Daily % Range, then use BarsTrue() to find where it was less than 10% over the last 10 days.
Script Example:
1 2 3 4 5 6 7 8 |
//Find High / Low Range as a % V1 = (ABS(Low() - High()) / HIGH()) * 100 ; //High Low Range % is less than 10% V2 = V1 <= 10 ; //Last 10 Bars have had a Range of 10% or less BARSTRUE(V2) == 10 |
If you mean has moved less than 10% over the entire 10 day period (not on a daily basis) a ROC would work.
1 2 3 |
ROC(BARS=10) <= 10 |
-
This reply was modified 2 months ago by
Matthew.