Swing(int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod)
strength = 5
barsAgo = 1
instance = 1
lookBackPeriod = CurrentBar
If the most recent (visually identifiable on a chart) swing high occurs 4 bars ago (let's call it bar SH1), it should not be identified by this function. Which reason applies?
1. only 4 bars have passed since SH1 and since strength is 5, the function needs one more lower bar to identify SH1 as a swing high bar. So when CurrentBar moves forward 1 day, assuming it's a lower bar, SH1 will be identified.
2. only 3 bars have passed from SH1 to the beginning of the search period (CurrentBar - 1), and since strength is 5, the function needs two more lower bars to identify SH1 as a swing high bar. So when CurrentBar moves forward 2 days, assuming two lower bars, SH1 will be identified.
If reason #2 applies, then if we adjust barsAgo so that it fixates on the same date (e.g., we increment barsAgo by 1 every day), then SH1 will never be identified as a swing high bar because the number of days between SH1 and the beginning of the search will always be less than the strength period.
So what I'm trying to get at is can the function identify a swing high that occurs within strength bars of the search period, assuming there are strength lower bars on either side of the swing high?
Comment