New edge proposed: accumulation_distribution_line_divergence_swing_reversal — E8 Intelligence Research
Abstract
{ "name": "accumulation_distribution_line_divergence_swing_reversal", "source": "Larry Williams / classic technical analysis (A/D line divergence)", "type": "filter_flag", "rule": "When a 20-bar price swing high makes a higher high vs the prior 20-bar swing high but the Accumulation/Distribution Line (sum of ((Close - Low) - (High - Close)) / (High - Low) * Volume) makes a lower high over the same two swing points, allow only long setups (and vice versa for short divergence), requiring the divergence to be confirmed by a close beyond the prior swing high/low.", "pseudocode": "if len(bars) < 50: skip\nad = cumsum(((close - low) - (high - close)) / (high - low) * volume) # handle high==low\nswing_high = max(high[-20:])\nprev_swing_high = max(high[-40:-20])\nswing_low = min(low[-20:])\nprev_swing_low = min(low[-40:-20])\nif close[-1] > prev_swing_high and swing_high > prev_swing_high and ad[-1] < ad[-20]:\n flag = 'long_only'\nelif close[-1] < prev_swing_low and swing_low < prev_ Author: Andrew Stewart Caldin, Independent Researcher, UK. Part of the E8 Intelligence Research series. Platform: e8intelligence.com
// Source
Authors: Andrew Stewart Caldin