Optuma Forums › Optuma Scripting › 365 day high has occurred in the last 50 days › Reply To: 365 day high has occurred in the last 50 days
September 7, 2021 at 1:58 am
#65915
- Topics: 70
- Replies: 804
- Posts: 874
Hi Karen,
It’s because the V1 and V2 variables are loading daily data in a weekly chart, so you can have 5 true results within a weekly bar (and 20+ in a monthly), hence the duplication.
Change V1 and V2 to the following, and it will look back a year no matter the timeframe of the chart, instead of data for 365 calendar days.
V1 = HIGHESTHIGH(BACKTYPE=Weeks, BARS=52);
V2 = HIGH() CrossesAbove V1;