{"seq":1,"row_hash":"10cdf8f01aa806302b6244597bb3699a153e1cc24413461d9e4cfb4c2ff6caf0","body":"wavelab-journal-chain\nv=3\nseq=1\nprev=0000000000000000000000000000000000000000000000000000000000000000\nkind=genesis\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nchain_domain=wavelab-journal-chain\nchain_version=3\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nlive_schema_sha256=602ea699cd1e146a527b8bdfc0e2c14d90e30c950cf7e29923cf115aeb133726\ncanonical_spec_sha256=044065a85a1995c3646e5e22f62f79523d6c292ca68c90a615e45536e5f5d668\nverifier_sha256=d600af2ce60488b97357c8b263254931e7605828053f1ff6ed1d0142378138a2\ncolumn_order_sha256=4d6fee5ddbeb01e1c777cdfed7b1fd952fddd728d6cab7fe8089d3c348d726c9\noperator=DR%20Markets\ncreated_ms=1790242761226\n"} {"seq":2,"row_hash":"aecbcab4d27a93bea9634804647977506a87d9bb0a6cd0ae7fa7757772164f48","body":"wavelab-journal-chain\nv=3\nseq=2\nprev=10cdf8f01aa806302b6244597bb3699a153e1cc24413461d9e4cfb4c2ff6caf0\nkind=pre_registration\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nprereg_id=wavelab-catalogue-4h-v1\ntitle=Forward%20record%20of%2088%20pre-registered%20BTCUSDT%204h%20strategies%20against%20a%20coin-flip%20control\nrationale=Nine%20years%20of%20backtesting%20found%20nothing%20that%20clears%20a%20multiple-comparison%20correction%3A%20the%20best%204h%20Reality%20Check%20gave%20p%3D0.0200%20over%20the%20roughly%2080%20hypotheses%20that%20then%20declared%20the%204h%20timeframe%20%28the%20study%27s%20headline%20says%20100%3B%20its%20trial%20log%20says%20about%2080%29%2C%20measured%20gross%20of%20cost%20and%20on%20excess%20return%20over%20drift%2C%20and%200.0588%20after%20a%20Sidak%20correction%20for%20three%20timeframes.%20Searching%20backwards%20over%20the%20same%20history%20cannot%20settle%20the%20question%3A%20every%20further%20look%20spends%20degrees%20of%20freedom%20without%20adding%20information.%20Only%20data%20nobody%20has%20seen%20yet%20can.%20This%20ledger%20records%20every%20catalogue%20strategy%27s%20signal%20on%20every%20closed%204h%20bar%20from%20genesis%20forward%2C%20beside%20a%20control%20drawn%20by%20a%20committed%20seed%2C%20so%20that%20the%20only%20evidence%20that%20could%20still%20move%20the%20conclusion%20is%20collected%20in%20a%20form%20nobody%20can%20edit.%0A%0AThree%20geometry%20parameters%20are%20fixed%20here%20and%20all%20three%20have%20been%20looked%20at.%20tp_r%3D2.0%20and%20max_bars%3D48%20produced%20this%20project%27s%20only%20published%20backtest.%20sl_atr%3D1.5%20was%20never%20compared%20against%20an%20outcome%2C%20but%20it%20is%20a%20SAMPLING%20parameter%3A%20through%20the%20cost%20cap%20it%20decides%20which%20bars%20get%20a%20plan%20at%20all%20%28under%20the%20committed%20per-leg%20cost%20rule%2C%20about%2014%25%20of%20the%20last%20nine%20years%20and%2027%25%20of%20the%20last%20two%20are%20refused%2C%20for%20longs%20and%20shorts%20alike%29.%20No%20procedure%20un-looks%20at%20nine%20years%20of%20data.%20This%20is%20one%20look%2C%20not%20zero.\nprior=We%20predict%20NO%20edge%3A%20each%20strategy%27s%20choice%20of%20side%20is%20expected%20to%20do%20no%20better%20than%20a%20coin.%20Two%20things%20move%20the%20paired%20difference%20away%20from%20zero%20without%20any%20skill%2C%20and%20they%20are%20stated%20here%20so%20that%20neither%20is%20later%20mistaken%20for%20it.%20Market%20drift%3A%20a%20strategy%20that%20is%20long%20a%20fraction%20p%20of%20the%20time%20carries%20%282p%20-%201%29%2F2%20of%20the%20market%27s%20drift%20over%20its%20trades%2C%20so%20one%20that%20is%20almost%20always%20on%20one%20side%20measures%20the%20market%2C%20not%20itself%20%28see%20the%20decision%20rule%29.%20Cost%3A%20each%20arm%20pays%20its%20own%20legs%2C%20about%200.0015%20R%20apart%20when%20the%20sides%20differ.%20A%20result%20is%20only%20interesting%20if%20it%20contradicts%20this%20prior%2C%20and%20only%20credible%20under%20the%20decision%20rule%20below.%20Note%20that%20every%20strategy%20binding%20carries%20its%20AUTHOR%27S%20prior%2C%20written%20when%20the%20hypothesis%20was%20registered%2C%20and%20many%20of%20those%20expect%20an%20edge%3B%20they%20are%20sealed%20as%20written.%20This%20registration%27s%20prior%20is%20the%20operator%27s%2C%20and%20it%20is%20the%20one%20both%20endpoints%20are%20judged%20against.\nscope_json=%7B%22strategies%22%3A%2288%22%2C%22symbol%22%3A%22BTCUSDT%22%2C%22timeframe%22%3A%224h%22%7D\nparams_json=%7B%22catalogue_maturity%22%3A%221%22%2C%22catalogue_maturity_label%22%3A%22HISTORICAL%3A%20purged%20walk-forward%20over%20nine%20years%2C%20contaminated%20by%20selection.%20Not%20HISTORICAL_RIGOR%20%28nothing%20survived%20the%20Reality%20Check%29%20and%20not%20FORWARD%20%28there%20was%20none%20yet%29.%22%2C%22endpoint_cost_multiplier%22%3A%222.00000000%22%2C%22ev_min_r_micro%22%3A%22150000%22%2C%22eval_alpha_per_strategy%22%3A%220.00056818%22%2C%22eval_block_days%22%3A%228%22%2C%22eval_bootstrap_resamples%22%3A%2210000%22%2C%22eval_bootstrap_rng%22%3A%22draw%20k%20%3D%20the%20%28h%20mod%20n%29-th%20of%20the%20n%20non-empty%20blocks%20in%20increasing%20block%20index%2C%20h%20%3D%20int%28sha256%28bytes.fromhex%28seed%29%20%7C%7C%20k%20as%208%20big-endian%20bytes%29%5B%3A8%5D%2C%20big-endian%29%22%2C%22eval_bootstrap_seed%22%3A%2266358cdb0330b22c1c9183986cc083c7dee795a37f2394cf4312484e71fbbe78%22%2C%22eval_deadline_after_effective_ms%22%3A%2294608000000%22%2C%22eval_episodes%22%3A%2230%22%2C%22eval_excludes%22%3A%22late%20plans%2C%20unresolvable%20plans%22%2C%22eval_family_alpha%22%3A%220.05000000%22%2C%22eval_min_gap_bars%22%3A%2248%22%2C%22eval_one_sided_max_share%22%3A%220.75000000%22%2C%22eval_t_critical%22%3A%223.61127953%22%2C%22expected_loss_r_micro%22%3A%221100000%22%2C%22fee_tenth_bps%22%3A%2275%22%2C%22late_after_ms%22%3A%2260000%22%2C%22max_bars%22%3A%2248%22%2C%22max_cost_r_micro%22%3A%22200000%22%2C%22max_head_interval_ms%22%3A%223600000%22%2C%22max_skew_ms%22%3A%222000%22%2C%22min_risk_ticks%22%3A%222%22%2C%22roster%22%3A%5B%22candles.body_flow_20%22%2C%22candles.close_in_range%22%2C%22candles.doji_after_thrust%22%2C%22candles.engulfing_raw%22%2C%22candles.engulfing_trend%22%2C%22candles.hammer_oversold%22%2C%22candles.inside_bar_break%22%2C%22candles.marubozu_continuation%22%2C%22candles.outsized_wick%22%2C%22candles.range_expansion%22%2C%22candles.range_gap%22%2C%22candles.shooting_star_overbought%22%2C%22candles.three_directional_bars%22%2C%22flow.absorption_narrow_range%22%2C%22flow.chaikin_osc_3_10%22%2C%22flow.mfi14_extremes%22%2C%22flow.move_without_volume%22%2C%22flow.obv_divergence20%22%2C%22flow.obv_ema21%22%2C%22flow.obv_leads20%22%2C%22flow.roc20_unfiltered%22%2C%22flow.trend_with_participation%22%2C%22flow.volume_climax%22%2C%22flow.volume_thrust%22%2C%22flow.vwap_session_side%22%2C%22mean_reversion.bb20_2_fade%22%2C%22mean_reversion.bb20_2_range_adx14%22%2C%22mean_reversion.bb20_2_reentry%22%2C%22mean_reversion.bb20_2_volume_climax%22%2C%22mean_reversion.cci20_fade%22%2C%22mean_reversion.keltner20_atr14_fade%22%2C%22mean_reversion.rsi14_cardwell_sma200%22%2C%22mean_reversion.rsi14_fixed_3070%22%2C%22mean_reversion.streak3_fade%22%2C%22mean_reversion.stretch_ema200_atr14%22%2C%22mean_reversion.sweep_rejection_20%22%2C%22mean_reversion.willr14_fade%22%2C%22momentum.ao_confirms_extreme%22%2C%22momentum.ao_divergence_extreme%22%2C%22momentum.ao_sign%22%2C%22momentum.er_kaufman_filtered%22%2C%22momentum.kama_cross%22%2C%22momentum.linreg_acceleration%22%2C%22momentum.momentum_with_volume%22%2C%22momentum.roc10%22%2C%22momentum.roc_term_structure%22%2C%22momentum.sign_persistence%22%2C%22seasonality.post_monthly_expiry_long%22%2C%22seasonality.pre_quarterly_expiry_short%22%2C%22seasonality.turn_of_month_long%22%2C%22seasonality.weekend_short%22%2C%22structure.atr_buffered_break%22%2C%22structure.bos_swing%22%2C%22structure.choch%22%2C%22structure.compression_break%22%2C%22structure.donchian_55_exit_20%22%2C%22structure.donchian_break_20%22%2C%22structure.range_fade_swing%22%2C%22structure.retest_hold%22%2C%22structure.sweep_reversal_20%22%2C%22structure.swing_fade_unfiltered%22%2C%22structure.swing_trend_state%22%2C%22structure.volume_confirmed_break%22%2C%22trend.adx_dmi_14%22%2C%22trend.aroon_25%22%2C%22trend.donchian_turtle_55_20%22%2C%22trend.ema200_filter%22%2C%22trend.ema_cross_21_55%22%2C%22trend.ema_stack_21_55_200%22%2C%22trend.ichimoku_kumo%22%2C%22trend.linreg_slope_55_atr14%22%2C%22trend.macd_12_26_9%22%2C%22trend.psar_002_020%22%2C%22trend.supertrend_atr14_x3%22%2C%22volatility.bbw_pct_low_carry%22%2C%22volatility.chandelier_atr_trail%22%2C%22volatility.chandelier_fixed_pct%22%2C%22volatility.ema55_side_unfiltered%22%2C%22volatility.inside_bar_breakout%22%2C%22volatility.keltner_breakout%22%2C%22volatility.natr_high_regime_trend%22%2C%22volatility.natr_low_regime_trend%22%2C%22volatility.nr7_breakout%22%2C%22volatility.rs_vol_pct_high_carry%22%2C%22volatility.rs_vol_pct_high_fade%22%2C%22volatility.rs_vol_pct_low_carry%22%2C%22volatility.squeeze_bb_kc_release%22%2C%22volatility.wide_range_thrust%22%5D%2C%22signal_read%22%3A%22the%20last%20element%20of%20signals%28Series%20over%20the%20last%20signal_window_bars%20closed%20bars%2C%20ending%20at%20the%20decision%20bar%29%22%2C%22signal_window_bars%22%3A%221500%22%2C%22sl_atr%22%3A%221.50000000%22%2C%22slippage_tenth_bps%22%3A%2275%22%2C%22symbol%22%3A%22BTCUSDT%22%2C%22template_id%22%3A%22cat_k150_tp200_48b%22%2C%22tick_size_micro%22%3A%2210000%22%2C%22timeframe%22%3A%224h%22%2C%22tp_r%22%3A%222.00000000%22%7D\nparams_sha256=c161274b016daa2c67054893bdb2e0525bc12dc3554ec7acefab920fe1e9a8d5\nprimary_endpoint=FAMILY%3A%20the%20mean%20paired%20difference%2C%20plan%20minus%20control%2C%20pooled%20over%20the%20independent%20episodes%20of%20all%2088%20strategies%20entered%20before%20the%20deadline%20%28see%20the%20decision%20rule%29.%20Each%20arm%20is%20taken%20at%20endpoint_cost_multiplier%20times%20ITS%20OWN%20modelled%20cost%3A%20the%20R%20written%20for%20that%20arm%2C%20which%20is%20net%20of%20its%20cost%20once%2C%20minus%20%28endpoint_cost_multiplier%20-%201%29%20times%20that%20arm%27s%20cost_r%3B%20the%20paired%20difference%20is%20the%20plan%27s%20figure%20minus%20the%20control%27s.%20This%20is%20the%20primary%20endpoint%20because%20it%20is%20the%20one%20this%20record%20has%20the%20power%20to%20answer%3A%20did%20these%20strategies%2C%20as%20a%20family%2C%20choose%20sides%20better%20than%20a%20coin%3F%20SECONDARY%2C%20per%20strategy%3A%20the%20same%20mean%20over%20that%20strategy%27s%20first%2030%20independent%20episodes%2C%20with%20its%20own%20bound%3B%20it%20is%20reported%20for%20every%20strategy%20and%20it%20is%20underpowered%20by%20construction%20%28see%20the%20stopping%20rule%29.%20Never%20a%20hit%20rate%20alone%3A%20with%20the%20target%20at%20twice%20the%20risk%2C%20the%20hit%20rate%20needed%20to%20break%20even%20depends%20on%20cost%2C%20and%20expectancy%20already%20accounts%20for%20it.\ndecision_rule=FAMILY%20%28primary%29%2C%20evaluated%20once%3A%20pool%20every%20strategy%27s%20episodes%20that%20ENTERED%20BEFORE%20THE%20DEADLINE%20%28the%20episodes%20the%20per-strategy%20rule%20below%20selects%2C%20without%20its%20cap%20of%2030%29%2C%20ordered%20by%20entry%2C%20once%20every%20one%20of%20them%20has%20its%20outcome%20written.%20A%20family%20edge%20is%20reported%20only%20if%20the%20lower%20bound%20of%20a%20one-sided%2095%25%20cluster%20bootstrap%20over%20the%20pooled%20mean%20is%20above%20zero.%20The%20bootstrap%20resamples%20blocks%20of%20entry%20time%20with%20replacement.%20An%20episode%27s%20entry%20is%20its%20plan%27s%20fill%20time%20in%20milliseconds%3B%20its%20block%20index%20is%20%28entry%20-%20the%20earliest%20entry%20among%20the%20pooled%20episodes%29%20%2F%2F%20%28eval_block_days%20%2A%2086%2C400%2C000%29%3B%20and%20the%20blocks%20that%20hold%20at%20least%20one%20episode%2C%20taken%20in%20increasing%20index%2C%20are%20the%20n%20blocks.%20Each%20resample%20makes%20n%20draws%20and%20keeps%20every%20episode%20of%20each%20drawn%20block%20%28a%20block%20drawn%20twice%20counts%20twice%29%2C%20and%20the%20mean%20of%20all%20the%20episodes%20kept%20is%20one%20resampled%20mean.%20Over%20eval_bootstrap_resamples%20resamples%2C%20the%20lower%20bound%20is%20the%20resampled%20means%20sorted%20in%20increasing%20order%2C%20at%20zero-based%20index%20floor%28eval_family_alpha%20%2A%20eval_bootstrap_resamples%29.%20Its%20randomness%20is%20a%20committed%20counter%2C%20not%20a%20library%3A%20draw%20k%20picks%20the%20%28h%20mod%20n%29-th%20of%20the%20n%20blocks%2C%20counting%20from%20zero%2C%20where%20h%20is%20the%20first%208%20bytes%2C%20read%20big-endian%2C%20of%20the%20SHA-256%20of%20the%2032%20bytes%20eval_bootstrap_seed%20decodes%20to%20from%20hex%20followed%20by%20k%20as%208%20big-endian%20bytes%3B%20k%20counts%20from%200%20across%20the%20whole%20procedure%2C%20resample%20after%20resample%2C%20so%20any%20implementation%20in%20any%20language%20reproduces%20it%20exactly.%20Blocks%20are%208%20days%20wide%2C%20the%20longest%20a%20position%20can%20last%20%2848%20bars%2C%20the%20holding%20horizon%29%2C%20so%20an%20episode%20can%20overlap%20in%20time%20only%20episodes%20in%20its%20own%20block%20or%20an%20adjacent%20one%3B%20the%20size%20measured%20below%20includes%20that%20dependence.%20SECONDARY%2C%20per%20strategy.%20Episodes%3A%20a%20strategy%27s%20actionable%20plans%20in%20chain%20order.%20A%20plan%20qualifies%20when%20its%20row%20is%20not%20marked%20late%20%28late%20%3D%201%3B%20its%20control%20is%20written%20in%20the%20same%20transaction%20and%20shares%20the%20flag%29%20and%20both%20arms%20have%20an%20outcome%20written%20WITH%20a%20result%3B%20an%20outcome%20written%20as%20%27unresolvable%27%20or%20%27no_fill%27%20has%20none%20%28r_realized%20null%29.%20Late%20and%20result-less%20plans%20are%20never%20episodes%2C%20do%20not%20move%20the%20timing%20below%2C%20and%20are%20reported%20separately.%20The%20first%20qualifying%20plan%20is%20the%20first%20episode%3B%20each%20next%20episode%20is%20the%20first%20qualifying%20plan%20whose%20entry%20is%20at%20least%2048%20bars%20%28the%20holding%20horizon%3A%20entry%20minus%20the%20previous%20EPISODE%27s%20entry%20%3E%3D%2048%20%2A%20tf_ms%29%20after%20the%20previous%20episode%27s%20entry%2C%20so%20no%20two%20episodes%27%20positions%20overlap.%20Selection%20STOPS%20at%20the%20first%20plan%20that%20is%20not%20late%20and%20is%20far%20enough%20from%20the%20previous%20episode%20but%20has%20NO%20outcome%20row%20yet%20for%20one%20of%20its%20arms%20%28unlike%20an%20outcome%20written%20without%20a%20result%2C%20which%20is%20skipped%29%2C%20so%20an%20episode%20can%20never%20be%20inserted%20behind%20one%20already%20counted%20and%20no%20verdict%20can%20change%20afterwards.%20Statistic%3A%20the%20mean%20d%20and%20sample%20standard%20deviation%20s%20%28divisor%20n%20-%201%29%20of%20the%20paired%20differences%20over%20the%20first%2030%20episodes.%20Verdict%2C%20in%20this%20order%2C%20once%20there%20are%2030%3A%20if%20more%20than%2075%25%20of%20those%2030%20are%20on%20the%20same%20side%20%28a%20long%20share%20above%200.75%20or%20below%200.25%29%2C%20%27mostly%20one-sided%3A%20measures%20drift%27%2C%20with%20no%20forward-edge%20verdict%2C%20though%20it%20stays%20in%20the%20correction%3B%20otherwise%20a%20forward%20edge%20only%20if%20d%20-%20t_crit%20%2A%20s%20%2F%20sqrt%2830%29%20%3E%200%2C%20where%20t_crit%20is%20the%20one-sided%20Student%20t%20critical%20value%20with%2029%20degrees%20of%20freedom%20at%20level%201%20-%200.05%2F88%20%28sealed%20in%20params%20as%20eval_t_critical%29%3B%20otherwise%20no%20evidence%20of%20an%20edge%2C%20a%20positive%20estimate%20included.%20The%20mean%2C%20the%20long%20share%20and%2C%20at%2030%20episodes%2C%20the%20bound%20are%20reported%20for%20every%20strategy%20whatever%20its%20status%3B%20the%20status%20alone%20is%20the%20verdict.%20The%20committed%20verifier%27s%20evaluate%28%29%20and%20evaluate_family%28%29%20are%20the%20reference%20implementations%20of%20both%20rules%3B%20where%20they%20disagree%20with%20this%20text%2C%20this%20text%20governs.\nalpha=0.05000000\nmultiplicity_correction=The%20family%20endpoint%20is%20a%20SINGLE%20pre-registered%20test%20at%20one-sided%200.05%2C%20so%20it%20carries%20no%20multiplicity.%20The%20per-strategy%20endpoint%20is%20corrected%20by%20Bonferroni%20across%20the%2088%20strategies%20in%20this%20registration%3A%20a%20one-sided%20level%20of%200.05%2F88%20each.%20Conservative%20on%20purpose%3A%20a%20forward%20record%20that%20finds%20nothing%20under%20Bonferroni%20has%20told%20the%20truth%3B%20one%20that%20finds%20something%20under%20a%20lenient%20correction%20has%20probably%20found%20noise.%20Any%20analysis%20beyond%20these%20two%20is%20exploratory%20and%20will%20be%20labelled%20so.\nplanned_n=30\nstopping_rule=Per%20strategy%3A%20evaluated%20once%2C%20at%20its%2030th%20episode%20or%20at%20the%20evaluation%20deadline%20%28eval_deadline_after_effective_ms%3A%20three%20years%20after%20this%20registration%20takes%20effect%29%2C%20whichever%20comes%20first.%20The%20deadline%20has%20passed%20once%20the%20ledger%20holds%20a%20head%20published%20at%20or%20after%20it%3A%20the%20record%27s%20own%20clock%20decides%2C%20not%20a%20reader%27s.%20A%20strategy%20with%20fewer%20than%2030%20episodes%20entered%20before%20the%20deadline%2C%20once%20their%20outcomes%20are%20written%2C%20is%20reported%20as%20%27insufficient%20sample%27%2C%20gets%20no%20verdict%2C%20and%20stays%20in%20the%20correction%3B%20some%20signal%20rarely%20enough%20that%20they%20never%20will%20reach%2030.%20No%20interim%20look%20changes%20a%20verdict.%20The%20ledger%20keeps%20running%20after%3B%20later%20data%20is%20reported%20as%20a%20second%2C%20separately%20labelled%20period%20and%20never%20pooled%20into%20the%20first.%20The%20family%20endpoint%20is%20evaluated%20once%2C%20over%20every%20episode%20entered%20before%20the%20deadline%2C%20when%20the%20last%20of%20their%20outcomes%20is%20written%20%28at%20most%2048%20bars%20and%20the%20exchange%27s%20archive%20later%29.%20Entry%20time%20decides%2C%20not%20the%20time%20an%20outcome%20is%20written%2C%20because%20the%20operator%20writes%20the%20outcomes.%0A%0APOWER%2C%20measured%20on%20nine%20years%20of%204h%20bars%20under%20these%20exact%20rules%2C%20and%20stated%20so%20that%20a%20null%20is%20read%20correctly.%20The%20control%20draws%20a%20SIDE%2C%20so%20whenever%20the%20coin%20lands%20on%20the%20plan%27s%20own%20side%20the%20pair%20is%20the%20same%20trade%20and%20its%20difference%20is%20exactly%20zero%3A%20half%20the%20pairs%20carry%20no%20information.%20A%20strategy%27s%20ceiling%20is%20therefore%20half%20the%20mean%20distance%20between%20the%20two%20sides%27%20outcomes%20on%20the%20bars%20it%20trades.%20Over%20all%20plannable%20bars%20that%20distance%20is%202.00%20R%2C%20a%20ceiling%20of%201.00%20R%3B%20across%20the%2084%20strategies%20with%20enough%20signals%20to%20measure%20it%20runs%20from%200.88%20R%20to%201.09%20R.%20It%20is%203.00%20R%20on%20the%2063%25%20of%20bars%20where%20one%20side%20reaches%20its%20target%2C%20so%20a%20strategy%20that%20only%20ever%20traded%20those%20could%20in%20principle%20reach%201.50%20R.%20FAMILY%3A%20pooling%20the%20catalogue%27s%20own%20episodes%20over%20three%20years%20%28about%208%2C000%2C%20with%20the%20correlation%20the%20catalogue%27s%20signals%20actually%20have%29%2C%20the%20cluster%20bootstrap%20holds%20its%20size%20%286%25%20against%20a%20nominal%205%25%29%20and%20detects%20a%20common%20side%20accuracy%20of%2052%25%20%28%2B0.04%20R%20per%20episode%29%20about%2070%25%20of%20the%20time%2C%2053%25%20%28%2B0.06%20R%29%20about%2095%25%2C%20and%2051%25%20%28%2B0.02%20R%29%20about%20a%20third%20of%20the%20time.%20PER%20STRATEGY%3A%20the%2030-episode%20bound%20needs%20about%201.13%20R%2C%20which%20is%20at%20or%20above%20every%20measured%20ceiling%20in%20this%20roster%2C%20so%20perfect%20side-picking%20foresight%20would%20be%20flagged%20about%2060%25%20of%20the%20time%20and%2090%25%20side%20accuracy%20about%20a%20quarter%20of%20the%20time.%20The%20per-strategy%20test%20can%20therefore%20only%20flag%20effects%20larger%20than%20anything%20this%20geometry%20has%20produced%3B%20its%20nulls%20are%20not%20evidence%20of%20absence%2C%20and%20nothing%20on%20the%20page%20or%20in%20this%20record%20may%20present%20them%20as%20such.\ntrial_count_at_registration=238\neffective_from_ms=1790242821226\neffective_until_ms:null\n"} {"seq":3,"row_hash":"9dc651650da4a619c84fb13399444a1cafdc20b388e67cf183c2d5e4c7a057e1","body":"wavelab-journal-chain\nv=3\nseq=3\nprev=aecbcab4d27a93bea9634804647977506a87d9bb0a6cd0ae7fa7757772164f48\nkind=exit_template\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\ntemplate_id=cat_k150_tp200_48b\nprereg_seq=2\ncontents_json=%7B%22atr%22%3A%7B%22arithmetic%22%3A%22exact%20rationals%20over%20integer%20ticks%22%2C%22method%22%3A%22wilder%22%2C%22period%22%3A%2214%22%2C%22rounding%22%3A%22floor%20to%20whole%20ticks%20of%200.01%22%2C%22seed%22%3A%22mean%20of%20the%20first%20period%20true%20ranges%22%2C%22source_sha256%22%3A%229a9f22e4f8654ce7816d037eab982f683290e065d391d7af1b0b66ce6eaf0678%22%2C%22window_bars%22%3A%221500%22%2C%22window_ends_at%22%3A%22the%20decision%20bar%2C%20inclusive%22%7D%2C%22id%22%3A%22cat_k150_tp200_48b%22%2C%22max_bars%22%3A%2248%22%2C%22sl_atr_micro%22%3A%221500000%22%2C%22tp_r_micro%22%3A%222000000%22%7D\ncontents_sha256=8bf6573b094ca782dcb0d6ea833111ed99d645d2ccda985567b092b7d4d94229\nresolver_algorithm_id=triple_barrier_v1\nresolver_sha256=13caf230d895fac8f2dbf7aad134b4ccf264e68b8d357e03139c52409d1f0928\nresolver_source_uri=src%2Fwavelab%2Fstore%2Fresolve.py%23walk%2Cresolve_arm\nresolver_source_text=%23%20----%20wavelab.store.journal%0A%0A__name__%20%3D%20%27wavelab.store.journal%27%0A%0Adef%20_decimal%28v%3A%20Decimal%20%7C%20int%20%7C%20str%2C%20places%3A%20int%2C%20%2A%2C%20signed%3A%20bool%29%20-%3E%20str%3A%0A%20%20%20%20if%20isinstance%28v%2C%20%28bool%2C%20float%29%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20%28f%22%7Btype%28v%29.__name__%7D%20is%20not%20accepted%20here.%20A%20float%27s%20repr%20is%20the%20shortest%20string%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22that%20round-trips%20on%20this%20interpreter%2C%20so%20hashing%20it%20makes%20the%20row%27s%20hash%20depend%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22on%20a%20printer.%20Pass%20a%20Decimal%2C%20an%20int%2C%20or%20the%20exact%20string.%22%29%0A%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20d%20%3D%20Decimal%28v%29%0A%20%20%20%20except%20InvalidOperation%20as%20exc%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22%7Bv%21r%7D%20is%20not%20a%20decimal%22%29%20from%20exc%0A%20%20%20%20if%20not%20d.is_finite%28%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bv%21r%7D%20is%20not%20finite%3B%20a%20ledger%20row%20cannot%20carry%20NaN%20or%20Infinity%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20q%20%3D%20d.quantize%28Decimal%281%29.scaleb%28-places%29%29%0A%20%20%20%20if%20not%20signed%20and%20q%20%3C%200%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bv%21r%7D%20is%20negative%20where%20only%20unsigned%20values%20are%20accepted%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20s%20%3D%20f%22%7Bq%3Af%7D%22%0A%20%20%20%20if%20s.startswith%28%22-%22%29%20and%20Decimal%28s%29%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%23%20%60-0.00000000%60%20and%20%600.00000000%60%20are%20the%20same%20number%20and%20different%20bytes.%20One%20of%20them%20has%0A%20%20%20%20%20%20%20%20%23%20to%20be%20unrepresentable%20or%20two%20honest%20writers%20produce%20two%20different%20hashes%20for%20one%20row.%0A%20%20%20%20%20%20%20%20msg%20%3D%20%22negative%20zero%20is%20forbidden%3A%20it%20hashes%20differently%20from%20zero%20and%20means%20the%20same%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20return%20s%0A%0Adef%20dec8%28v%3A%20Decimal%20%7C%20int%20%7C%20str%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22Eight%20decimal%20places%2C%20signed.%20Raises%20TypeError%20on%20float%2C%20ValueError%20on%20-0.%22%22%22%0A%20%20%20%20return%20_decimal%28v%2C%208%2C%20signed%3DTrue%29%0A%0A%23%20----%20wavelab.store.resolve%0A%0AQ8%20%3D%20Decimal%28%271E-8%27%29%0A%0AROUND_CEILING%20%3D%20%27ROUND_CEILING%27%0A%0AROUND_FLOOR%20%3D%20%27ROUND_FLOOR%27%0A%0A%40dataclass%28frozen%3DTrue%2C%20slots%3DTrue%29%0Aclass%20Walk%3A%0A%20%20%20%20barrier%3A%20str%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20%27tp%27%20%7C%20%27sl%27%20%7C%20%27vertical%27%20%7C%20%27unresolvable%27%0A%20%20%20%20bars%3A%20int%20%7C%20None%0A%20%20%20%20gross_r%3A%20Decimal%20%7C%20None%0A%20%20%20%20mae_r%3A%20Decimal%20%7C%20None%0A%20%20%20%20mfe_r%3A%20Decimal%20%7C%20None%0A%20%20%20%20ambiguous%3A%20bool%0A%20%20%20%20reason%3A%20str%20%7C%20None%20%3D%20None%0A%0Adef%20resolve_arm%28w%3A%20Walk%2C%20cost_r%3A%20Decimal%29%20-%3E%20dict%3A%0A%20%20%20%20%22%22%22The%20walk%27s%20numbers%20as%20the%20row%20carries%20them%3A%20net%20of%20the%20arm%27s%20own%20cost%2C%20rounded%20against.%22%22%22%0A%20%20%20%20if%20w.barrier%20%3D%3D%20%22unresolvable%22%3A%0A%20%20%20%20%20%20%20%20return%20%7B%22barrier%22%3A%20%22unresolvable%22%2C%20%22r_realized%22%3A%20None%2C%20%22mae_r%22%3A%20None%2C%20%22mfe_r%22%3A%20None%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bars_to_resolve%22%3A%20None%2C%20%22intrabar_ambiguous%22%3A%200%2C%20%22unresolvable_reason%22%3A%20w.reason%7D%0A%20%20%20%20return%20%7B%0A%20%20%20%20%20%20%20%20%22barrier%22%3A%20w.barrier%2C%0A%20%20%20%20%20%20%20%20%22r_realized%22%3A%20J.dec8%28%28w.gross_r%20-%20cost_r%29.quantize%28Q8%2C%20rounding%3DROUND_FLOOR%29%29%2C%0A%20%20%20%20%20%20%20%20%22mae_r%22%3A%20J.dec8%28w.mae_r.quantize%28Q8%2C%20rounding%3DROUND_CEILING%29%29%2C%0A%20%20%20%20%20%20%20%20%22mfe_r%22%3A%20J.dec8%28w.mfe_r.quantize%28Q8%2C%20rounding%3DROUND_FLOOR%29%29%2C%0A%20%20%20%20%20%20%20%20%22bars_to_resolve%22%3A%20w.bars%2C%20%22intrabar_ambiguous%22%3A%20int%28w.ambiguous%29%2C%0A%20%20%20%20%20%20%20%20%22unresolvable_reason%22%3A%20None%2C%0A%20%20%20%20%7D%0A%0Adef%20walk%28%2A%2C%20direction%3A%20int%2C%20entry%3A%20Decimal%2C%20stop%3A%20Decimal%2C%20target%3A%20Decimal%2C%0A%20%20%20%20%20%20%20%20%20bars%3A%20Sequence%5BA.Kline%5D%2C%20first_open_ms%3A%20int%2C%20tf_ms%3A%20int%2C%20max_bars%3A%20int%29%20-%3E%20Walk%3A%0A%20%20%20%20%22%22%22The%20triple%20barrier%20over%20exactly%20%60max_bars%60%20bars%20opening%20at%20%60first_open_ms%60%2C%20in%20order.%0A%0A%20%20%20%20A%20bar%20that%20touches%20both%20barriers%20resolves%20to%20the%20STOP%20%28%60pessimistic_sl%60%29%3A%20the%204h%20archive%20cannot%0A%20%20%20%20say%20which%20came%20first%2C%20and%20a%20rule%20that%20needs%20finer%20data%20would%20need%20data%20a%20verifier%20may%20lack.%0A%20%20%20%20A%20bar%20missing%20from%20the%20archive%20before%20any%20barrier%20is%20touched%20makes%20the%20arm%20UNRESOLVABLE%2C%20with%0A%20%20%20%20the%20missing%20bar%20named%3A%20after%20it%2C%20nothing%20that%20follows%20can%20be%20scored%20honestly.%0A%20%20%20%20%22%22%22%0A%20%20%20%20long%20%3D%20direction%20%3D%3D%201%0A%20%20%20%20risk%20%3D%20abs%28entry%20-%20stop%29%0A%20%20%20%20if%20risk%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20Walk%28%22unresolvable%22%2C%20None%2C%20None%2C%20None%2C%20None%2C%20False%2C%20%22zero%20risk%3A%20entry%20equals%20stop%22%29%0A%20%20%20%20by_open%20%3D%20%7Bk.open_ms%3A%20k%20for%20k%20in%20bars%7D%0A%20%20%20%20mae%20%3D%20mfe%20%3D%20Decimal%280%29%0A%20%20%20%20for%20i%20in%20range%28max_bars%29%3A%0A%20%20%20%20%20%20%20%20t%20%3D%20first_open_ms%20%2B%20i%20%2A%20tf_ms%0A%20%20%20%20%20%20%20%20k%20%3D%20by_open.get%28t%29%0A%20%20%20%20%20%20%20%20if%20k%20is%20None%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20Walk%28%22unresolvable%22%2C%20None%2C%20None%2C%20None%2C%20None%2C%20False%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22the%20archive%20has%20no%20bar%20opening%20at%20%7Bt%7D%22%29%0A%20%20%20%20%20%20%20%20fav%20%3D%20%28k.high%20-%20entry%29%20if%20long%20else%20%28entry%20-%20k.low%29%0A%20%20%20%20%20%20%20%20adv%20%3D%20%28entry%20-%20k.low%29%20if%20long%20else%20%28k.high%20-%20entry%29%0A%20%20%20%20%20%20%20%20mfe%20%3D%20max%28mfe%2C%20fav%20%2F%20risk%29%0A%20%20%20%20%20%20%20%20mae%20%3D%20max%28mae%2C%20adv%20%2F%20risk%29%0A%20%20%20%20%20%20%20%20hits_tp%20%3D%20k.high%20%3E%3D%20target%20if%20long%20else%20k.low%20%3C%3D%20target%0A%20%20%20%20%20%20%20%20hits_sl%20%3D%20k.low%20%3C%3D%20stop%20if%20long%20else%20k.high%20%3E%3D%20stop%0A%20%20%20%20%20%20%20%20if%20hits_tp%20and%20hits_sl%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20Walk%28%22sl%22%2C%20i%20%2B%201%2C%20Decimal%28-1%29%2C%20mae%2C%20mfe%2C%20True%29%0A%20%20%20%20%20%20%20%20if%20hits_tp%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20Walk%28%22tp%22%2C%20i%20%2B%201%2C%20abs%28target%20-%20entry%29%20%2F%20risk%2C%20mae%2C%20mfe%2C%20False%29%0A%20%20%20%20%20%20%20%20if%20hits_sl%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20Walk%28%22sl%22%2C%20i%20%2B%201%2C%20Decimal%28-1%29%2C%20mae%2C%20mfe%2C%20False%29%0A%20%20%20%20last%20%3D%20by_open%5Bfirst_open_ms%20%2B%20%28max_bars%20-%201%29%20%2A%20tf_ms%5D%0A%20%20%20%20return%20Walk%28%22vertical%22%2C%20max_bars%2C%20direction%20%2A%20%28last.close%20-%20entry%29%20%2F%20risk%2C%20mae%2C%20mfe%2C%20False%29%0A\natr_source_text=%23%20----%20wavelab.engine.emit%0A%0ATICK_MICRO%20%3D%2010000%0A%0Adef%20wilder_atr_ticks%28high%3A%20np.ndarray%2C%20low%3A%20np.ndarray%2C%20close%3A%20np.ndarray%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20period%3A%20int%20%3D%20ATR_PERIOD%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22Wilder%27s%20ATR%20on%20the%20last%20bar%2C%20in%20EXACT%20rational%20arithmetic%20over%20integer%20ticks%2C%20floored.%0A%0A%20%20%20%20Exact%20because%20the%20stop%20is%20published%20and%20a%20verifier%20in%20another%20language%20must%20land%20on%20the%20same%0A%20%20%20%20tick.%20In%20floats%20it%20would%20not%20reliably%3A%20numpy%20sums%20pairwise%2C%20a%20plain%20loop%20sums%20left%20to%20right%2C%0A%20%20%20%20and%20the%20last%20bits%20they%20disagree%20on%20can%20flip%20a%20floor.%20Over%20rationals%20there%20is%20one%20answer%0A%20%20%20%20%28~5%20ms%20for%201500%20bars%29.%20Floored%2C%20because%20a%20smaller%20ATR%20puts%20the%20stop%20closer%20and%20makes%20each%20R%0A%20%20%20%20dearer%20%E2%80%94%20against%20the%20record%2C%20like%20every%20other%20rounding%20in%20the%20plan.%0A%0A%20%20%20%20Seeded%20with%20the%20mean%20of%20the%20first%20%60period%60%20true%20ranges%20in%20the%20window%2C%20as%20TA-Lib%20does%2C%20so%20it%0A%20%20%20%20agrees%20with%20TA-Lib%20to%20within%20a%20tick%3B%20the%20window%20is%20fixed%20%28%60WINDOW_BARS%60%29%2C%20so%20the%20seed%20is%20too.%0A%20%20%20%20%22%22%22%0A%20%20%20%20if%20len%28close%29%20%3C%3D%20period%3A%0A%20%20%20%20%20%20%20%20return%200%0A%20%20%20%20h%2C%20lo%2C%20c%20%3D%20%28%5Bto_ticks_exact%28float%28x%29%2C%20TICK_MICRO%29%20for%20x%20in%20a%5D%20for%20a%20in%20%28high%2C%20low%2C%20close%29%29%0A%20%20%20%20tr%20%3D%20%5Bmax%28h%5Bi%5D%20-%20lo%5Bi%5D%2C%20abs%28h%5Bi%5D%20-%20c%5Bi%20-%201%5D%29%2C%20abs%28lo%5Bi%5D%20-%20c%5Bi%20-%201%5D%29%29%0A%20%20%20%20%20%20%20%20%20%20for%20i%20in%20range%281%2C%20len%28c%29%29%5D%0A%20%20%20%20atr%20%3D%20Fraction%28sum%28tr%5B%3Aperiod%5D%29%2C%20period%29%0A%20%20%20%20for%20x%20in%20tr%5Bperiod%3A%5D%3A%0A%20%20%20%20%20%20%20%20atr%20%3D%20%28atr%20%2A%20%28period%20-%201%29%20%2B%20x%29%20%2F%20period%0A%20%20%20%20return%20math.floor%28atr%29%0A%0A%23%20----%20wavelab.engine.plan_generic%0A%0AMICRO%20%3D%201000000%0A%0A_GRID_TOLERANCE%20%3D%201e-06%0A%0Adef%20to_ticks_exact%28price%3A%20float%2C%20tick_micro%3A%20int%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22A%20price%20as%20integer%20ticks%2C%20or%20ValueError%20if%20it%20is%20not%20on%20the%20grid.%20Never%20rounds.%22%22%22%0A%20%20%20%20if%20price%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22price%20%7Bprice%7D%20is%20not%20positive%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20ticks%20%3D%20price%20%2A%20MICRO%20%2F%20tick_micro%0A%20%20%20%20nearest%20%3D%20round%28ticks%29%0A%20%20%20%20if%20abs%28ticks%20-%20nearest%29%20%3E%20_GRID_TOLERANCE%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22price%20%7Bprice%7D%20is%20not%20on%20the%20%7Btick_micro%20%2F%20MICRO%7D%20tick%20grid%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20return%20nearest%0A\nresolver_features_json=%7B%22breakeven%22%3A%22none%22%2C%22trail%22%3A%22none%22%7D\ntp_r=2.00000000\nmax_bars=48\ntrail=none\nbreakeven_after_r:null\ntie_break_policy=pessimistic_sl\nvertical_exit=close_at_market\n"} {"seq":4,"row_hash":"0e9528dc311d031191a9599008a534d22386df18f5d91b84d0aa090ae94dd4c2","body":"wavelab-journal-chain\nv=3\nseq=4\nprev=9dc651650da4a619c84fb13399444a1cafdc20b388e67cf183c2d5e4c7a057e1\nkind=cost_model\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\ncost_model_id=binance_spot_taker_v1\nprereg_seq=2\ncontents_json=%7B%22fee_tenth_bps%22%3A%2275%22%2C%22id%22%3A%22binance_spot_taker_v1%22%2C%22non_fee_tenth_bps%22%3A%2275%22%2C%22note%22%3A%22fee_bps_per_side%20is%20Binance%27s%20VIP0%20spot%20taker%20rate%20with%20the%20BNB%20fee%20discount%20%280.075%25%29%3B%20without%20the%20discount%20it%20is%200.10%25.%20spread_bps%20is%20the%20ASSUMED%20per-side%20non-fee%20cost%2C%20INCLUSIVE%20of%20half-spread%20and%20slippage%2C%20so%20slippage_bps%20is%20zero%20rather%20than%20double-counted%3B%20at%207.5%20bps%20it%20is%20far%20above%20BTCUSDT%27s%20usual%20one-tick%20spread%2C%20so%20the%2015%20bps%20charged%20per%20side%20exceeds%20the%20undiscounted%20fee%20plus%20a%20realistic%20spread.%20Not%20measured%3A%20nothing%20in%20this%20tree%20stores%20bid%2Fask%2C%20and%20a%20measured%20spread%20would%20make%20the%20ledger%20unverifiable%20from%20the%20free%20archives.%22%7D\ncontents_sha256=01891cc593eb1e7b4d3709a87faf88a7de48100a54cb5431c5d7303b5fa06268\ninstrument_class=spot\nfee_bps_per_side=7.5000\nspread_bps=7.5000\nslippage_bps=0.0000\nfunding_bps_per_day=0.0000\nspread_basis=assumed_constant\nspread_evidence_uri:null\nspread_evidence_sha256:null\nspread_measured_from_ms:null\nspread_measured_to_ms:null\n"} {"seq":5,"row_hash":"6e7eb4454113d2ed3e19a8946c26f2b8f968bf88b26babe74b5f1c57c4dfd301","body":"wavelab-journal-chain\nv=3\nseq=5\nprev=0e9528dc311d031191a9599008a534d22386df18f5d91b84d0aa090ae94dd4c2\nkind=fill_rule\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nfill_rule_id=market_on_close_v1\nprereg_seq=2\ncontents_json=%7B%22basis%22%3A%22market_on_close%22%2C%22entry%22%3A%22the%20close%20of%20the%20last%20CLOSED%20bar%22%2C%22id%22%3A%22market_on_close_v1%22%7D\ncontents_sha256=420ade1a124339598228a8a59ee3ceea966c75110843a94fa80d5762d49cbe4a\nbasis=market_on_close\nzone_side:null\nvalid_bars:null\nsource_uri=src%2Fwavelab%2Fengine%2Fplan_generic.py%23build_catalogue_plan\nsource_sha256=1d0e59397e5a6aebbe618990026c54f0d749c83a97022048a059ace9f64e15dc\nsource_text=%23%20----%20wavelab.engine.plan_generic%0A%0A%40dataclass%28frozen%3DTrue%2C%20slots%3DTrue%29%0Aclass%20CataloguePlan%3A%0A%20%20%20%20%22%22%22Every%20published%20number.%20Nothing%20is%20recomputed%20downstream%2C%20because%20a%20resolver%20that%20has%20to%0A%20%20%20%20recompute%20is%20a%20resolver%20that%20can%20disagree.%0A%0A%20%20%20%20Populated%20on%20refusals%20too%2C%20as%20far%20as%20it%20is%20computable.%20%60cost_over_cap%60%20refuses%2013%25%20of%20all%204h%0A%20%20%20%20bars%20and%2025%25%20of%20the%20last%20two%20years%2C%20and%20a%20refusal%20nobody%20can%20check%20is%20the%20largest%20unaudited%0A%20%20%20%20surface%20in%20the%20ledger.%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20state%3A%20str%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20%22planned%22%20%7C%20%22flat%22%20%7C%20%22refused%22%0A%20%20%20%20refusal%3A%20RefusalCode%20%7C%20None%0A%20%20%20%20direction%3A%20int%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20-1%20%7C%200%20%7C%20%2B1%0A%20%20%20%20entry_ticks%3A%20int%20%7C%20None%0A%20%20%20%20stop_ticks%3A%20int%20%7C%20None%0A%20%20%20%20target_ticks%3A%20int%20%7C%20None%0A%20%20%20%20risk_ticks%3A%20int%20%7C%20None%0A%20%20%20%20atr_ticks%3A%20int%20%7C%20None%0A%20%20%20%20tp_r_micro%3A%20int%20%7C%20None%20%20%20%20%20%20%20%20%20%20%20%20%23%20recomputed%20from%20the%20ROUNDED%20prices%2C%20floored%0A%20%20%20%20cost_r_micro%3A%20int%20%7C%20None%20%20%20%20%20%20%20%20%20%20%23%20the%20dearer%20leg%2C%20ceilinged%0A%20%20%20%20p_required_micro%3A%20int%20%7C%20None%0A%20%20%20%20template_id%3A%20str%0A%20%20%20%20max_bars%3A%20int%0A%0A%40dataclass%28frozen%3DTrue%2C%20slots%3DTrue%29%0Aclass%20CostModel%3A%0A%20%20%20%20%22%22%22What%20a%20retail%20taker%20on%20Binance%20spot%20pays%2C%20per%20side%2C%20in%20tenths%20of%20a%20basis%20point.%0A%0A%20%20%20%20%60slippage_bps_per_side%60%20is%20INCLUSIVE%20of%20the%20half-spread%20and%20of%20the%20price%20moving%20while%20a%20market%0A%20%20%20%20order%20crosses.%20Naming%20it%20per-side%20and%20inclusive%20removes%20the%20half-versus-full-spread%20ambiguity%20%E2%80%94%0A%20%20%20%20and%20an%20ambiguity%20inside%20a%20hash%20chain%20is%20permanent%20too.%0A%0A%20%20%20%207.5%20bps%20is%20not%20measured%3A%20nothing%20in%20this%20tree%20stores%20bid%2Fask%2C%20and%20a%20measured%20spread%20would%20make%0A%20%20%20%20the%20ledger%20unverifiable%20from%20the%20free%20archives.%20It%20is%20the%20difference%20between%20this%20repository%27s%0A%20%20%20%20two%20disagreeing%20cost%20models%20%E2%80%94%20projection.py%20charged%2015%20bps%20round%20trip%2C%20battery.py%2030%20%E2%80%94%20i.e.%20the%0A%20%20%20%20non-fee%20cost%20this%20project%20was%20already%20charging%20in%20one%20place%20and%20not%20the%20other.%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20tick_size_micro%3A%20int%20%3D%2010_000%20%20%20%20%20%20%20%20%20%20%23%200.01%20USDT%0A%20%20%20%20fee_tenth_bps%3A%20int%20%3D%2075%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%207.5%20bps%20taker%0A%20%20%20%20slippage_tenth_bps%3A%20int%20%3D%2075%20%20%20%20%20%20%20%20%20%20%20%23%207.5%20bps%2C%20spread-inclusive%0A%20%20%20%20max_cost_r_micro%3A%20int%20%3D%20200_000%20%20%20%20%20%20%20%20%23%200.20%20R%0A%20%20%20%20expected_loss_r_micro%3A%20int%20%3D%201_100_000%0A%20%20%20%20ev_min_r_micro%3A%20int%20%3D%20150_000%0A%0AMICRO%20%3D%201000000%0A%0AMIN_RISK_TICKS%20%3D%202%0A%0Aclass%20RefusalCode%28StrEnum%29%3A%0A%20%20%20%20%22%22%22Why%20a%20bar%20produced%20no%20plan.%20Each%20is%20a%20published%20row%20with%20the%20numbers%20that%20justify%20it.%22%22%22%0A%0A%20%20%20%20NO_ATR%20%3D%20%22no_atr%22%0A%20%20%20%20PRICE_OFF_GRID%20%3D%20%22price_off_grid%22%0A%20%20%20%20RISK_BELOW_TICK_FLOOR%20%3D%20%22risk_below_tick_floor%22%0A%20%20%20%20COST_OVER_CAP%20%3D%20%22cost_over_cap%22%0A%0A_GRID_TOLERANCE%20%3D%201e-06%0A%0Adef%20_ceil_div%28a%3A%20int%2C%20b%3A%20int%29%20-%3E%20int%3A%0A%20%20%20%20return%20-%28%28-a%29%20%2F%2F%20b%29%0A%0Adef%20_shell%28state%3A%20str%2C%20refusal%3A%20RefusalCode%20%7C%20None%2C%20direction%3A%20int%2C%20tmpl%3A%20CatalogueTemplate%2C%0A%20%20%20%20%20%20%20%20%20%20%20entry%3A%20int%20%7C%20None%2C%20atr%3A%20int%20%7C%20None%2C%20cost%3A%20int%20%7C%20None%20%3D%20None%29%20-%3E%20CataloguePlan%3A%0A%20%20%20%20return%20CataloguePlan%28state%2C%20refusal%2C%20direction%2C%20entry%2C%20None%2C%20None%2C%20None%2C%20atr%2C%20None%2C%20cost%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20None%2C%20tmpl.id%2C%20tmpl.max_bars%29%0A%0Adef%20build_catalogue_plan%28%2A%2C%20direction%3A%20int%2C%20entry_price%3A%20float%2C%20atr_ticks%3A%20int%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tmpl%3A%20CatalogueTemplate%20%3D%20CAT_K150_TP200_48B%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cost%3A%20CostModel%20%7C%20None%20%3D%20None%29%20-%3E%20CataloguePlan%3A%0A%20%20%20%20%22%22%22The%20plan%20for%20one%20signal%20on%20one%20bar.%20Integer%20arithmetic%20throughout.%22%22%22%0A%20%20%20%20if%20direction%20not%20in%20%28-1%2C%200%2C%201%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22direction%20must%20be%20-1%2C%200%20or%20%2B1%2C%20got%20%7Bdirection%21r%7D%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20cm%20%3D%20cost%20or%20CostModel%28%29%0A%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20entry%20%3D%20to_ticks_exact%28entry_price%2C%20cm.tick_size_micro%29%0A%20%20%20%20except%20ValueError%3A%0A%20%20%20%20%20%20%20%20return%20_shell%28%22refused%22%2C%20RefusalCode.PRICE_OFF_GRID%2C%20direction%2C%20tmpl%2C%20None%2C%20atr_ticks%29%0A%0A%20%20%20%20if%20direction%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%23%20A%20published%20no-trade%3A%20a%20CLAIM%2C%20not%20a%20refusal.%20It%20still%20carries%20its%20entry%20and%20ATR.%0A%20%20%20%20%20%20%20%20return%20_shell%28%22flat%22%2C%20None%2C%200%2C%20tmpl%2C%20entry%2C%20atr_ticks%29%0A%0A%20%20%20%20%23%20Wilder%20ATR%20returns%20a%20real%200.0%20over%20a%20flat%20series%20rather%20than%20None.%20Everything%20below%20is%0A%20%20%20%20%23%20measured%20in%20ATRs%2C%20so%20with%20no%20ATR%20there%20is%20nothing%20to%20measure%20against.%0A%20%20%20%20if%20atr_ticks%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20_shell%28%22refused%22%2C%20RefusalCode.NO_ATR%2C%20direction%2C%20tmpl%2C%20entry%2C%20atr_ticks%29%0A%0A%20%20%20%20risk%20%3D%20%28tmpl.sl_atr_micro%20%2A%20atr_ticks%29%20%2F%2F%20MICRO%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20FLOOR%3A%20stop%20closer%0A%20%20%20%20if%20risk%20%3C%20MIN_RISK_TICKS%3A%0A%20%20%20%20%20%20%20%20return%20_shell%28%22refused%22%2C%20RefusalCode.RISK_BELOW_TICK_FLOOR%2C%20direction%2C%20tmpl%2C%20entry%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20atr_ticks%29%0A%0A%20%20%20%20s%20%3D%20direction%0A%20%20%20%20stop%20%3D%20entry%20-%20s%20%2A%20risk%0A%20%20%20%20reward%20%3D%20_ceil_div%28tmpl.tp_r_micro%20%2A%20risk%2C%20MICRO%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20CEIL%3A%20target%20further%0A%20%20%20%20target%20%3D%20entry%20%2B%20s%20%2A%20reward%0A%20%20%20%20if%20stop%20%3C%3D%200%20or%20target%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20_shell%28%22refused%22%2C%20RefusalCode.RISK_BELOW_TICK_FLOOR%2C%20direction%2C%20tmpl%2C%20entry%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20atr_ticks%29%0A%0A%20%20%20%20tp_r%20%3D%20%28reward%20%2A%20MICRO%29%20%2F%2F%20risk%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20FLOOR%2C%20from%20rounded%20prices%0A%0A%20%20%20%20%23%20EACH%20LEG%20AT%20ITS%20OWN%20NOTIONAL.%20projection.py%20charged%20both%20legs%20at%20the%20entry%27s%20notional%2C%20which%0A%20%20%20%20%23%20understates%20a%20winning%20long%27s%20exit%20fee%20%E2%80%94%20always%20in%20the%20flattering%20direction.%20The%20rate%20is%0A%20%20%20%20%23%20dimensionless%20and%20both%20terms%20are%20in%20ticks%2C%20so%20the%20ticks%20cancel.%20%60max%60%20takes%20the%20dearer%20leg%3A%0A%20%20%20%20%23%20the%20target%20for%20a%20long%2C%20the%20stop%20for%20a%20short.%0A%20%20%20%20rate%20%3D%20cm.fee_tenth_bps%20%2B%20cm.slippage_tenth_bps%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20tenths%20of%20a%20bp%2C%20per%20side%0A%0A%20%20%20%20def%20leg%28exit_ticks%3A%20int%29%20-%3E%20int%3A%0A%20%20%20%20%20%20%20%20%23%20ceil%28%20rate%2F1e5%20%2A%20%28entry%20%2B%20exit%29%20%2F%20risk%20%2A%201e6%20%29%0A%20%20%20%20%20%20%20%20return%20_ceil_div%28rate%20%2A%20%28entry%20%2B%20exit_ticks%29%20%2A%2010%2C%20risk%29%0A%0A%20%20%20%20cost_r%20%3D%20max%28leg%28stop%29%2C%20leg%28target%29%29%0A%20%20%20%20if%20cost_r%20%3E%20cm.max_cost_r_micro%3A%0A%20%20%20%20%20%20%20%20%23%20The%20FULL%20geometry%20travels%20with%20a%20cost%20refusal.%20It%20is%20published%20as%20%60watch%60%20with%20reason%0A%20%20%20%20%20%20%20%20%23%20cost_above_max%2C%20and%20a%20reader%20checking%20that%20the%20refusal%20was%20right%20needs%20the%20stop%2C%20the%0A%20%20%20%20%20%20%20%20%23%20target%20and%20the%20risk%20it%20was%20computed%20from%20%E2%80%94%20a%20code%20without%20its%20numbers%20is%20unauditable%2C%0A%20%20%20%20%20%20%20%20%23%20and%20this%20refusal%20turns%20away%20a%20quarter%20of%20recent%20bars.%0A%20%20%20%20%20%20%20%20return%20CataloguePlan%28%22refused%22%2C%20RefusalCode.COST_OVER_CAP%2C%20s%2C%20entry%2C%20stop%2C%20target%2C%20risk%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20atr_ticks%2C%20tp_r%2C%20cost_r%2C%20None%2C%20tmpl.id%2C%20tmpl.max_bars%29%0A%0A%20%20%20%20%23%20p_required%20%3D%20%28L%20%2B%20c%20%2B%20EV_min%29%20%2F%20%28RR%20%2B%20L%29%2C%20ceilinged%2C%20with%20the%20floored%20RR%20underneath%3A%20both%0A%20%20%20%20%23%20push%20the%20hit%20rate%20the%20plan%20needs%20UP%2C%20which%20is%20the%20direction%20that%20does%20not%20flatter%20it.%0A%20%20%20%20p_req%20%3D%20_ceil_div%28%28cm.expected_loss_r_micro%20%2B%20cost_r%20%2B%20cm.ev_min_r_micro%29%20%2A%20MICRO%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tp_r%20%2B%20cm.expected_loss_r_micro%29%0A%0A%20%20%20%20return%20CataloguePlan%28%22planned%22%2C%20None%2C%20s%2C%20entry%2C%20stop%2C%20target%2C%20risk%2C%20atr_ticks%2C%20tp_r%2C%20cost_r%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p_req%2C%20tmpl.id%2C%20tmpl.max_bars%29%0A%0Adef%20to_ticks_exact%28price%3A%20float%2C%20tick_micro%3A%20int%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22A%20price%20as%20integer%20ticks%2C%20or%20ValueError%20if%20it%20is%20not%20on%20the%20grid.%20Never%20rounds.%22%22%22%0A%20%20%20%20if%20price%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22price%20%7Bprice%7D%20is%20not%20positive%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20ticks%20%3D%20price%20%2A%20MICRO%20%2F%20tick_micro%0A%20%20%20%20nearest%20%3D%20round%28ticks%29%0A%20%20%20%20if%20abs%28ticks%20-%20nearest%29%20%3E%20_GRID_TOLERANCE%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22price%20%7Bprice%7D%20is%20not%20on%20the%20%7Btick_micro%20%2F%20MICRO%7D%20tick%20grid%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20return%20nearest%0A%0A%23%20----%20wavelab.store.journal%0A%0A__name__%20%3D%20%27wavelab.store.journal%27%0A%0Adef%20_decimal%28v%3A%20Decimal%20%7C%20int%20%7C%20str%2C%20places%3A%20int%2C%20%2A%2C%20signed%3A%20bool%29%20-%3E%20str%3A%0A%20%20%20%20if%20isinstance%28v%2C%20%28bool%2C%20float%29%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20%28f%22%7Btype%28v%29.__name__%7D%20is%20not%20accepted%20here.%20A%20float%27s%20repr%20is%20the%20shortest%20string%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22that%20round-trips%20on%20this%20interpreter%2C%20so%20hashing%20it%20makes%20the%20row%27s%20hash%20depend%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22on%20a%20printer.%20Pass%20a%20Decimal%2C%20an%20int%2C%20or%20the%20exact%20string.%22%29%0A%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20d%20%3D%20Decimal%28v%29%0A%20%20%20%20except%20InvalidOperation%20as%20exc%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22%7Bv%21r%7D%20is%20not%20a%20decimal%22%29%20from%20exc%0A%20%20%20%20if%20not%20d.is_finite%28%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bv%21r%7D%20is%20not%20finite%3B%20a%20ledger%20row%20cannot%20carry%20NaN%20or%20Infinity%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20q%20%3D%20d.quantize%28Decimal%281%29.scaleb%28-places%29%29%0A%20%20%20%20if%20not%20signed%20and%20q%20%3C%200%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bv%21r%7D%20is%20negative%20where%20only%20unsigned%20values%20are%20accepted%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20s%20%3D%20f%22%7Bq%3Af%7D%22%0A%20%20%20%20if%20s.startswith%28%22-%22%29%20and%20Decimal%28s%29%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%23%20%60-0.00000000%60%20and%20%600.00000000%60%20are%20the%20same%20number%20and%20different%20bytes.%20One%20of%20them%20has%0A%20%20%20%20%20%20%20%20%23%20to%20be%20unrepresentable%20or%20two%20honest%20writers%20produce%20two%20different%20hashes%20for%20one%20row.%0A%20%20%20%20%20%20%20%20msg%20%3D%20%22negative%20zero%20is%20forbidden%3A%20it%20hashes%20differently%20from%20zero%20and%20means%20the%20same%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20return%20s%0A%0Adef%20cjson%28obj%3A%20Mapping%20%7C%20Sequence%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22Canonical%20JSON%3A%20keys%20sorted%2C%20no%20whitespace%2C%20and%20NO%20JSON%20NUMBERS%20ANYWHERE.%0A%0A%20%20%20%20Every%20number%20is%20a%20string%20produced%20by%20%60dec8%60%2F%60dec4%60%2F%60i64%60%20before%20it%20gets%20here.%20A%20JSON%20number%20in%0A%20%20%20%20the%20tree%20would%20be%20serialised%20by%20the%20json%20module%27s%20float%20printer%2C%20which%20is%20the%20one%20thing%20the%0A%20%20%20%20whole%20serialisation%20exists%20to%20keep%20out%20of%20the%20hashed%20bytes.%0A%20%20%20%20%22%22%22%0A%20%20%20%20def%20check%28node%3A%20object%2C%20path%3A%20str%29%20-%3E%20None%3A%0A%20%20%20%20%20%20%20%20if%20isinstance%28node%2C%20bool%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bpath%7D%3A%20booleans%20are%20not%20accepted%3B%20encode%20as%20the%20string%20%270%27%20or%20%271%27%22%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20%20%20%20%20if%20isinstance%28node%2C%20%28int%2C%20float%29%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20msg%20%3D%20%28f%22%7Bpath%7D%3A%20a%20JSON%20number%20reached%20canonical%20JSON.%20Encode%20it%20with%20dec8%2Fdec4%2Fi64%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22first%20%E2%80%94%20the%20hashed%20bytes%20must%20not%20depend%20on%20a%20number%20printer.%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20%20%20%20%20if%20isinstance%28node%2C%20dict%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20k%2C%20v%20in%20node.items%28%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20isinstance%28k%2C%20str%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28f%22%7Bpath%7D%3A%20object%20keys%20must%20be%20strings%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20check%28v%2C%20f%22%7Bpath%7D.%7Bk%7D%22%29%0A%20%20%20%20%20%20%20%20elif%20isinstance%28node%2C%20%28list%2C%20tuple%29%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20i%2C%20v%20in%20enumerate%28node%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20check%28v%2C%20f%22%7Bpath%7D%5B%7Bi%7D%5D%22%29%0A%20%20%20%20%20%20%20%20elif%20node%20is%20not%20None%20and%20not%20isinstance%28node%2C%20str%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28f%22%7Bpath%7D%3A%20%7Btype%28node%29.__name__%7D%20is%20not%20serialisable%20here%22%29%0A%0A%20%20%20%20check%28obj%2C%20%22%24%22%29%0A%20%20%20%20return%20json.dumps%28obj%2C%20sort_keys%3DTrue%2C%20separators%3D%28%22%2C%22%2C%20%22%3A%22%29%2C%20ensure_ascii%3DFalse%29%0A%0Adef%20dec8%28v%3A%20Decimal%20%7C%20int%20%7C%20str%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22Eight%20decimal%20places%2C%20signed.%20Raises%20TypeError%20on%20float%2C%20ValueError%20on%20-0.%22%22%22%0A%20%20%20%20return%20_decimal%28v%2C%208%2C%20signed%3DTrue%29%0A%0A%23%20----%20wavelab.store.ledger%0A%0A%20%20%20%20def%20_verdict%28self%2C%20signal%3A%20int%20%7C%20BaseException%2C%20bar%3A%20BarInput%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20state%3A%20EngineState%29%20-%3E%20tuple%5Bdict%2C%20object%5D%3A%0A%20%20%20%20%20%20%20%20%22%22%22The%20verdict%20columns%20for%20one%20strategy%20on%20one%20bar%2C%20and%20the%20plan%20if%20there%20is%20one.%0A%0A%20%20%20%20%20%20%20%20The%20ORDER%20of%20the%20checks%20is%20the%20order%20of%20precedence%2C%20and%20it%20is%20deliberate%3A%20a%20bar%20the%20engine%0A%20%20%20%20%20%20%20%20was%20not%20in%20a%20position%20to%20judge%20is%20abstained%20whatever%20the%20strategy%20said%2C%20because%20the%20schema%0A%20%20%20%20%20%20%20%20accepts%20nothing%20else%20in%20those%20states%20and%20because%20a%20signal%20computed%20during%20a%20replay%20is%20not%0A%20%20%20%20%20%20%20%20a%20live%20signal.%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20def%20abstain%28code%3A%20str%2C%20detail%3A%20str%29%20-%3E%20tuple%5Bdict%2C%20None%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%2A%2Aself._EMPTY%2C%20%22verdict%22%3A%20%22abstained%22%2C%20%22abstain_code%22%3A%20code%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22abstain_detail%22%3A%20detail%2C%20%22reasons_json%22%3A%20J.cjson%28%5Bcode%5D%29%7D%2C%20None%0A%0A%20%20%20%20%20%20%20%20if%20state.catching_up%20or%20state.mode%20%3D%3D%20%22catch_up%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20abstain%28%22catch_up%22%2C%20%22the%20engine%20was%20replaying%20history%2C%20not%20reading%20it%20live%22%29%0A%20%20%20%20%20%20%20%20if%20state.mode%20%3D%3D%20%22warmup%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20abstain%28%22warmup%22%2C%20%22the%20engine%20had%20not%20finished%20warming%20up%22%29%0A%20%20%20%20%20%20%20%20if%20state.stale%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20abstain%28%22feed_gap%22%2C%20%22the%20feed%20was%20stale%20when%20this%20bar%20closed%22%29%0A%20%20%20%20%20%20%20%20if%20bar.is_gap%20or%20bar.n_source_bars%20%3C%20bar.expected_source_bars%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Not%20only%20the%20engine%27s%20gap%20threshold%3A%20a%20bar%20missing%20ANY%20minute%20may%20close%20on%20an%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20earlier%20minute%27s%20price%2C%20or%20carry%20a%20range%20the%20exchange%27s%20own%20bar%20does%20not%2C%20and%20the%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20published%20stop%20could%20then%20not%20be%20reproduced%20from%20the%20archive.%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20abstain%28%22feed_gap%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22the%20bar%20was%20built%20from%20%7Bbar.n_source_bars%7D%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%7Bbar.expected_source_bars%7D%20source%20bars%22%29%0A%20%20%20%20%20%20%20%20if%20isinstance%28signal%2C%20BaseException%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20abstain%28%22engine_error%22%2C%20f%22%7Btype%28signal%29.__name__%7D%3A%20%7Bstr%28signal%29%5B%3A200%5D%7D%22%29%0A%0A%20%20%20%20%20%20%20%20plan%20%3D%20build_catalogue_plan%28direction%3Dint%28signal%29%2C%20entry_price%3Dfloat%28bar.close%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20atr_ticks%3Dbar.atr_ticks%29%0A%20%20%20%20%20%20%20%20cm%20%3D%20CostModel%28%29%0A%20%20%20%20%20%20%20%20if%20plan.state%20%3D%3D%20%22flat%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20A%20CLAIM%2C%20not%20a%20refusal%3A%20the%20strategy%20looked%20and%20declined.%20The%20schema%20requires%20a%20cost%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20on%20every%20non-abstained%20row%3B%20a%20trade%20not%20taken%20costs%20nothing%2C%20and%20this%20row%20is%20never%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20scored%2C%20so%20zero%20is%20the%20true%20figure%20rather%20than%20a%20placeholder.%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%2A%2Aself._EMPTY%2C%20%22verdict%22%3A%20%22no_trade%22%2C%20%22cost_r%22%3A%20J.dec8%280%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reasons_json%22%3A%20J.cjson%28%5B%22flat%22%5D%29%7D%2C%20None%0A%0A%20%20%20%20%20%20%20%20if%20plan.state%20%3D%3D%20%22refused%22%20and%20plan.refusal%20is%20not%20RefusalCode.COST_OVER_CAP%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20no_atr%2C%20price_off_grid%20and%20risk_below_tick_floor%20can%20each%20arise%20on%20this%20instrument%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20only%20from%20degenerate%20price%20data%20%E2%80%94%20an%20ATR%20of%20a%20cent%20on%20BTC%204h%20is%20a%20feed%20problem%2C%20not%20a%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20market.%20So%20they%20are%20%60feed_gap%60%2C%20with%20the%20precise%20code%20in%20the%20detail.%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20abstain%28%22feed_gap%22%2C%20f%22%7Bplan.refusal.value%7D%3A%20the%20plan%20could%20not%20be%20formed%22%29%0A%0A%20%20%20%20%20%20%20%20side%20%3D%20%7B%22direction%22%3A%20plan.direction%2C%20%22in_zone%22%3A%201%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entry_lo%22%3A%20_px%28plan.entry_ticks%29%2C%20%22entry_hi%22%3A%20_px%28plan.entry_ticks%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22stop%22%3A%20_px%28plan.stop_ticks%29%2C%20%22invalidation_price%22%3A%20_px%28plan.stop_ticks%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22invalidation_rule%22%3A%20f%22atr_stop%3A%7Bself.bound.exit_template.ident%7D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22targets_json%22%3A%20J.cjson%28%5B_px%28plan.target_ticks%29%5D%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rr_at_t2%22%3A%20_micro%28plan.tp_r_micro%29%2C%20%22cost_r%22%3A%20_micro%28plan.cost_r_micro%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22resolution_target%22%3A%20_px%28plan.target_ticks%29%7D%0A%0A%20%20%20%20%20%20%20%20if%20plan.state%20%3D%3D%20%22refused%22%3A%20%20%20%20%20%20%20%20%23%20COST_OVER_CAP%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%2A%2Aself._EMPTY%2C%20%2A%2Aside%2C%20%22verdict%22%3A%20%22watch%22%2C%20%22watch_reason%22%3A%20%22cost_above_max%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22p_required%22%3A%20None%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reasons_json%22%3A%20J.cjson%28%5B%28f%22cost_r%20%7B_micro%28plan.cost_r_micro%29%7D%20exceeds%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%7B_micro%28cm.max_cost_r_micro%29%7D%22%29%5D%29%7D%2C%20plan%0A%0A%20%20%20%20%20%20%20%20return%20%7B%2A%2Aself._EMPTY%2C%20%2A%2Aside%2C%20%22verdict%22%3A%20%22actionable%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22p_required%22%3A%20_micro%28plan.p_required_micro%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22fill_price%22%3A%20J.dec8%28bar.close%29%2C%20%22fill_ts_ms%22%3A%20bar.bar_close_ms%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reasons_json%22%3A%20J.cjson%28%5B%22planned%22%5D%29%7D%2C%20plan%0A%0AMICRO%20%3D%20Decimal%28%271000000%27%29%0A%0ATICK%20%3D%20Decimal%28%270.01%27%29%0A%0A__name__%20%3D%20%27wavelab.store.ledger%27%0A%0Adef%20_micro%28v%3A%20int%29%20-%3E%20str%3A%0A%20%20%20%20return%20J.dec8%28Decimal%28v%29%20%2F%20MICRO%29%0A%0Adef%20_px%28ticks%3A%20int%29%20-%3E%20str%3A%0A%20%20%20%20return%20J.dec8%28Decimal%28ticks%29%20%2A%20TICK%29%0A\n"} {"seq":6,"row_hash":"0b9b75e020096816b2c80e866046e03edc18c81876d5d9255c941a7a8673c5f2","body":"wavelab-journal-chain\nv=3\nseq=6\nprev=6e7eb4454113d2ed3e19a8946c26f2b8f968bf88b26babe74b5f1c57c4dfd301\nkind=draw_algorithm\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\ndraw_algorithm_id=ctl_seed_v1\nprereg_seq=2\ncontents_json=%7B%22direction%22%3A%22low%20bit%20of%20the%20seed%3A%200%20long%2C%201%20short%22%2C%22entry_bar_offset%22%3A%220%22%2C%22geometry%22%3A%22same%20entry%2C%20risk%20and%20reward%20as%20the%20treatment%2C%20mirrored%20to%20the%20drawn%20side%3B%20cost%20on%20its%20own%20legs%20by%20the%20plan%27s%20rule%22%2C%22id%22%3A%22ctl_seed_v1%22%2C%22preimage%22%3A%22manifest%20row%20hash%2C%20strategy_id%2C%20treatment%20direction%2C%20mark_price%22%2C%22seed_domain%22%3A%22wavelab-null-arm-seed%22%2C%22seed_hex_chars%22%3A%2216%22%2C%22seed_preimage%22%3A%22manifest_strategy_direction_mark%22%7D\ncontents_sha256=cbfdca57c7b19bbdec0b403c66b8b8dabda6a98100daa9501bd605cd22b7622b\nsource_text=%23%20----%20wavelab.engine.plan_generic%0A%0A%40dataclass%28frozen%3DTrue%2C%20slots%3DTrue%29%0Aclass%20CostModel%3A%0A%20%20%20%20%22%22%22What%20a%20retail%20taker%20on%20Binance%20spot%20pays%2C%20per%20side%2C%20in%20tenths%20of%20a%20basis%20point.%0A%0A%20%20%20%20%60slippage_bps_per_side%60%20is%20INCLUSIVE%20of%20the%20half-spread%20and%20of%20the%20price%20moving%20while%20a%20market%0A%20%20%20%20order%20crosses.%20Naming%20it%20per-side%20and%20inclusive%20removes%20the%20half-versus-full-spread%20ambiguity%20%E2%80%94%0A%20%20%20%20and%20an%20ambiguity%20inside%20a%20hash%20chain%20is%20permanent%20too.%0A%0A%20%20%20%207.5%20bps%20is%20not%20measured%3A%20nothing%20in%20this%20tree%20stores%20bid%2Fask%2C%20and%20a%20measured%20spread%20would%20make%0A%20%20%20%20the%20ledger%20unverifiable%20from%20the%20free%20archives.%20It%20is%20the%20difference%20between%20this%20repository%27s%0A%20%20%20%20two%20disagreeing%20cost%20models%20%E2%80%94%20projection.py%20charged%2015%20bps%20round%20trip%2C%20battery.py%2030%20%E2%80%94%20i.e.%20the%0A%20%20%20%20non-fee%20cost%20this%20project%20was%20already%20charging%20in%20one%20place%20and%20not%20the%20other.%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20tick_size_micro%3A%20int%20%3D%2010_000%20%20%20%20%20%20%20%20%20%20%23%200.01%20USDT%0A%20%20%20%20fee_tenth_bps%3A%20int%20%3D%2075%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%207.5%20bps%20taker%0A%20%20%20%20slippage_tenth_bps%3A%20int%20%3D%2075%20%20%20%20%20%20%20%20%20%20%20%23%207.5%20bps%2C%20spread-inclusive%0A%20%20%20%20max_cost_r_micro%3A%20int%20%3D%20200_000%20%20%20%20%20%20%20%20%23%200.20%20R%0A%20%20%20%20expected_loss_r_micro%3A%20int%20%3D%201_100_000%0A%20%20%20%20ev_min_r_micro%3A%20int%20%3D%20150_000%0A%0A%23%20----%20wavelab.store.journal%0A%0ASEED_DOMAIN%20%3D%20%27wavelab-null-arm-seed%27%0A%0A__name__%20%3D%20%27wavelab.store.journal%27%0A%0Adef%20_decimal%28v%3A%20Decimal%20%7C%20int%20%7C%20str%2C%20places%3A%20int%2C%20%2A%2C%20signed%3A%20bool%29%20-%3E%20str%3A%0A%20%20%20%20if%20isinstance%28v%2C%20%28bool%2C%20float%29%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20%28f%22%7Btype%28v%29.__name__%7D%20is%20not%20accepted%20here.%20A%20float%27s%20repr%20is%20the%20shortest%20string%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22that%20round-trips%20on%20this%20interpreter%2C%20so%20hashing%20it%20makes%20the%20row%27s%20hash%20depend%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22on%20a%20printer.%20Pass%20a%20Decimal%2C%20an%20int%2C%20or%20the%20exact%20string.%22%29%0A%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20d%20%3D%20Decimal%28v%29%0A%20%20%20%20except%20InvalidOperation%20as%20exc%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22%7Bv%21r%7D%20is%20not%20a%20decimal%22%29%20from%20exc%0A%20%20%20%20if%20not%20d.is_finite%28%29%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bv%21r%7D%20is%20not%20finite%3B%20a%20ledger%20row%20cannot%20carry%20NaN%20or%20Infinity%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20q%20%3D%20d.quantize%28Decimal%281%29.scaleb%28-places%29%29%0A%20%20%20%20if%20not%20signed%20and%20q%20%3C%200%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bv%21r%7D%20is%20negative%20where%20only%20unsigned%20values%20are%20accepted%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20s%20%3D%20f%22%7Bq%3Af%7D%22%0A%20%20%20%20if%20s.startswith%28%22-%22%29%20and%20Decimal%28s%29%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%23%20%60-0.00000000%60%20and%20%600.00000000%60%20are%20the%20same%20number%20and%20different%20bytes.%20One%20of%20them%20has%0A%20%20%20%20%20%20%20%20%23%20to%20be%20unrepresentable%20or%20two%20honest%20writers%20produce%20two%20different%20hashes%20for%20one%20row.%0A%20%20%20%20%20%20%20%20msg%20%3D%20%22negative%20zero%20is%20forbidden%3A%20it%20hashes%20differently%20from%20zero%20and%20means%20the%20same%22%0A%20%20%20%20%20%20%20%20raise%20ValueError%28msg%29%0A%20%20%20%20return%20s%0A%0Adef%20_wl_sha256%28x%3A%20str%20%7C%20bytes%20%7C%20bytearray%20%7C%20memoryview%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22Registered%20as%20%60wl_sha256%2F1%60.%20Bytes%20are%20hashed%20AS%20BYTES%2C%20never%20through%20a%20CAST.%0A%0A%20%20%20%20Registered%20per%20connection%20and%20deterministic.%20That%20is%20also%20the%20fail-closed%20property%20the%20schema%0A%20%20%20%20depends%20on%3A%20the%20triggers%20call%20this%20function%2C%20so%20the%20sqlite3%20CLI%2C%20a%20database%20browser%20and%20a%0A%20%20%20%20half-written%20script%20all%20die%20with%20%22no%20such%20function%22%20instead%20of%20inserting.%0A%20%20%20%20%22%22%22%0A%20%20%20%20if%20isinstance%28x%2C%20str%29%3A%0A%20%20%20%20%20%20%20%20x%20%3D%20x.encode%28%22utf-8%22%29%0A%20%20%20%20return%20hashlib.sha256%28bytes%28x%29%29.hexdigest%28%29%0A%0Adef%20cjson%28obj%3A%20Mapping%20%7C%20Sequence%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22Canonical%20JSON%3A%20keys%20sorted%2C%20no%20whitespace%2C%20and%20NO%20JSON%20NUMBERS%20ANYWHERE.%0A%0A%20%20%20%20Every%20number%20is%20a%20string%20produced%20by%20%60dec8%60%2F%60dec4%60%2F%60i64%60%20before%20it%20gets%20here.%20A%20JSON%20number%20in%0A%20%20%20%20the%20tree%20would%20be%20serialised%20by%20the%20json%20module%27s%20float%20printer%2C%20which%20is%20the%20one%20thing%20the%0A%20%20%20%20whole%20serialisation%20exists%20to%20keep%20out%20of%20the%20hashed%20bytes.%0A%20%20%20%20%22%22%22%0A%20%20%20%20def%20check%28node%3A%20object%2C%20path%3A%20str%29%20-%3E%20None%3A%0A%20%20%20%20%20%20%20%20if%20isinstance%28node%2C%20bool%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20msg%20%3D%20f%22%7Bpath%7D%3A%20booleans%20are%20not%20accepted%3B%20encode%20as%20the%20string%20%270%27%20or%20%271%27%22%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20%20%20%20%20if%20isinstance%28node%2C%20%28int%2C%20float%29%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20msg%20%3D%20%28f%22%7Bpath%7D%3A%20a%20JSON%20number%20reached%20canonical%20JSON.%20Encode%20it%20with%20dec8%2Fdec4%2Fi64%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22first%20%E2%80%94%20the%20hashed%20bytes%20must%20not%20depend%20on%20a%20number%20printer.%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28msg%29%0A%20%20%20%20%20%20%20%20if%20isinstance%28node%2C%20dict%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20k%2C%20v%20in%20node.items%28%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20isinstance%28k%2C%20str%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28f%22%7Bpath%7D%3A%20object%20keys%20must%20be%20strings%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20check%28v%2C%20f%22%7Bpath%7D.%7Bk%7D%22%29%0A%20%20%20%20%20%20%20%20elif%20isinstance%28node%2C%20%28list%2C%20tuple%29%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20i%2C%20v%20in%20enumerate%28node%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20check%28v%2C%20f%22%7Bpath%7D%5B%7Bi%7D%5D%22%29%0A%20%20%20%20%20%20%20%20elif%20node%20is%20not%20None%20and%20not%20isinstance%28node%2C%20str%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20TypeError%28f%22%7Bpath%7D%3A%20%7Btype%28node%29.__name__%7D%20is%20not%20serialisable%20here%22%29%0A%0A%20%20%20%20check%28obj%2C%20%22%24%22%29%0A%20%20%20%20return%20json.dumps%28obj%2C%20sort_keys%3DTrue%2C%20separators%3D%28%22%2C%22%2C%20%22%3A%22%29%2C%20ensure_ascii%3DFalse%29%0A%0Adef%20control_direction%28seed%3A%20str%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22The%20control%27s%20side%3A%20a%20coin%20flip%20read%20from%20the%20seed%27s%20low%20bit.%20%2B1%20long%2C%20-1%20short.%0A%0A%20%20%20%20THE%20LEDGER%27S%20CONTROL%20IS%20NOT%20THE%20BACKTEST%27S%20TWIN%2C%20and%20anything%20describing%20it%20must%20say%20so.%20The%0A%20%20%20%20backtest%27s%20twin%20entered%20one%20to%20twenty%20bars%20LATER%20in%20the%20SAME%20direction%2C%20and%20asked%20%22did%20the%0A%20%20%20%20timing%20add%20anything%3F%22.%20This%20control%20enters%20at%20the%20SAME%20bar%20close%2C%20at%20the%20same%20price%2C%20with%20the%0A%20%20%20%20same%20risk%20and%20reward%2C%20and%20draws%20its%20SIDE%20%E2%80%94%20so%20it%20asks%20%22did%20choosing%20long%20or%20short%20beat%20a%20coin%3F%22.%0A%0A%20%20%20%20What%20that%20does%20and%20does%20not%20cancel.%20Half%20the%20time%20the%20coin%20lands%20on%20the%20treatment%27s%20own%20side%0A%20%20%20%20and%20the%20two%20arms%20are%20the%20same%20trade%2C%20so%20their%20difference%20is%20exactly%20zero.%20When%20it%20lands%20on%20the%0A%20%20%20%20other%20side%20the%20difference%20is%20%28this%20side%27s%20result%29%20minus%20%28the%20other%20side%27s%29.%20So%20for%20a%20strategy%0A%20%20%20%20that%20is%20long%20a%20fraction%20p%20of%20the%20time%2C%20the%20expected%20difference%20carries%20%282p%20-%201%29%2F2%20of%20the%0A%20%20%20%20market%27s%20drift%20over%20its%20trades%3A%20nothing%20for%20a%20strategy%20that%20is%20long%20and%20short%20equally%20often%2C%0A%20%20%20%20half%20the%20drift%20for%20one%20that%20is%20only%20ever%20long.%20The%20pre-registration%20reports%20p%20beside%20every%0A%20%20%20%20result%20for%20that%20reason.%20Costs%20do%20not%20cancel%20exactly%20either%3A%20each%20arm%20pays%20its%20own%20legs%2C%20and%20the%0A%20%20%20%20dearer%20leg%20sits%20at%20a%20different%20price%20for%20a%20long%20and%20for%20a%20short%20%28about%200.0015%20R%20apart%29.%0A%20%20%20%20%22%22%22%0A%20%20%20%20return%201%20if%20int%28seed%2C%2016%29%20%26%201%20%3D%3D%200%20else%20-1%0A%0Adef%20dec8%28v%3A%20Decimal%20%7C%20int%20%7C%20str%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22Eight%20decimal%20places%2C%20signed.%20Raises%20TypeError%20on%20float%2C%20ValueError%20on%20-0.%22%22%22%0A%20%20%20%20return%20_decimal%28v%2C%208%2C%20signed%3DTrue%29%0A%0Adef%20draw_control%28manifest_row_hash%3A%20str%2C%20strategy_id%3A%20str%2C%20direction%3A%20int%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mark_price%3A%20str%29%20-%3E%20tuple%5Bstr%2C%20int%5D%3A%0A%20%20%20%20%22%22%22The%20whole%20draw%2C%20as%20one%20function%2C%20because%20its%20source%20is%20what%20genesis%20commits%20to.%22%22%22%0A%20%20%20%20seed%20%3D%20null_arm_seed%28manifest_row_hash%2C%20strategy_id%2C%20direction%2C%20mark_price%29%0A%20%20%20%20return%20seed%2C%20control_direction%28seed%29%0A%0Adef%20null_arm_seed%28manifest_row_hash%3A%20str%2C%20strategy_id%3A%20str%2C%20direction%3A%20int%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mark_price%3A%20str%29%20-%3E%20str%3A%0A%20%20%20%20%22%22%22The%20control%27s%20seed%3A%20the%20first%2016%20hex%20of%20SHA-256%20over%20the%20domain%2C%20the%20bar%20MANIFEST%27s%20row%0A%20%20%20%20hash%2C%20the%20strategy%2C%20the%20treatment%27s%20direction%20and%20the%20bar%27s%20close%20as%20recorded.%0A%0A%20%20%20%20It%20must%20match%2C%20byte%20for%20byte%2C%20the%20derivation%20in%20%60control_bi%60%20in%20journal.sql%2C%20which%20recomputes%0A%20%20%20%20it%20and%20refuses%20any%20control%20whose%20seed%20differs%3B%20a%20test%20computes%20it%20both%20ways.%0A%0A%20%20%20%20WHY%20THESE%20INPUTS%20AND%20NOT%20THE%20TREATMENT%27S%20ROW%20HASH.%20The%20treatment%20row%20also%20carries%20fields%20the%0A%20%20%20%20operator%20sets%20at%20write%20time%20%E2%80%94%20ingest%20and%20write%20times%2C%20clock%20fields%20%E2%80%94%20so%20hashing%20it%20let%20the%0A%20%20%20%20operator%20move%20%60bar_ingest_ms%60%20by%20a%20millisecond%20or%20two%20until%20the%20coin%20came%20out%20the%20way%20it%0A%20%20%20%20wanted%3A%20measured%20on%202026-09-22%2C%2040%20controls%20out%20of%2040%20flipped%20within%20a%20few%20tries.%20Every%20input%0A%20%20%20%20here%20is%20fixed%20before%20the%20operator%20can%20act%20on%20it%3A%20the%20manifest%20was%20sealed%20while%20the%20bar%20was%0A%20%20%20%20still%20open%2C%20before%20its%20close%20or%20any%20strategy%27s%20direction%20existed%2C%20and%20the%20other%20three%20are%20what%0A%20%20%20%20the%20strategy%20and%20the%20market%20produced.%20So%20there%20is%20nothing%20left%20to%20grind%3A%20at%20the%20moment%20the%0A%20%20%20%20manifest%20could%20still%20be%20chosen%2C%20the%20close%20that%20the%20seed%20also%20depends%20on%20did%20not%20exist%20yet.%0A%20%20%20%20%22%22%22%0A%20%20%20%20return%20_wl_sha256%28f%22%7BSEED_DOMAIN%7D%5Cn%7Bmanifest_row_hash%7D%5Cn%7Bstrategy_id%7D%5Cn%7Bdirection%7D%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%7Bmark_price%7D%5Cn%22%29%5B%3A16%5D%0A%0A%23%20----%20wavelab.store.ledger%0A%0A%20%20%20%20def%20_control%28self%2C%20decision_seq%3A%20int%2C%20plan%2C%20now%3A%20int%29%20-%3E%20int%3A%0A%20%20%20%20%20%20%20%20%22%22%22The%20control%2C%20immediately%20after%20its%20treatment%3A%20same%20bar%20close%2C%20same%20price%2C%20same%20risk%20and%0A%20%20%20%20%20%20%20%20reward%2C%20and%20a%20side%20drawn%20from%20a%20seed%20nobody%20could%20choose%20%28see%20%60journal.null_arm_seed%60%29.%22%22%22%0A%20%20%20%20%20%20%20%20manifest_hash%2C%20sid%2C%20direction%2C%20mark%20%3D%20self.con.execute%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%22SELECT%20m.row_hash%2C%20d.strategy_id%2C%20d.direction%2C%20d.mark_price%20FROM%20decisions%20d%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%22JOIN%20chain%20m%20ON%20m.seq%20%3D%20d.manifest_seq%20WHERE%20d.seq%20%3D%20%3F%22%2C%20%28decision_seq%2C%29%29.fetchone%28%29%0A%20%20%20%20%20%20%20%20seed%2C%20side%20%3D%20J.draw_control%28manifest_hash%2C%20sid%2C%20direction%2C%20mark%29%0A%20%20%20%20%20%20%20%20risk%20%3D%20plan.risk_ticks%0A%20%20%20%20%20%20%20%20reward%20%3D%20abs%28plan.target_ticks%20-%20plan.entry_ticks%29%0A%20%20%20%20%20%20%20%20entry%20%3D%20plan.entry_ticks%0A%20%20%20%20%20%20%20%20stop%2C%20target%20%3D%20entry%20-%20side%20%2A%20risk%2C%20entry%20%2B%20side%20%2A%20reward%0A%20%20%20%20%20%20%20%20cm%20%3D%20CostModel%28%29%0A%20%20%20%20%20%20%20%20rate%20%3D%20cm.fee_tenth_bps%20%2B%20cm.slippage_tenth_bps%0A%20%20%20%20%20%20%20%20cost%20%3D%20max%28-%28%28-rate%20%2A%20%28entry%20%2B%20x%29%20%2A%2010%29%20%2F%2F%20risk%29%20for%20x%20in%20%28stop%2C%20target%29%29%0A%20%20%20%20%20%20%20%20et%2C%20cmd%2C%20fr%2C%20da%20%3D%20%28self.bound.exit_template%2C%20self.bound.cost_model%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self.bound.fill_rule%2C%20self.bound.draw_algorithm%29%0A%20%20%20%20%20%20%20%20close_ms%20%3D%20self.con.execute%28%22SELECT%20bar_close_ms%20FROM%20decisions%20WHERE%20seq%20%3D%20%3F%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28decision_seq%2C%29%29.fetchone%28%29%5B0%5D%0A%20%20%20%20%20%20%20%20return%20J.append%28self.con%2C%20kind%3D%22control%22%2C%20table%3D%22controls%22%2C%20columns%3D%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22decision_seq%22%3A%20decision_seq%2C%20%22draw_algorithm_id%22%3A%20da.ident%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22draw_algorithm_seq%22%3A%20da.seq%2C%20%22draw_algorithm_sha256%22%3A%20da.sha%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22draw_seed%22%3A%20seed%2C%20%22seed_preimage%22%3A%20%22manifest_strategy_direction_mark%22%2C%20%22entry_bar_offset%22%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22entry_ts_ms%22%3A%20close_ms%2C%20%22direction%22%3A%20side%2C%20%22entry_price%22%3A%20_px%28entry%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22stop%22%3A%20_px%28stop%29%2C%20%22target%22%3A%20_px%28target%29%2C%20%22fill_rule_seq%22%3A%20fr.seq%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22fill_basis%22%3A%20%22market_on_close%22%2C%20%22resolution_target_basis%22%3A%20%22exit_template_tp_r%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22exit_template_id%22%3A%20et.ident%2C%20%22exit_template_seq%22%3A%20et.seq%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22exit_template_sha256%22%3A%20et.sha%2C%20%22exit_template_json%22%3A%20et.json%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22cost_model_id%22%3A%20cmd.ident%2C%20%22cost_model_seq%22%3A%20cmd.seq%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22cost_model_sha256%22%3A%20cmd.sha%2C%20%22cost_model_json%22%3A%20cmd.json%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22cost_r%22%3A%20_micro%28cost%29%2C%0A%20%20%20%20%20%20%20%20%7D%2C%20%2A%2Aself._hdr%28now%29%29%0A%0AMICRO%20%3D%20Decimal%28%271000000%27%29%0A%0ATICK%20%3D%20Decimal%28%270.01%27%29%0A%0Adef%20_micro%28v%3A%20int%29%20-%3E%20str%3A%0A%20%20%20%20return%20J.dec8%28Decimal%28v%29%20%2F%20MICRO%29%0A%0Adef%20_px%28ticks%3A%20int%29%20-%3E%20str%3A%0A%20%20%20%20return%20J.dec8%28Decimal%28ticks%29%20%2A%20TICK%29%0A\nsource_sha256=d4646204dbffc44f792ee32b0299afc669aa9162cc5a29e5861bfd71619156a2\nruntime_json=%7B%22hash%22%3A%22sha256%22%7D\neffective_from_ms=1790242821226\n"} {"seq":7,"row_hash":"030490ba5c995b8d1d1861cd33071ae66669b8493295e4ed7e79c1f5a5d17f0f","body":"wavelab-journal-chain\nv=3\nseq=7\nprev=0b9b75e020096816b2c80e866046e03edc18c81876d5d9255c941a7a8673c5f2\nkind=config_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nconfig_hash=c161274b016daa2c\nprereg_seq=2\ncontents_json=%7B%22id%22%3A%22config%22%2C%22params_sha256%22%3A%22c161274b016daa2c67054893bdb2e0525bc12dc3554ec7acefab920fe1e9a8d5%22%7D\ncontents_sha256=36609d9bb2599570ff4b71f147c2b3853b42f2a72c41678638947294912fb6a7\ntrial_seq_at_binding=238\n"} {"seq":8,"row_hash":"0a4cdeb8ea7b968dbb43ee08a177b46be4bfab1778f1d235781b8ff6c3eecc81","body":"wavelab-journal-chain\nv=3\nseq=8\nprev=030490ba5c995b8d1d1861cd33071ae66669b8493295e4ed7e79c1f5a5d17f0f\nkind=weights_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nweights_version=none\nprereg_seq=2\ncontents_json=%7B%22id%22%3A%22weights%22%2C%22version%22%3A%22none%22%7D\ncontents_sha256=286b150eb580627a8a7fa8b4eb81ea8e696889aae43692dcd4201e415149ce7e\n"} {"seq":9,"row_hash":"b1217b34aab8ed0c5354a76a48af5063c44a6c27a1ea93f9cfb18aee38d84282","body":"wavelab-journal-chain\nv=3\nseq=9\nprev=0a4cdeb8ea7b968dbb43ee08a177b46be4bfab1778f1d235781b8ff6c3eecc81\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fbase.py\nprereg_seq=2\nsource_text=%22%22%22The%20hypothesis%20contract.%20Every%20one%20of%20them%20is%20REGISTERED%20BEFORE%20any%20result%20is%20looked%20at.%0A%0AWhy%20pre-registration.%20What%20separates%20science%20from%20self-deception%20is%20not%20testing%20many%20things%0A%E2%80%94that%20is%20fine%E2%80%94%20but%20deciding%20WHAT%20COUNTS%20as%20success%20before%20looking.%20If%20you%20test%20first%20and%20choose%0Aafterwards%20you%20always%20find%20something%2C%20and%20you%20have%20no%20way%20of%20telling%20signal%20from%20the%20maximum%20of%20N%0Adraws.%0A%0AEvery%20hypothesis%20declares%3A%0A%20%20-%20%60title%60%3A%20%20%20%20%20WHAT%20it%20claims%2C%20in%20one%20human%20line.%20English%2C%20like%20the%20rest%20of%20the%20record.%0A%20%20-%20%60rationale%60%3A%20WHY%20it%20should%20work.%20Written%20before%20seeing%20a%20single%20number.%0A%20%20-%20%60prior%60%3A%20%20%20%20%20what%20effect%20is%20expected%2C%20and%20in%20which%20direction.%0A%20%20-%20%60params%60%3A%20%20%20%20FIXED.%20Not%20searched%20over.%20Changing%20one%20is%20a%20NEW%20hypothesis%20and%20another%20trial.%0A%0AAnd%20all%20of%20them%20count%20towards%20the%20multiple-comparisons%20correction%2C%20the%20ones%20that%20fail%20included.%0AHiding%20the%20failures%20is%20what%20turns%20a%20study%20into%20a%20brochure.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Afrom%20dataclasses%20import%20dataclass%2C%20field%0A%0Aimport%20numpy%20as%20np%0A%0A__all__%20%3D%20%5B%22REGISTRY%22%2C%20%22Hypothesis%22%2C%20%22Series%22%2C%20%22register%22%5D%0A%0A%0A%40dataclass%28frozen%3DTrue%2C%20slots%3DTrue%29%0Aclass%20Series%3A%0A%20%20%20%20%22%22%22The%20candles%20of%20one%20timeframe.%20Everything%20a%20hypothesis%20is%20allowed%20to%20see.%22%22%22%0A%20%20%20%20tf%3A%20str%0A%20%20%20%20ts%3A%20np.ndarray%0A%20%20%20%20open%3A%20np.ndarray%0A%20%20%20%20high%3A%20np.ndarray%0A%20%20%20%20low%3A%20np.ndarray%0A%20%20%20%20close%3A%20np.ndarray%0A%20%20%20%20volume%3A%20np.ndarray%0A%0A%20%20%20%20def%20__len__%28self%29%20-%3E%20int%3A%0A%20%20%20%20%20%20%20%20return%20int%28self.close.size%29%0A%0A%0A%40dataclass%28frozen%3DTrue%2C%20slots%3DTrue%29%0Aclass%20Hypothesis%3A%0A%20%20%20%20%22%22%22A%20testable%20idea%2C%20declared%20before%20it%20is%20tested.%22%22%22%0A%0A%20%20%20%20name%3A%20str%0A%20%20%20%20family%3A%20str%0A%20%20%20%20%23%20%60name%60%20is%20what%20the%20picker%20used%20to%20show%2C%20and%20it%20is%20a%20lookup%20key%2C%20not%20a%20name%3A%20a%20reader%20had%20to%0A%20%20%20%20%23%20decode%20%60flow.absorption_narrow_range%60%20to%20know%20what%20they%20were%20about%20to%20validate.%20%60title%60%20is%0A%20%20%20%20%23%20that%20same%20claim%20in%20one%20human%20line%2C%20and%20it%20carries%20NO%20DEFAULT%20on%20purpose.%20A%20default%20of%20%22%22%20is%0A%20%20%20%20%23%20the%20failure%20this%20field%20exists%20to%20prevent%3A%20hypothesis%20101%20gets%20registered%2C%20the%20picker%20quietly%0A%20%20%20%20%23%20falls%20back%20to%20the%20identifier%20for%20it%20alone%2C%20every%20test%20still%20passes%2C%20and%20nobody%20finds%20out%0A%20%20%20%20%23%20except%20the%20reader.%20Without%20a%20default%20the%20omission%20is%20a%20TypeError%20at%20import.%0A%20%20%20%20title%3A%20str%0A%20%20%20%20rationale%3A%20str%0A%20%20%20%20prior%3A%20str%0A%20%20%20%20fn%3A%20object%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20%28Series%29%20-%3E%20np.ndarray%20of%20%7B-1%2C%200%2C%20%2B1%7D%0A%20%20%20%20params%3A%20dict%20%3D%20field%28default_factory%3Ddict%29%0A%20%20%20%20timeframes%3A%20tuple%5Bstr%2C%20...%5D%20%3D%20%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%0A%20%20%20%20min_warmup%3A%20int%20%3D%20200%0A%0A%20%20%20%20def%20signals%28self%2C%20s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22%2B1%20%3D%20long%2C%20-1%20%3D%20short%2C%200%20%3D%20flat.%20Strictly%20causal%3A%20position%20i%20may%20only%20depend%20on%20data%20up%0A%20%20%20%20%20%20%20%20to%20and%20including%20i.%20A%20botched%20shift%20here%20invents%20an%20edge%20that%20does%20not%20exist%2C%20and%20it%20is%20the%0A%20%20%20%20%20%20%20%20single%20most%20common%20mistake%20in%20the%20whole%20industry.%22%22%22%0A%20%20%20%20%20%20%20%20out%20%3D%20np.asarray%28self.fn%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20%20%20%20%20if%20out.size%20%21%3D%20len%28s%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20ValueError%28f%22%7Bself.name%7D%3A%20returned%20%7Bout.size%7D%20signals%20for%20%7Blen%28s%29%7D%20candles%22%29%0A%20%20%20%20%20%20%20%20out%5B%3A%20self.min_warmup%5D%20%3D%200%0A%20%20%20%20%20%20%20%20return%20out%0A%0A%0AREGISTRY%3A%20dict%5Bstr%2C%20Hypothesis%5D%20%3D%20%7B%7D%0A%0A%0Adef%20register%28h%3A%20Hypothesis%29%20-%3E%20Hypothesis%3A%0A%20%20%20%20if%20h.name%20in%20REGISTRY%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22duplicate%20hypothesis%3A%20%7Bh.name%7D%22%29%0A%20%20%20%20if%20not%20h.rationale.strip%28%29%20or%20not%20h.prior.strip%28%29%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22%7Bh.name%7D%3A%20every%20hypothesis%20must%20declare%20a%20rationale%20and%20a%20prior%20BEFORE%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22it%20is%20run.%20Without%20those%20it%20is%20not%20a%20hypothesis%2C%20it%20is%20a%20search.%22%29%0A%20%20%20%20%23%20The%20dataclass%20makes%20%60title%60%20impossible%20to%20forget%3B%20this%20makes%20it%20impossible%20to%20leave%20blank%2C%0A%20%20%20%20%23%20which%20looks%20identical%20to%20the%20reader%20%E2%80%94%20an%20empty%20entry%20in%20the%20picker%20they%20cannot%20click%20on.%0A%20%20%20%20if%20not%20h.title.strip%28%29%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22%7Bh.name%7D%3A%20title%20is%20empty.%20The%20catalogue%20is%20the%20first%20screen%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22product%20and%20this%20hypothesis%20would%20appear%20in%20it%20as%20a%20blank%20row%2C%20or%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22the%20raw%20key%20%27%7Bh.name%7D%27%2C%20which%20is%20the%20bug%20titles%20were%20added%20to%20fix.%22%29%0A%20%20%20%20REGISTRY%5Bh.name%5D%20%3D%20h%0A%20%20%20%20return%20h%0A\nsource_sha256=9f8523bdd81f008ec1461ab4e8d56ea77aa5bc397de12c5967fe13de95ad8606\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":10,"row_hash":"9a81214f724937addd9d7716298b3425f6e78b8a37c43bb1434d0d4551c18e3e","body":"wavelab-journal-chain\nv=3\nseq=10\nprev=b1217b34aab8ed0c5354a76a48af5063c44a6c27a1ea93f9cfb18aee38d84282\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nprereg_seq=2\nsource_text=%22%22%22Family%20%60candles%60%3A%20candle%20microstructure.%20PRE-REGISTERED%2C%20written%20without%20looking%20at%20one%20number.%0A%0AStarting%20stance%3A%20sceptical.%20Most%20of%20the%20canonical%20candlestick%20patterns%20have%20no%20demonstrated%0Aout-of-sample%20edge%2C%20and%20much%20of%20their%20semantics%20%28%22indecision%22%2C%20%22rejection%22%29%20imports%20the%20assumptions%0Aof%20a%20market%20with%20a%20session%20open%20and%20a%20session%20close%2C%20which%20BTC%20%E2%80%94%20trading%2024%2F7%20%E2%80%94%20does%20not%20have.%0ASeveral%20hypotheses%20in%20this%20file%20predict%20ZERO%20on%20purpose%3A%20a%20prior%20of%20%22zero%22%20is%20falsifiable%20by%20any%0Asignificant%20effect%20in%20either%20direction%2C%20and%20a%20family%20in%20which%20everything%20predicts%20success%20is%20not%20a%0Afamily%20of%20hypotheses%2C%20it%20is%20a%20brochure.%0A%0AConventions%2C%20fixed%20BEFORE%20running%20anything%3A%0A%0A-%20PULSE%20versus%20STATE.%20A%20pattern%20is%20an%20event%3A%20it%20emits%20%C2%B11%20on%20the%20candle%20where%20it%20completes%20and%20goes%0A%20%20back%20to%200.%20Exit%20management%20is%20imposed%20by%20the%20engine%2C%20not%20by%20the%20hypothesis.%20Only%20two%20hypotheses%0A%20%20extend%20the%20signal%20over%20several%20candles%2C%20and%20they%20do%20so%20because%20their%20declared%20mechanism%20lasts%0A%20%20several%20candles%20%28an%20institutional%20order%20worked%20in%20slices%2C%20the%20drift%20after%20a%20shock%29%3B%20it%20is%20said%20so%0A%20%20in%20their%20rationale.%20Two%20hypotheses%20are%20state%20and%20not%20event%20%28%60close_in_range%60%2C%20%60body_flow_20%60%29%3A%0A%20%20they%20describe%20a%20sustained%20condition%20of%20the%20candle%20or%20of%20the%20window%2C%20not%20a%20one-off%20occurrence.%0A%0A-%20PARAMETERS.%20One%20value%20per%20parameter%2C%20taken%20by%20convention%20from%20the%20literature%20%28RSI%2014%20with%2030%2F70%0A%20%20thresholds%2C%20ADX%2014%20with%20a%20threshold%20of%2025%2C%20ATR%2014%2C%20EMA%20200%2C%20window%2020%29%20or%2C%20where%20the%20literature%0A%20%20offers%20none%2C%20a%20round%20number%20fixed%20in%20advance%20%280.8%2F0.2%20for%20the%20close%27s%20position%20in%20the%20range%2C%202x%0A%20%20the%20body%20and%200.6%20of%20the%20range%20for%20the%20wick%2C%202x%20ATR%20for%20the%20shock%2C%200.30%20of%20body%20flow%29.%20None%20was%0A%20%20chosen%20by%20looking%20at%20data%2C%20and%20none%20will%20be%20re-tuned%20afterwards.%20Changing%20one%20would%20be%20a%0A%20%20different%20hypothesis%20and%20a%20different%20trial.%0A%0A-%20CAUSALITY.%20Everything%20read%20at%20position%20i%20comes%20from%20i%20or%20earlier.%20Lags%20go%20through%20%60_lag%60%20%28fills%0A%20%20NaN%20at%20the%20start%2C%20never%20wraps%29%2C%20pulse%20propagation%20uses%20%60np.maximum.accumulate%60%2C%20which%20only%20looks%0A%20%20at%20the%20prefix%2C%20and%20nothing%20is%20used%20that%20is%20defined%20against%20the%20whole%20array%20%28find_peaks%20with%0A%20%20prominence%2C%20global%20minima%2C%20normalisations%20by%20the%20total%29.%20TA-Lib%27s%20CDL%2A%20functions%20are%20causal%3A%0A%20%20their%20internal%20thresholds%20are%20backward-looking%20moving%20averages.%0A%0A-%20NaN.%20TA-Lib%20returns%20NaN%20during%20warm-up.%20It%20is%20checked%20explicitly%20with%20np.isnan%20%28%60_no_nan%60%29%0A%20%20instead%20of%20trusting%20that%20a%20comparison%20against%20NaN%20yields%20False%2C%20because%20that%20implicit%20protection%0A%20%20is%20lost%20the%20moment%20a%20condition%20appears%20negated.%0A%0A-%20COSTS.%20Candle%20patterns%20are%20one-candle%20signals%20and%20they%20fire%20a%20lot.%20Gross%20edge%20means%20nothing%20here%3A%0A%20%20what%20gets%20recorded%20as%20success%20is%20the%20delta%20against%20the%20null%20arm%20NET%20of%20fees%2C%20and%20for%20several%20of%0A%20%20these%20hypotheses%20the%20prior%20is%20precisely%20that%20costs%20eat%20it.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20No%20hypothesis%20in%20this%20family%20emits%20a%20signal%20on%20less%20history%20than%20this%3A%20it%20covers%20the%20longest%0A%23%20warm-up%20%28EMA%20200%29%20with%20room%20to%20spare%20and%20avoids%20handing%20TA-Lib%20series%20shorter%20than%20its%20lookback.%0A_MIN_BARS%20%3D%20320%0A%0A%0Adef%20_f%28a%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22TA-Lib%20demands%20contiguous%20float64.%20No%20copy%20if%20it%20already%20is.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28a%2C%20dtype%3Dnp.float64%29%0A%0A%0Adef%20_no_nan%28%2Aarrays%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Mask%20that%20is%20True%20where%20NONE%20of%20the%20arrays%20is%20NaN.%0A%0A%20%20%20%20Made%20explicit%20rather%20than%20delegated%20to%20%60NaN%20%3E%20x%60%20being%20False%3A%20that%20protection%20disappears%20the%0A%20%20%20%20moment%20the%20condition%20appears%20negated%20%28%60~%28x%20%3E%20y%29%60%20IS%20True%20with%20NaN%29%20and%20would%20come%20back%20as%20an%0A%20%20%20%20invented%20signal%20right%20in%20the%20warm-up%2C%20which%20is%20where%20nobody%20is%20looking.%0A%20%20%20%20%22%22%22%0A%20%20%20%20m%20%3D%20np.ones%28np.shape%28arrays%5B0%5D%29%2C%20dtype%3Dbool%29%0A%20%20%20%20for%20a%20in%20arrays%3A%0A%20%20%20%20%20%20%20%20m%20%26%3D%20~np.isnan%28np.asarray%28a%2C%20dtype%3Dnp.float64%29%29%0A%20%20%20%20return%20m%0A%0A%0Adef%20_lag%28a%3A%20np.ndarray%2C%20k%3A%20int%20%3D%201%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22The%20value%20at%20position%20i-k%2C%20placed%20at%20i.%20NaN%20at%20the%20start.%20Only%20ever%20looks%20backwards.%22%22%22%0A%20%20%20%20x%20%3D%20np.asarray%28a%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20if%20k%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20x.copy%28%29%0A%20%20%20%20out%20%3D%20np.full%28x.shape%2C%20np.nan%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20if%20k%20%3C%20x.size%3A%0A%20%20%20%20%20%20%20%20out%5Bk%3A%5D%20%3D%20x%5B%3A%20x.size%20-%20k%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_hold%28pulse%3A%20np.ndarray%2C%20n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Extends%20each%20%C2%B11%20pulse%20over%20n%20candles%2C%20counting%20the%20signal%20candle%20itself.%0A%0A%20%20%20%20Causal%3A%20%60maximum.accumulate%60%20only%20depends%20on%20the%20prefix%2C%20so%20position%20i%20knows%20nothing%20beyond%20the%0A%20%20%20%20last%20signal%20that%20occurred%20at%20i%20or%20before.%20A%20new%20pulse%20replaces%20the%20previous%20one.%0A%20%20%20%20%22%22%22%0A%20%20%20%20idx%20%3D%20np.arange%28pulse.size%29%0A%20%20%20%20last%20%3D%20np.maximum.accumulate%28np.where%28pulse%20%21%3D%200%2C%20idx%2C%20-1%29%29%0A%20%20%20%20alive%20%3D%20%28last%20%3E%3D%200%29%20%26%20%28%28idx%20-%20last%29%20%3C%20n%29%0A%20%20%20%20return%20np.where%28alive%2C%20pulse%5Bnp.maximum%28last%2C%200%29%5D%2C%200%29.astype%28np.int8%29%0A%0A%0Adef%20_ohlc%28s%3A%20Series%29%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%2C%20np.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20return%20_f%28s.open%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%201.%20Unfiltered%20engulfing%3A%20the%20folklore%20version%2C%20registered%20so%20that%20it%20can%20be%20refuted.%0A%23%20---------------------------------------------------------------------------%0Adef%20_engulfing_raw%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLENGULFING%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.engulfing_raw%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Every%20engulfing%20candle%2C%20no%20trend%20filter%22%2C%0A%20%20%20%20rationale%3D%22An%20engulfing%20candle%20means%20that%20the%20entire%20price%20range%20the%20previous%20candle%20considered%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22acceptable%20has%20been%20travelled%20end%20to%20end%20and%20the%20close%20has%20ended%20up%20on%20the%20other%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22side%20of%20its%20open%3A%20whoever%20took%20a%20position%20during%20the%20engulfed%20candle%20is%20underwater%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22as%20a%20block%2C%20and%20their%20stops%20sit%20just%20beyond%20the%20far%20extreme%20of%20the%20engulfing%20candle%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22which%20supplies%20forced%20flow%20in%20the%20same%20direction.%20That%20is%20the%20mechanism%20attributed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20it%2C%20and%20it%20is%20registered%20with%20no%20filter%20at%20all%2C%20exactly%20as%20the%20canon%20states%20it%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22so%20that%20the%20conditioned%20version%20%28candles.engulfing_trend%29%20has%20something%20to%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22measured%20against.%22%2C%0A%20%20%20%20prior%3D%22We%20predict%20NO%20edge%3A%20we%20expect%20an%20expectancy%20indistinguishable%20from%20zero%20gross%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22negative%20once%20fees%20are%20deducted%2C%20because%20without%20context%20an%20engulfing%20candle%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mechanically%20%27a%20big%20candle%20that%20closed%20strong%27%2C%20which%20in%20BTC%20turns%20up%20more%20often%20at%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22end%20of%20a%20liquidation%20cascade%20than%20at%20the%20start%20of%20a%20move.%20It%20is%20falsified%20if%20the%20net%20%22%0A%20%20%20%20%20%20%20%20%20%20%22delta%20against%20the%20null%20arm%20is%20clearly%20positive%20on%20any%20of%20the%20three%20timeframes%3B%20it%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsified%20too%2C%20in%20the%20other%20direction%2C%20if%20it%20is%20clearly%20negative%2C%20which%20would%20mean%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22pattern%20works%20inverted.%22%2C%0A%20%20%20%20fn%3D_engulfing_raw%2C%0A%20%20%20%20params%3D%7B%22pattern%22%3A%20%22CDLENGULFING%22%2C%20%22hold%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%202.%20Engulfing%20aligned%20with%20the%20underlying%20trend.%0A%23%20---------------------------------------------------------------------------%0Adef%20_engulfing_with_trend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLENGULFING%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%20200%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20ema%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.engulfing_trend%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Engulfing%20that%20agrees%20with%20the%20EMA%20200%22%2C%0A%20%20%20%20rationale%3D%22The%20same%20engulfing%20candle%2C%20but%20only%20when%20it%20points%20in%20the%20direction%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22underlying%20trend.%20The%20stop%20mechanism%20can%20only%20work%20if%20there%20is%20one%20side%20trapped%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22another%20with%20the%20capacity%20to%20push%3A%20in%20a%20rising%20market%20a%20bullish%20engulfing%20marks%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22sellers%20of%20the%20pullback%20as%20the%20trapped%20block%2C%20whereas%20a%20bullish%20engulfing%20inside%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22decline%20marks%20buyers%20who%20will%20keep%20running%20into%20supply%20above.%20This%20is%20not%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22parameter%20variant%20of%20the%20previous%20hypothesis%3A%20the%20previous%20one%20is%20the%20canon%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22unconditional%20claim%20and%20this%20one%20is%20the%20claim%20that%20the%20effect%20is%20CONDITIONAL%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22regime%3B%20the%20contrast%20between%20the%20two%20is%20the%20informative%20quantity%2C%20and%20the%20EMA%20200%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22fixed%20at%20its%20conventional%20value%20and%20not%20searched%20over.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%2C%20larger%20than%20candles.engulfing_raw%27s%2C%20and%20we%20expect%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22difference%20between%20the%20two%20to%20be%20larger%20than%20the%20absolute%20edge%20of%20either.%20It%20fails%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20filter%20improves%20nothing%20%28the%20pattern%20is%20not%20context-sensitive%20and%20its%20declared%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mechanism%20is%20false%29%20and%20it%20fails%20just%20the%20same%20if%20it%20improves%20but%20with%20a%20negative%20net%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expectancy%2C%20which%20would%20be%20nothing%20but%20BTC%27s%20structural%20bullish%20bias%2C%20filtered%20%E2%80%94%20not%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22pattern.%22%2C%0A%20%20%20%20fn%3D_engulfing_with_trend%2C%0A%20%20%20%20params%3D%7B%22pattern%22%3A%20%22CDLENGULFING%22%2C%20%22ema%22%3A%20200%2C%20%22hold%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%203.%20Hammer%20after%20a%20fall%20%28RSI%2014%20oversold%29.%0A%23%20---------------------------------------------------------------------------%0Adef%20_hammer_oversold%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLHAMMER%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20rsi%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%20%26%20%28rsi%20%3C%2030.0%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.hammer_oversold%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Hammer%20after%20an%20oversold%20fall%22%2C%0A%20%20%20%20rationale%3D%22A%20hammer%20is%20a%20candle%20whose%20price%20fell%20a%20long%20way%20and%20came%20back%3A%20the%20lower%20wick%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20visible%20footprint%20of%20passive%20demand%20that%20absorbed%20all%20the%20aggressive%20selling%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22handed%20the%20price%20back.%20That%20only%20says%20something%20after%20a%20fall%2C%20when%20the%20aggressive%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22selling%20is%20forced%20liquidation%20and%20not%20orderly%20placement%3A%20the%20forced%20seller%20is%20spent%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22within%20hours%2C%20the%20buyer%20who%20absorbed%20is%20still%20there%2C%20and%20the%20imbalance%20resolves%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22upwards.%20Without%20the%20fall%20beforehand%2C%20the%20same%20shape%20is%20just%20another%20candle%20inside%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22range%2C%20which%20is%20why%20the%20oversold%20condition%20is%20part%20of%20the%20hypothesis%20and%20not%20an%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22add-on.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20and%20only%20on%20the%20long%20side.%20We%20expect%20it%20to%20fail%20exactly%20%22%0A%20%20%20%20%20%20%20%20%20%20%22where%20the%20selling%20is%20not%20forced%20but%20informed%3A%20in%20sustained%20downtrends%20every%20absorption%20%22%0A%20%20%20%20%20%20%20%20%20%20%22gets%20retested%20and%20the%20hammer%20turns%20into%20a%20falling%20knife%2C%20so%20we%20anticipate%20a%20fat%20left%20%22%0A%20%20%20%20%20%20%20%20%20%20%22tail%20and%20a%20high%20hit%20rate%20with%20mediocre%20expectancy.%20Falsified%20if%20the%20sign%20is%20negative%2C%20or%20%22%0A%20%20%20%20%20%20%20%20%20%20%22if%20the%20net%20delta%20against%20the%20null%20arm%20cannot%20be%20told%20apart%20from%20zero.%22%2C%0A%20%20%20%20fn%3D_hammer_oversold%2C%0A%20%20%20%20params%3D%7B%22pattern%22%3A%20%22CDLHAMMER%22%2C%20%22rsi%22%3A%2014%2C%20%22rsi_threshold%22%3A%2030%2C%20%22hold%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%204.%20Shooting%20star%20after%20a%20rise%20%28RSI%2014%20overbought%29.%20The%20hammer%27s%20mirror%20image.%0A%23%20---------------------------------------------------------------------------%0Adef%20_shooting_star_overbought%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLSHOOTINGSTAR%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20rsi%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%20%26%20%28rsi%20%3E%2070.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.shooting_star_overbought%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Shooting%20star%20after%20an%20overbought%20rise%22%2C%0A%20%20%20%20rationale%3D%22Exact%20mirror%20of%20the%20hammer%3A%20a%20long%20upper%20wick%20after%20a%20rise%2C%20that%20is%2C%20passive%20supply%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20absorbed%20all%20the%20aggressive%20buying%20and%20handed%20the%20price%20back.%20It%20is%20registered%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22separately%20rather%20than%20as%20the%20short%20side%20of%20the%20same%20hypothesis%20because%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mechanism%20is%20NOT%20symmetric%3A%20aggressive%20buying%20at%20highs%20is%20discretionary%20and%20can%20walk%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22away%20at%20no%20cost%2C%20whereas%20aggressive%20selling%20at%20lows%20is%20usually%20forced%20liquidation%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20deadline.%20If%20the%20canon%27s%20symmetry%20held%2C%20both%20hypotheses%20ought%20to%20give%20a%20similar%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22edge%3B%20the%20comparison%20between%20the%20two%20is%20the%20content%20of%20this%20pair.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20an%20effect%20clearly%20SMALLER%20than%20the%20hammer%27s%20and%20we%20accept%20a%20negative%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expectancy%20as%20a%20likely%20outcome%3A%20shorting%20into%20strength%20in%20BTC%20fights%20both%20the%20asset%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%22positive%20drift%20and%20the%20market%27s%20long%20bias%20at%20once%2C%20and%20the%20funding%20cost%20of%20the%20short%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22not%20recovered%20within%20one%20candle.%20Falsified%20if%20its%20edge%20matches%20or%20beats%20the%20hammer%27s%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22which%20would%20mean%20absorption%20is%20symmetric%20and%20our%20forced-flow%20explanation%20is%20superfluous.%22%2C%0A%20%20%20%20fn%3D_shooting_star_overbought%2C%0A%20%20%20%20params%3D%7B%22pattern%22%3A%20%22CDLSHOOTINGSTAR%22%2C%20%22rsi%22%3A%2014%2C%20%22rsi_threshold%22%3A%2070%2C%20%22hold%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%205.%20Position%20of%20the%20close%20within%20the%20candle%27s%20range%20%28state%2C%20not%20event%29.%0A%23%20---------------------------------------------------------------------------%0Adef%20_close_in_range%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rng%20%3D%20h%20-%20l%0A%20%20%20%20ok%20%3D%20_no_nan%28h%2C%20l%2C%20c%29%20%26%20%28rng%20%3E%200.0%29%0A%20%20%20%20pos%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20np.divide%28c%20-%20l%2C%20rng%2C%20out%3Dpos%2C%20where%3Dok%29%0A%20%20%20%20out%5Bok%20%26%20%28pos%20%3E%3D%200.80%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28pos%20%3C%3D%200.20%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.close_in_range%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Close%20pinned%20to%20the%20range%20extreme%22%2C%0A%20%20%20%20rationale%3D%22The%20close%20is%20the%20only%20price%20both%20sides%20agreed%20to%20carry%20a%20position%20at%20from%20one%20candle%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22into%20the%20next%3B%20the%20rest%20of%20the%20range%20is%20prices%20somebody%20rejected.%20A%20close%20pinned%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20extreme%20of%20the%20range%20means%20the%20winning%20side%20still%20had%20unfilled%20demand%20when%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candle%20ended%3A%20that%20order%20does%20not%20vanish%20at%20the%20candle%20boundary%2C%20it%20keeps%20executing.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22It%20is%20the%20most%20stripped-down%20reading%20of%20candle%20shape%20there%20is%20%E2%80%94it%20needs%20no%20pattern%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%20and%20no%20context%E2%80%94%20and%20that%20is%20why%20it%20serves%20as%20the%20minimum%20benchmark%20against%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22which%20to%20judge%20the%20named%20patterns%20of%20this%20same%20family.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20continuation%3A%20a%20small%20positive%20edge%20on%201h%20and%204h.%20We%20expect%20it%20to%20cancel%20out%20%22%0A%20%20%20%20%20%20%20%20%20%20%22or%20flip%20sign%20on%201d%2C%20where%20the%20horizon%20gives%20reversion%20time%20to%20take%20over%2C%20and%20on%2015m%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22be%20positive%20gross%20but%20negative%20net%2C%20because%20the%20signal%20fires%20on%20almost%20one%20candle%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22three%20and%20the%20cost%20per%20turnover%20eats%20it.%20Falsified%20if%20the%20sign%20is%20negative%20on%201h%20and%204h%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22which%20would%20be%20evidence%20that%20a%20close%20at%20the%20extreme%20marks%20exhaustion%20and%20not%20residual%20%22%0A%20%20%20%20%20%20%20%20%20%20%22demand.%22%2C%0A%20%20%20%20fn%3D_close_in_range%2C%0A%20%20%20%20params%3D%7B%22upper_threshold%22%3A%200.80%2C%20%22lower_threshold%22%3A%200.20%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%206.%20Closing%20marubozu%3A%20a%20session%20won%20from%20end%20to%20end.%0A%23%20---------------------------------------------------------------------------%0Adef%20_marubozu_continuation%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLCLOSINGMARUBOZU%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.marubozu_continuation%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Big%20body%2C%20no%20wick%20at%20the%20close%22%2C%0A%20%20%20%20rationale%3D%22A%20closing%20marubozu%20is%20a%20large%20body%20with%20no%20wick%20on%20the%20close%20side%3A%20throughout%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whole%20candle%20there%20was%20not%20one%20moment%20in%20which%20the%20losing%20side%20managed%20to%20hand%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22price%20back%2C%20not%20even%20at%20the%20end.%20It%20is%20the%20signature%20of%20a%20flow%20imbalance%20that%20met%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22passive%20opposition%2C%20and%20an%20imbalance%20like%20that%20does%20not%20expire%20exactly%20at%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22arbitrary%20boundary%20of%20the%20candle.%20The%20closing%20variant%20is%20used%20and%20not%20the%20strict%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22marubozu%20because%20the%20informative%20extreme%20is%20the%20close%3B%20also%20demanding%20no%20wick%20at%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22open%20only%20adds%20rarity%20without%20adding%20mechanism.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20continuation%20in%20the%20direction%20of%20the%20body%2C%20with%20a%20small%20positive%20edge.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20it%20to%20fail%20at%20range%20extremes%20and%20at%20the%20end%20of%20long%20runs%2C%20where%20the%20same%20candle%20%22%0A%20%20%20%20%20%20%20%20%20%20%22is%20capitulation%20and%20not%20impulse%3B%20as%20we%20do%20not%20tell%20the%20two%20cases%20apart%20ex%20ante%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22average%20of%20both%20should%20come%20out%20weak.%20Falsified%20if%20the%20net%20sign%20is%20negative%2C%20which%20would%20%22%0A%20%20%20%20%20%20%20%20%20%20%22support%20the%20exhaustion%20reading%20over%20the%20continuation%20one.%22%2C%0A%20%20%20%20fn%3D_marubozu_continuation%2C%0A%20%20%20%20params%3D%7B%22pattern%22%3A%20%22CDLCLOSINGMARUBOZU%22%2C%20%22hold%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%207.%20Doji%20after%20a%20directional%20thrust%20%28ADX%2014%20%3E%2025%29.%20A%20hypothesis%20that%20predicts%20ZERO.%0A%23%20---------------------------------------------------------------------------%0Adef%20_doji_after_thrust%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLDOJI%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20adx%20%3D%20talib.ADX%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20di_plus%20%3D%20talib.PLUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20di_minus%20%3D%20talib.MINUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20adx%2C%20di_plus%2C%20di_minus%29%0A%20%20%20%20thrust%20%3D%20ok%20%26%20%28p%20%21%3D%200.0%29%20%26%20%28adx%20%3E%2025.0%29%0A%20%20%20%20out%5Bthrust%20%26%20%28di_plus%20%3E%20di_minus%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bthrust%20%26%20%28di_minus%20%3E%20di_plus%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.doji_after_thrust%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20doji%20inside%20a%20strong%20trend%22%2C%0A%20%20%20%20rationale%3D%22A%20doji%20is%20the%20first%20candle%20of%20a%20leg%20in%20which%20the%20dominant%20side%20finds%20enough%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22counterparty%20to%20end%20up%20where%20it%20started%3B%20inside%20a%20mature%20directional%20move%20it%20would%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mark%20the%20point%20at%20which%20the%20marginal%20buyer%20%28or%20seller%29%20runs%20out%2C%20and%20that%20is%20why%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22canon%20reads%20it%20as%20a%20warning%20of%20a%20turn.%20The%20direction%20of%20the%20thrust%20is%20taken%20from%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Wilder%27s%20directional%20system%20with%20its%20conventional%20parameter%2C%20so%20as%20not%20to%20introduce%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20window%20of%20our%20own.%20We%20register%20it%20because%20it%20is%20the%20most-cited%20candle%20hypothesis%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22we%20are%20able%20to%20state%20with%20an%20explicit%20mechanism%2C%20not%20because%20we%20believe%20in%20it.%22%2C%0A%20%20%20%20prior%3D%22We%20predict%20ZERO.%20In%20a%2024%2F7%20market%20there%20is%20no%20session%20open%20and%20no%20session%20close%2C%20so%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22doji%20is%20not%20a%20collective%20verdict%20but%20simply%20a%20small-bodied%20candle%2C%20and%20they%20turn%20up%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22handfuls%20during%20the%20low-volume%20hours%3B%20the%20semantics%20of%20%27indecision%27%20imports%20a%20session%20%22%0A%20%20%20%20%20%20%20%20%20%20%22structure%20that%20does%20not%20exist%20here.%20A%20prior%20of%20zero%20is%20falsifiable%20by%20any%20significant%20%22%0A%20%20%20%20%20%20%20%20%20%20%22effect%20in%20either%20direction%3A%20if%20fading%20the%20thrust%20gives%20a%20positive%20edge%2C%20our%20objection%20%22%0A%20%20%20%20%20%20%20%20%20%20%22about%20the%2024%2F7%20market%20is%20wrong%3B%20if%20it%20gives%20a%20negative%20one%2C%20the%20doji%20is%20continuation%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20canon%20has%20it%20inverted.%22%2C%0A%20%20%20%20fn%3D_doji_after_thrust%2C%0A%20%20%20%20params%3D%7B%22pattern%22%3A%20%22CDLDOJI%22%2C%20%22adx%22%3A%2014%2C%20%22adx_threshold%22%3A%2025%2C%20%22hold%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%208.%20Outsized%20wick%2C%20with%20no%20folklore%20attached%3A%20pure%20symmetric%20geometry.%0A%23%20---------------------------------------------------------------------------%0Adef%20_outsized_wick%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20ok%20%3D%20_no_nan%28o%2C%20h%2C%20l%2C%20c%29%0A%20%20%20%20rng%20%3D%20h%20-%20l%0A%20%20%20%20ok%20%26%3D%20rng%20%3E%200.0%0A%20%20%20%20body%20%3D%20np.abs%28c%20-%20o%29%0A%20%20%20%20lower_wick%20%3D%20np.minimum%28o%2C%20c%29%20-%20l%0A%20%20%20%20upper_wick%20%3D%20h%20-%20np.maximum%28o%2C%20c%29%0A%20%20%20%20long_side%20%3D%20ok%20%26%20%28lower_wick%20%3E%3D%202.0%20%2A%20body%29%20%26%20%28lower_wick%20%3E%3D%200.60%20%2A%20rng%29%0A%20%20%20%20short_side%20%3D%20ok%20%26%20%28upper_wick%20%3E%3D%202.0%20%2A%20body%29%20%26%20%28upper_wick%20%3E%3D%200.60%20%2A%20rng%29%0A%20%20%20%20out%5Blong_side%5D%20%3D%201%0A%20%20%20%20out%5Bshort_side%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.outsized_wick%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20long%20wick%2C%20no%20context%20required%22%2C%0A%20%20%20%20rationale%3D%22A%20long%20wick%20is%20the%20footprint%20of%20a%20level%20the%20price%20reached%20and%20came%20back%20from%3A%20proof%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20there%20really%20was%20passive%20liquidity%20there%2C%20which%20absorbed%20the%20aggressive%20flow%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20was%20left%20partly%20unfilled.%20Whoever%20has%20a%20large%20order%20at%20that%20price%20puts%20it%20back%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22so%20the%20level%20acts%20as%20a%20soft%20floor%20or%20ceiling%20over%20the%20following%20candles.%20It%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22defined%20by%20geometry%20alone%20%E2%80%94wick%20greater%20than%20twice%20the%20body%20and%20more%20than%2060%25%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22range%2C%20symmetric%20above%20and%20below%E2%80%94%20and%20without%20requiring%20a%20prior%20trend%20or%20a%20body%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%2C%20precisely%20in%20order%20to%20separate%20the%20absorption%20effect%20from%20the%20vocabulary%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22of%20hammer%20and%20shooting%20star%2C%20which%20add%20context%20conditions.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20in%20the%20direction%20opposite%20to%20the%20wick%2C%20larger%20on%204h%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%22on%2015m.%20We%20expect%20it%20to%20fail%20in%20strong%20trends%2C%20where%20a%20long%20lower%20wick%20inside%20a%20fall%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22not%20absorption%20but%20a%20partial%20retracement%20before%20continuing%2C%20and%20we%20expect%20that%20on%2015m%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20gross%20edge%20will%20exist%20but%20will%20disappear%20once%20fees%20are%20deducted.%20Falsified%20if%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22sign%20is%20negative%2C%20or%20if%20it%20beats%20the%20null%20arm%20on%20no%20timeframe.%22%2C%0A%20%20%20%20fn%3D_outsized_wick%2C%0A%20%20%20%20params%3D%7B%22wick_vs_body%22%3A%202.0%2C%20%22wick_vs_range%22%3A%200.60%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%209.%20Range%20expansion%20against%20the%20ATR%3A%20informational%20shock%20or%20forced%20flow.%0A%23%20---------------------------------------------------------------------------%0Adef%20_range_expansion%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20atr_prev%20%3D%20_lag%28talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%2C%201%29%0A%20%20%20%20ok%20%3D%20_no_nan%28tr%2C%20atr_prev%2C%20o%2C%20c%29%20%26%20%28atr_prev%20%3E%200.0%29%0A%20%20%20%20shock%20%3D%20ok%20%26%20%28tr%20%3E%3D%202.0%20%2A%20atr_prev%29%0A%20%20%20%20pulse%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20pulse%5Bshock%20%26%20%28c%20%3E%20o%29%5D%20%3D%201%0A%20%20%20%20pulse%5Bshock%20%26%20%28c%20%3C%20o%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28pulse%2C%203%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.range_expansion%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Ride%20a%20candle%20that%20doubles%20the%20ATR%22%2C%0A%20%20%20%20rationale%3D%22A%20candle%20whose%20true%20range%20doubles%20the%20ATR%20of%20the%20previous%2014%20is%20not%20noise%3A%20it%20is%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22repricing%20in%20which%20the%20book%20was%20traded%20straight%20through.%20Our%20mechanism%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22informational%3A%20new%20information%20has%20come%20in%2C%20volatility%20clusters%2C%20and%20whoever%20has%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reposition%20a%20large%20portfolio%20does%20not%20do%20it%20inside%20a%20single%20candle%2C%20so%20the%20drift%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22carries%20on%20in%20the%20direction%20the%20body%20closed.%20The%20ATR%20is%20compared%20lagged%20by%20one%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candle%20so%20that%20the%20reference%20is%20the%20norm%20BEFORE%20the%20shock%20and%20not%20a%20norm%20already%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22contaminated%20by%20it.%20The%20signal%20is%20held%20for%20three%20candles%20because%20the%20declared%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mechanism%20%E2%80%94sliced%20repositioning%E2%80%94%20lasts%20more%20than%20one%2C%20not%20because%20three%20works%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22better.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20continuation%3A%20a%20positive%20edge%20in%20the%20direction%20of%20the%20shock%20candle%27s%20body.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22There%20is%20an%20explicit%20and%20credible%20rival%20mechanism%20%E2%80%94that%20the%20large%20range%20is%20a%20liquidation%20%22%0A%20%20%20%20%20%20%20%20%20%20%22cascade%2C%20that%20is%2C%20forced%20flow%20carrying%20no%20information%2C%20which%20market%20makers%20revert%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22they%20requote%E2%80%94%20and%20that%20mechanism%20predicts%20the%20OPPOSITE%20sign.%20That%20is%20why%20the%20sign%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22result%20is%20informative%20whatever%20happens%3A%20positive%20supports%20the%20informational%20reading%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22negative%20supports%20the%20forced-flow%20one%2C%20and%20zero%20says%20the%20two%20cancel%20out%20because%20we%20do%20%22%0A%20%20%20%20%20%20%20%20%20%20%22not%20tell%20the%20two%20cases%20apart%20ex%20ante%2C%20which%20is%20what%20we%20consider%20most%20likely%20on%2015m.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22AUDIT%20NOTE%20%282026-09-08%29%3A%20%60volatility.wide_range_thrust%60%20applies%20this%20very%20same%20rule%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%28true%20range%20greater%20than%20twice%20the%20previous%20ATR%2C%20direction%20given%20by%20the%20body%29%20with%20one%20%22%0A%20%20%20%20%20%20%20%20%20%20%22added%20condition%20%E2%80%94that%20the%20previous%20candle%27s%20ATR%20was%20below%20its%20100-bar%20median%E2%80%94%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22without%20holding%20the%20signal%20for%20three%20candles.%20Measured%20on%20data%2C%20its%20events%20are%20an%20almost%20%22%0A%20%20%20%20%20%20%20%20%20%20%22exact%20SUBSET%20of%20this%20hypothesis%27s%20%28263%20of%20267%20match%20candle%20for%20candle%29.%20Neither%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22removed%2C%20because%20the%20unfiltered%20%2F%20filtered%20pair%20is%20informative%20and%20that%20contrast%20was%20%22%0A%20%20%20%20%20%20%20%20%20%20%22declared%20in%20neither%20of%20the%20two%20files%2C%20but%20let%20it%20be%20said%20now%3A%20they%20are%20not%20two%20%22%0A%20%20%20%20%20%20%20%20%20%20%22independent%20trials%20and%20they%20must%20not%20be%20read%20as%20cross-family%20confirmation%20if%20both%20come%20%22%0A%20%20%20%20%20%20%20%20%20%20%22out%20positive.%20The%20contrast%20that%20matters%20is%20whether%20the%20compression%20gate%20improves%20on%20this%20%22%0A%20%20%20%20%20%20%20%20%20%20%22one.%22%2C%0A%20%20%20%20fn%3D_range_expansion%2C%0A%20%20%20%20params%3D%7B%22atr%22%3A%2014%2C%20%22multiple%22%3A%202.0%2C%20%22hold%22%3A%203%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%2010.%20Inside%20candle%20and%20break%20of%20the%20mother%20candle.%0A%23%20---------------------------------------------------------------------------%0Adef%20_inside_bar_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20h1%2C%20l1%20%3D%20_lag%28h%2C%201%29%2C%20_lag%28l%2C%201%29%0A%20%20%20%20h2%2C%20l2%20%3D%20_lag%28h%2C%202%29%2C%20_lag%28l%2C%202%29%0A%20%20%20%20ok%20%3D%20_no_nan%28c%2C%20h1%2C%20l1%2C%20h2%2C%20l2%29%0A%20%20%20%20inside%20%3D%20ok%20%26%20%28h1%20%3C%3D%20h2%29%20%26%20%28l1%20%3E%3D%20l2%29%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3E%20h2%29%5D%20%3D%201%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3C%20l2%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.inside_bar_break%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Inside%20candle%2C%20then%20close%20beyond%20the%20mother%22%2C%0A%20%20%20%20rationale%3D%22A%20candle%20contained%20within%20the%20range%20of%20the%20previous%20one%20is%20a%20contraction%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22traded%20range%3A%20both%20sides%20accept%20the%20same%20price%20interval%20and%20uncertainty%20drops.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Protective%20orders%20pile%20up%20there%20on%20both%20sides%20of%20the%20mother%20candle%27s%20extremes.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22next%20candle%20closing%20outside%20that%20range%20means%20the%20passive%20liquidity%20on%20one%20side%20has%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22been%20consumed%2C%20and%20the%20path%20of%20least%20resistance%20becomes%20the%20cluster%20of%20stops%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22other.%20The%20break%20is%20judged%20with%20the%20CLOSE%20of%20the%20candle%20in%20progress%20against%20extremes%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22of%20candles%20already%20closed%2C%20never%20with%20the%20intrabar%20high%2C%20so%20that%20the%20decision%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22belongs%20to%20candle%20i%20and%20not%20to%20data%20that%20is%20only%20known%20afterwards.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20continuation%20with%20a%20small%20positive%20edge%20on%204h%20and%201d.%20With%20low%20confidence%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22there%20is%20an%20equally%20plausible%20opposing%20mechanism%20in%20BTC%2C%20namely%20that%20the%20stop%20cluster%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20TARGET%20of%20the%20aggressive%20flow%20and%20not%20its%20fuel%2C%20in%20which%20case%20the%20break%20is%20false%20by%20%22%0A%20%20%20%20%20%20%20%20%20%20%22construction%20and%20the%20sign%20comes%20out%20negative.%20We%20also%20expect%20it%20to%20get%20worse%20as%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22timeframe%20drops%2C%20because%20range%20contraction%20on%201h%20is%20mostly%20low-volume%20hours%20and%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%22agreement%20between%20participants.%20Falsified%20by%20a%20stable%20negative%20sign.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22AUDIT%20NOTE%20%282026-09-08%29%3A%20this%20hypothesis%20was%20registered%20TWICE.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60structure.inside_bar_break%60%20was%20the%20same%20rule%20%E2%80%94same%20containment%2C%20same%20mother-candle%20%22%0A%20%20%20%20%20%20%20%20%20%20%22extremes%20as%20the%20level%2C%20same%20confirmation%20by%20close%E2%80%94%20and%20its%20244%20events%20were%20a%20strict%20%22%0A%20%20%20%20%20%20%20%20%20%20%22subset%20of%20this%20one%27s%20293%3B%20it%20has%20been%20removed%20there%20and%20this%20is%20the%20surviving%20%22%0A%20%20%20%20%20%20%20%20%20%20%22registration.%20It%20is%20further%20declared%20that%20%60volatility.inside_bar_breakout%60%20operates%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20SAME%20two-candle%20pattern%20but%20breaking%20the%20extremes%20of%20the%20INSIDE%20candle%20rather%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%22those%20of%20the%20mother%3A%20since%20the%20inside%20candle%27s%20high%20is%20the%20lower%20of%20the%20two%2C%20every%20event%20%22%0A%20%20%20%20%20%20%20%20%20%20%22of%20this%20hypothesis%20is%20also%20an%20event%20of%20that%20one.%20They%20are%20different%20levels%20and%20different%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mechanical%20claims%2C%20so%20that%20one%20is%20kept%2C%20but%20the%20two%20are%20DEPENDENT%20trials%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22multiple-comparisons%20correction%20must%20treat%20them%20as%20such.%22%2C%0A%20%20%20%20fn%3D_inside_bar_break%2C%0A%20%20%20%20params%3D%7B%22mother_bars%22%3A%201%2C%20%22confirmation%22%3A%20%22close%22%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%2011.%20A%20range%20gap%20between%20consecutive%20candles%20in%20a%2024%2F7%20market.%0A%23%20---------------------------------------------------------------------------%0Adef%20_range_gap%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20_c%20%3D%20_ohlc%28s%29%0A%20%20%20%20h1%2C%20l1%20%3D%20_lag%28h%2C%201%29%2C%20_lag%28l%2C%201%29%0A%20%20%20%20ok%20%3D%20_no_nan%28h%2C%20l%2C%20h1%2C%20l1%29%0A%20%20%20%20out%5Bok%20%26%20%28l%20%3E%20h1%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bok%20%26%20%28h%20%3C%20l1%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.range_gap%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20gap%2C%20expect%20it%20to%20fill%22%2C%0A%20%20%20%20rationale%3D%22BTC%20trades%20without%20interruption%2C%20so%20a%20gap%20cannot%20be%20the%20result%20of%20information%20piling%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22up%20while%20the%20market%20was%20closed%3A%20if%20a%20candle%27s%20entire%20range%20sits%20above%20the%20previous%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candle%27s%20high%2C%20the%20book%20has%20been%20emptied%20and%20the%20price%20has%20travelled%20with%20no%20trading%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20between.%20That%20is%20forced%20flow%20%E2%80%94chained%20liquidations%2C%20or%20a%20stretch%20of%20very%20thin%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22liquidity%E2%80%94%20and%20not%20a%20consented%20repricing%3A%20as%20soon%20as%20the%20market%20makers%20quote%20again%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20gap%20fills.%20Warning%20registered%20in%20advance%3A%20a%20hole%20in%20the%20provider%27s%20data%20produces%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exactly%20this%20same%20shape%2C%20so%20a%20positive%20result%20obliges%20us%20to%20check%20the%20continuity%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20timestamps%20before%20believing%20it.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20reversion%3A%20a%20positive%20edge%20trading%20AGAINST%20the%20gap%2C%20larger%20on%2015m%20than%20on%204h.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22We%20expect%20it%20to%20fail%20when%20the%20gap%20answers%20to%20real%20news%20%28a%20legitimate%20repricing%20that%20does%20%22%0A%20%20%20%20%20%20%20%20%20%20%22not%20fill%29%2C%20a%20case%20we%20cannot%20tell%20apart%20ex%20ante%2C%20and%20we%20expect%20very%20few%20signals%20on%204h%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22where%20a%20full-range%20gap%20implies%20a%20change%20of%20regime%20and%20ought%20to%20continue%20rather%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%22revert.%20Falsified%20if%20the%20sign%20is%20one%20of%20continuation%20on%2015m%20and%201h.%22%2C%0A%20%20%20%20fn%3D_range_gap%2C%0A%20%20%20%20params%3D%7B%22type%22%3A%20%22full_range_gap%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%2012.%20Three%20soldiers%20%2F%20three%20crows%3A%20the%20footprint%20of%20an%20order%20worked%20in%20slices.%0A%23%20---------------------------------------------------------------------------%0Adef%20_three_directional_bars%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20soldiers%20%3D%20np.asarray%28talib.CDL3WHITESOLDIERS%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20crows%20%3D%20np.asarray%28talib.CDL3BLACKCROWS%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ok%20%3D%20_no_nan%28soldiers%2C%20crows%29%0A%20%20%20%20pulse%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20pulse%5Bok%20%26%20%28soldiers%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20pulse%5Bok%20%26%20%28crows%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28pulse%2C%203%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.three_directional_bars%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Three%20soldiers%20or%20crows%2C%20a%20sliced%20order%22%2C%0A%20%20%20%20rationale%3D%22Three%20candles%20in%20a%20row%20with%20wide%20bodies%2C%20each%20closing%20near%20its%20high%20and%20above%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22previous%20one%2C%20is%20not%20an%20impulse%3A%20it%20is%20the%20footprint%20of%20a%20large%20order%20being%20executed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20slices%20over%20time.%20A%20speculative%20impulse%20burns%20out%20in%20one%20candle%3B%20an%20execution%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22programme%20follows%20a%20schedule%20and%20that%20is%20why%20it%20leaves%20three%20identical%20candles.%20If%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20reading%20is%20right%2C%20the%20unexecuted%20part%20of%20the%20programme%20goes%20on%20buying%20after%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22third%20candle%2C%20and%20that%20is%20why%20the%20signal%20is%20held%20for%20three%20candles%3A%20it%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22horizon%20of%20the%20declared%20mechanism%2C%20not%20a%20value%20chosen%20for%20performance.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20weak%20continuation.%20Weak%20because%20the%20entry%20is%20late%20by%20construction%3A%20by%20the%20time%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20pattern%20completes%2C%20three%20candles%20of%20the%20move%20have%20already%20happened%20and%20we%20are%20buying%20%22%0A%20%20%20%20%20%20%20%20%20%20%22against%20the%20executor%20itself.%20We%20register%20in%20advance%20that%20both%20patterns%20are%20rare%20and%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20number%20of%20signals%20will%20be%20small%2C%20so%20the%20interval%20will%20be%20wide%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22multiple-comparisons%20correction%20must%20be%20applied%20all%20the%20same%3A%20a%20spectacular%20result%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20small%20n%20counts%20as%20inconclusive%2C%20not%20as%20a%20finding.%20Falsified%20by%20a%20negative%20sign%2C%20which%20%22%0A%20%20%20%20%20%20%20%20%20%20%22would%20support%20the%20exhaustion%20reading.%22%2C%0A%20%20%20%20fn%3D_three_directional_bars%2C%0A%20%20%20%20params%3D%7B%22patterns%22%3A%20%22CDL3WHITESOLDIERS%2FCDL3BLACKCROWS%22%2C%20%22hold%22%3A%203%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20---------------------------------------------------------------------------%0A%23%2013.%20Body%20flow%20over%2020%20candles%3A%20how%20much%20of%20the%20range%20turns%20into%20progress%20%28state%29.%0A%23%20---------------------------------------------------------------------------%0Adef%20_body_flow%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20body_sum%20%3D%20talib.SUM%28c%20-%20o%2C%2020%29%0A%20%20%20%20range_sum%20%3D%20talib.SUM%28h%20-%20l%2C%2020%29%0A%20%20%20%20ok%20%3D%20_no_nan%28body_sum%2C%20range_sum%29%20%26%20%28range_sum%20%3E%200.0%29%0A%20%20%20%20flow%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20np.divide%28body_sum%2C%20range_sum%2C%20out%3Dflow%2C%20where%3Dok%29%0A%20%20%20%20out%5Bok%20%26%20%28flow%20%3E%3D%200.30%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28flow%20%3C%3D%20-0.30%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22candles.body_flow_20%22%2C%0A%20%20%20%20family%3D%22candles%22%2C%0A%20%20%20%20title%3D%22Range%20turned%20into%20progress%20over%2020%20candles%22%2C%0A%20%20%20%20rationale%3D%22Aggregates%20candle%20shape%20instead%20of%20hunting%20for%20a%20pattern%3A%20it%20measures%20what%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22proportion%20of%20all%20the%20range%20traded%20over%2020%20candles%20has%20turned%20into%20net%20open-to-close%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22progress.%20When%20that%20proportion%20is%20high%2C%20the%20same%20side%20is%20systematically%20winning%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22sessions%20and%20the%20range%20is%20being%20travelled%2C%20not%20round-tripped%3A%20there%20are%20directional%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22participants%20dominating%20the%20market%20makers.%20When%20it%20is%20low%2C%20price%20moves%20but%20is%20handed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22back%20within%20each%20candle%2C%20which%20is%20the%20signature%20of%20market-maker%20inventory.%20It%20is%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20moving%20average%3A%20it%20ignores%20the%20jumps%20between%20candles%20and%20weights%20by%20the%20range%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22traded%2C%20so%20two%20series%20with%20identical%20price%20travel%20can%20give%20opposite%20values.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20a%20trending%20regime%20and%20none%20or%20a%20negative%20one%20in%20a%20range%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20we%20expect%20the%20two%20together%20to%20come%20out%20barely%20above%20zero.%20The%20strong%2C%20falsifiable%20%22%0A%20%20%20%20%20%20%20%20%20%20%22claim%20is%20one%20of%20incremental%20value%3A%20if%20candle%20shape%20adds%20nothing%20over%20the%20plain%20direction%20%22%0A%20%20%20%20%20%20%20%20%20%20%22of%20price%2C%20this%20hypothesis%20should%20be%20indistinguishable%20from%20an%20ordinary%20trend%20filter%20over%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20same%20candles%3B%20that%20it%20contributes%20something%20above%20that%20is%20what%20would%20make%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%22interesting%2C%20and%20we%20do%20not%20take%20it%20for%20granted.%22%2C%0A%20%20%20%20fn%3D_body_flow%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%2020%2C%20%22threshold%22%3A%200.30%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=78f9ffbb7ad5a30af83bbccce73b970146d642d474e7588312336ed81ebcc612\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":11,"row_hash":"6f3844db36d074523b45f885402a2bfda0f607781a4a0721f80168ba2d4a52d5","body":"wavelab-journal-chain\nv=3\nseq=11\nprev=9a81214f724937addd9d7716298b3425f6e78b8a37c43bb1434d0d4551c18e3e\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fflow.py\nprereg_seq=2\nsource_text=%22%22%22Family%20%60flow%60%3A%20volume%20and%20order%20flow.%0A%0APRE-REGISTERED.%20Everything%20in%20this%20file%20was%20written%20BEFORE%20running%20a%20single%20backtest%20and%20without%0Alooking%20at%20a%20single%20result.%20The%20parameters%20are%20the%20conventional%20values%20from%20the%20literature%2C%20fixed%0Aonce%20and%20for%20all%3B%20not%20one%20of%20them%20was%20chosen%20by%20comparing%20returns.%0A%0AThe%20family%27s%20thesis%3A%20price%20says%20what%20happened%2C%20volume%20says%20how%20much%20conviction%20was%20behind%20it.%20An%0Aadvance%20that%20moves%20twice%20the%20usual%20number%20of%20contracts%20leaves%20inventory%20in%20hands%20that%20will%20have%20to%0Adefend%20it%20or%20close%20it%3B%20an%20advance%20on%20thin%20volume%20leaves%20nothing%20and%20obliges%20nobody%20to%20do%20anything%0Aafterwards.%20Every%20hypothesis%20below%20is%20a%20variation%20on%20that%20idea%2C%20and%20several%20of%20them%20contradict%20each%0Aother%20on%20purpose%3A%20if%20the%20market%20rewarded%20continuation%20on%20volume%20and%20fading%20on%20volume%20at%20the%20same%0Atime%2C%20the%20whole%20family%20would%20be%20measuring%20noise.%0A%0ALimitation%20accepted%20and%20declared%3A%20%60Series%60%20only%20exposes%20o%2Fh%2Fl%2Fc%2Fv%2C%20so%20there%20is%20NO%20%60taker_buy_base%60%0Aand%20no%20real%20volume%20delta.%20Where%20the%20sign%20of%20the%20aggression%20is%20needed%20we%20use%20the%20Close%20Location%0AValue%20%28where%20the%20candle%20closes%20inside%20its%20own%20range%29%2C%20which%20is%20the%20best%20proxy%20that%20can%20be%20built%0Afrom%20OHLCV%20and%20is%20exactly%20what%20the%20Accumulation%2FDistribution%20line%20assumes.%20It%20is%20a%20biased%20proxy%3A%20on%0Aa%20candle%20with%20a%20long%20wick%20caused%20by%20liquidations%20it%20attributes%20aggressive%20buying%20where%20there%20was%0Aonly%20a%20stop%20run.%20That%20weakness%20is%20part%20of%20what%20is%20being%20put%20to%20the%20test%2C%20not%20an%20oversight.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20Repo%20convention%20%28%60Bar.open_time_ms%60%2C%20%60Timeframe.ms%60%29%3A%20timestamps%20are%20epoch%20in%20MILLISECONDS%20on%20the%0A%23%20UTC%20grid.%20The%20VWAP%27s%20session%20anchor%20depends%20on%20that.%0A_DAY_MS%20%3D%2086_400_000%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20Utilities.%20All%20strictly%20causal%3A%20position%20i%20only%20looks%20at%20positions%20j%20%3C%3D%20i.%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_f%28a%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22talib%20demands%20contiguous%20float64.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28a%2C%20dtype%3Dnp.float64%29%0A%0A%0Adef%20_finite%28%2Aarrays%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22True%20where%20ALL%20the%20arrays%20hold%20a%20real%20number.%0A%0A%20%20%20%20talib%20returns%20NaN%20during%20warm-up%2C%20and%20divisions%20by%20a%20zero%20range%20produce%20inf.%20It%20is%20checked%0A%20%20%20%20explicitly%20instead%20of%20trusting%20that%20%60NaN%20%3E%20x%60%20yields%20False%2C%20and%20above%20all%20instead%20of%20using%0A%20%20%20%20nan_to_num%2C%20which%20would%20turn%20the%20warm-up%20into%20invented%20signals.%0A%20%20%20%20%22%22%22%0A%20%20%20%20ok%20%3D%20np.ones%28arrays%5B0%5D.shape%2C%20dtype%3Dbool%29%0A%20%20%20%20for%20a%20in%20arrays%3A%0A%20%20%20%20%20%20%20%20ok%20%26%3D%20~np.isnan%28a%29%0A%20%20%20%20%20%20%20%20ok%20%26%3D%20~np.isinf%28a%29%0A%20%20%20%20return%20ok%0A%0A%0Adef%20_clv%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Close%20Location%20Value%20in%20%5B-1%2C%20%2B1%5D%3A%20a%20proxy%20for%20the%20sign%20of%20the%20aggression.%0A%0A%20%20%20%20%2B1%20%3D%20closes%20at%20the%20high%20%28the%20buyer%20took%20the%20candle%29%2C%20-1%20%3D%20closes%20at%20the%20low.%0A%20%20%20%20Zero-range%20candles%20end%20up%20at%200%2C%20not%20at%20NaN%20and%20not%20at%20inf.%0A%20%20%20%20%22%22%22%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%0A%20%20%20%20rng%20%3D%20h%20-%20l%0A%20%20%20%20clv%20%3D%20np.zeros%28rng.shape%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20np.divide%28%28c%20-%20l%29%20-%20%28h%20-%20c%29%2C%20rng%2C%20out%3Dclv%2C%20where%3Drng%20%3E%200%29%0A%20%20%20%20return%20clv%0A%0A%0Adef%20_hold%28ev%3A%20np.ndarray%2C%20k%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Propagates%20each%20non-zero%20event%20over%20k%20bars.%0A%0A%20%20%20%20Causal%20by%20construction%3A%20at%20position%20i%20only%20an%20event%20whose%20index%20j%20satisfies%20j%20%3C%3D%20i%20can%20appear.%0A%20%20%20%20%60np.maximum.accumulate%60%20is%20a%20forward%20sweep%2C%20never%20a%20backward%20one.%0A%20%20%20%20%22%22%22%0A%20%20%20%20n%20%3D%20ev.size%0A%20%20%20%20i%20%3D%20np.arange%28n%29%0A%20%20%20%20idx%20%3D%20np.where%28ev%20%21%3D%200%2C%20i%2C%20-1%29%0A%20%20%20%20last%20%3D%20np.maximum.accumulate%28idx%29%0A%20%20%20%20alive%20%3D%20%28last%20%3E%3D%200%29%20%26%20%28%28i%20-%20last%29%20%3C%20k%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20out%5Balive%5D%20%3D%20ev%5Blast%5Balive%5D%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_session_vwap%28s%3A%20Series%29%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20%22%22%22VWAP%20anchored%20to%20the%20UTC%20day%2C%20its%20volume-weighted%20standard%20deviation%2C%20and%20how%20many%20candles%0A%20%20%20%20we%20are%20into%20the%20anchor.%0A%0A%20%20%20%20Accumulates%20ONLY%20from%20the%20start%20of%20the%20current%20day%20up%20to%20and%20including%20i.%20The%20subtraction%20of%0A%20%20%20%20cumulative%20sums%20uses%20the%20index%20before%20the%20anchor%2C%20clamped%20at%200%2C%20so%20that%20we%20never%20index%20with%20-1%0A%20%20%20%20%28which%20in%20numpy%20would%20return%20the%20LAST%20element%20of%20the%20array%2C%20that%20is%2C%20the%20entire%20future%29.%0A%20%20%20%20%22%22%22%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20tp%20%3D%20talib.TYPPRICE%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%29%0A%20%20%20%20v%20%3D%20_f%28s.volume%29%0A%20%20%20%20day%20%3D%20np.asarray%28s.ts%2C%20dtype%3Dnp.int64%29%20%2F%2F%20_DAY_MS%0A%0A%20%20%20%20is_new%20%3D%20np.ones%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20is_new%5B1%3A%5D%20%3D%20day%5B1%3A%5D%20%21%3D%20day%5B%3A-1%5D%0A%20%20%20%20i%20%3D%20np.arange%28n%29%0A%20%20%20%20start%20%3D%20np.maximum.accumulate%28np.where%28is_new%2C%20i%2C%200%29%29%0A%20%20%20%20has_prev%20%3D%20start%20%3E%200%0A%20%20%20%20prev%20%3D%20np.maximum%28start%20-%201%2C%200%29%0A%0A%20%20%20%20acc_v%20%3D%20np.cumsum%28v%29%0A%20%20%20%20acc_pv%20%3D%20np.cumsum%28tp%20%2A%20v%29%0A%20%20%20%20acc_pv2%20%3D%20np.cumsum%28tp%20%2A%20tp%20%2A%20v%29%0A%20%20%20%20vol%20%3D%20acc_v%20-%20np.where%28has_prev%2C%20acc_v%5Bprev%5D%2C%200.0%29%0A%20%20%20%20pv%20%3D%20acc_pv%20-%20np.where%28has_prev%2C%20acc_pv%5Bprev%5D%2C%200.0%29%0A%20%20%20%20pv2%20%3D%20acc_pv2%20-%20np.where%28has_prev%2C%20acc_pv2%5Bprev%5D%2C%200.0%29%0A%0A%20%20%20%20vwap%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28pv%2C%20vol%2C%20out%3Dvwap%2C%20where%3Dvol%20%3E%200%29%0A%20%20%20%20m2%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28pv2%2C%20vol%2C%20out%3Dm2%2C%20where%3Dvol%20%3E%200%29%0A%20%20%20%20var%20%3D%20m2%20-%20vwap%20%2A%20vwap%0A%20%20%20%20var%5B~np.isnan%28var%29%20%26%20%28var%20%3C%200.0%29%5D%20%3D%200.0%20%20%20%23%20floating-point%20noise%2C%20not%20negative%20variance%0A%20%20%20%20return%20vwap%2C%20np.sqrt%28var%29%2C%20%28i%20-%20start%20%2B%201%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%201.%20OBV%20against%20its%20own%20average%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_obv_ema21%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20obv%20%3D%20talib.OBV%28_f%28s.close%29%2C%20_f%28s.volume%29%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28obv%2C%2021%29%0A%20%20%20%20ok%20%3D%20_finite%28obv%2C%20ema%29%0A%20%20%20%20out%5Bok%20%26%20%28obv%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28obv%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.obv_ema21%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Long%20while%20OBV%20holds%20above%20its%20average%22%2C%0A%20%20%20%20rationale%3D%22OBV%20adds%20up%20each%20candle%27s%20entire%20volume%20with%20the%20sign%20of%20its%20close%2C%20so%20its%20slope%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22measures%20whether%20the%20recent%20contracts%20have%20moved%20more%20on%20up%20candles%20or%20on%20down%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22ones.%20The%20concrete%20mechanism%3A%20whoever%20buys%20into%20the%20rise%20ends%20up%20with%20inventory%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22can%20only%20be%20unwound%20by%20selling%2C%20and%20until%20it%20is%20unwound%20they%20hold%20up%20the%20bid%3B%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whoever%20sold%20has%20to%20buy%20back.%20When%20the%20cumulative%20line%20rises%20above%20its%20own%2021-period%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22average%20there%20is%20more%20new%20inventory%20in%20long%20hands%20than%20has%20been%20let%20go%2C%20and%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22imbalance%20in%20positioning%20should%20push%20the%20price%20before%20it%20resolves.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20in%20a%20trending%20regime%20%284h%2F1d%29%20and%20no%20edge%20or%20a%20negative%20%22%0A%20%20%20%20%20%20%20%20%20%20%22one%20in%20a%20range%2C%20where%20OBV%20crosses%20its%20average%20constantly%20without%20any%20real%20movement%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22inventory.%20Strong%20falsification%3A%20if%20the%20edge%20is%20the%20SAME%20in%20a%20trend%20and%20in%20a%20range%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22declared%20mechanism%20is%20false%20and%20this%20is%20nothing%20more%20than%20a%20slow%20trend%20follower%20dressed%20%22%0A%20%20%20%20%20%20%20%20%20%20%22up%20as%20volume.%20We%20also%20expect%20it%20to%20fail%20in%20periods%20dominated%20by%20liquidation%20cascades%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22where%20OBV%20attributes%20accumulation%20to%20what%20was%20forced%20liquidation.%22%2C%0A%20%20%20%20fn%3D_obv_ema21%2C%0A%20%20%20%20params%3D%7B%22ema%22%3A%2021%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%202.%20Price-OBV%20divergence%3A%20price%20makes%20a%20new%20extreme%20and%20volume%20does%20not%20follow%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_obv_divergence%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20obv%20%3D%20talib.OBV%28c%2C%20_f%28s.volume%29%29%0A%20%20%20%20max_c%2C%20min_c%20%3D%20talib.MAX%28c%2C%2020%29%2C%20talib.MIN%28c%2C%2020%29%0A%20%20%20%20max_o%2C%20min_o%20%3D%20talib.MAX%28obv%2C%2020%29%2C%20talib.MIN%28obv%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28c%2C%20obv%2C%20max_c%2C%20min_c%2C%20max_o%2C%20min_o%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20%23%20talib%27s%20MAX%2FMIN%20include%20the%20current%20candle%3A%20%60c%20%3E%3D%20max_c%60%20is%20exactly%20%22new%2020-bar%20high%22.%0A%20%20%20%20ev%5Bok%20%26%20%28c%20%3E%3D%20max_c%29%20%26%20%28obv%20%3C%20max_o%29%5D%20%3D%20-1%0A%20%20%20%20ev%5Bok%20%26%20%28c%20%3C%3D%20min_c%29%20%26%20%28obv%20%3E%20min_o%29%5D%20%3D%201%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.obv_divergence20%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20extreme%20OBV%20does%20not%20confirm%22%2C%0A%20%20%20%20rationale%3D%22A%20price%20high%20NOT%20accompanied%20by%20an%20OBV%20high%20means%20the%20last%20leg%20was%20signed%20by%20fewer%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22contracts%20than%20the%20one%20before%3A%20price%20rises%20because%20supply%20has%20withdrawn%2C%20not%20because%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22new%20demand%20has%20come%20in.%20A%20book%20that%20rises%20through%20the%20absence%20of%20sellers%20is%20thin%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20one%20order%20of%20size%20is%20enough%20to%20go%20through%20it%20the%20other%20way.%20The%20symmetric%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reading%20holds%20at%20lows%3A%20a%20lower%20price%20with%20an%20OBV%20that%20no%20longer%20follows%20it%20indicates%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20the%20selling%20has%20run%20out%20of%20ammunition.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20at%20a%20short%20horizon%20%28the%20event%20is%20held%20for%205%20candles%29%20and%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20concentrates%20at%20range%20extremes%2C%20not%20in%20established%20trends.%20We%20expect%20it%20to%20FAIL%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22to%20lose%20money%2C%20in%20strong%20and%20persistent%20trends%3A%20there%20the%20divergence%20shows%20up%20dozens%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22times%20in%20a%20row%20while%20price%20goes%20on%20rising%2C%20and%20this%20is%20precisely%20the%20indicator%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22ruins%20whoever%20tries%20to%20call%20tops.%20If%20the%20edge%20turned%20out%20to%20be%20as%20good%20in%20a%20trend%20as%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20range%2C%20we%20would%20suspect%20the%20proxy%20before%20we%20suspected%20the%20market.%22%2C%0A%20%20%20%20fn%3D_obv_divergence%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%2020%2C%20%22hold_bars%22%3A%205%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%203.%20The%20other%20diagonal%3A%20OBV%20makes%20a%20new%20extreme%20and%20price%20has%20not%20yet%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_obv_leads%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20obv%20%3D%20talib.OBV%28c%2C%20_f%28s.volume%29%29%0A%20%20%20%20max_c%2C%20min_c%20%3D%20talib.MAX%28c%2C%2020%29%2C%20talib.MIN%28c%2C%2020%29%0A%20%20%20%20max_o%2C%20min_o%20%3D%20talib.MAX%28obv%2C%2020%29%2C%20talib.MIN%28obv%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28c%2C%20obv%2C%20max_c%2C%20min_c%2C%20max_o%2C%20min_o%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bok%20%26%20%28obv%20%3E%3D%20max_o%29%20%26%20%28c%20%3C%20max_c%29%5D%20%3D%201%0A%20%20%20%20ev%5Bok%20%26%20%28obv%20%3C%3D%20min_o%29%20%26%20%28c%20%3E%20min_c%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.obv_leads20%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Follow%20the%20extreme%20OBV%20reaches%20first%22%2C%0A%20%20%20%20rationale%3D%22It%20is%20the%20opposite%20cell%20of%20the%20same%202x2%20table%20as%20%60obv_divergence20%60%2C%20and%20it%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22registered%20separately%20because%20it%20asserts%20a%20different%20mechanism%20and%20trades%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22opposite%20direction%3A%20here%20the%20cumulative%20volume%20marks%20a%20new%20high%20while%20price%20has%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22yet.%20That%20is%20the%20signature%20of%20a%20large%20buyer%20slicing%20their%20order%20against%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22available%20supply%3A%20they%20absorb%20everything%20that%20comes%20out%20without%20letting%20the%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rise%2C%20because%20pushing%20it%20up%20would%20make%20their%20own%20execution%20more%20expensive.%20When%20they%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exhaust%20that%20supply%2C%20the%20price%20jumps%20with%20no%20resistance.%20Registering%20the%20two%20cells%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22separately%20is%20what%20allows%20one%20to%20work%20and%20the%20other%20not%3B%20merging%20them%20into%20a%20single%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hypothesis%20would%20hide%20that%20result.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%2C%20less%20frequent%20than%20the%20classic%20divergence.%20We%20expect%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%22to%20fail%20in%20markets%20where%20volume%20is%20dominated%20by%20market%20makers%20recycling%20inventory%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22seconds%3A%20there%20the%20OBV%20shoots%20up%20without%20any%20directional%20accumulator%20existing%20at%20all.%20If%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60obv_leads20%60%20and%20%60obv_divergence20%60%20both%20came%20out%20positive%20with%20a%20similar%20%22%0A%20%20%20%20%20%20%20%20%20%20%22magnitude%2C%20we%20would%20read%20that%20not%20as%20two%20findings%20but%20as%20evidence%20that%20what%20wins%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22plain%20%2720-candle%20extreme%27%20event%20and%20not%20the%20volume.%22%2C%0A%20%20%20%20fn%3D_obv_leads%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%2020%2C%20%22hold_bars%22%3A%205%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%204.%20Money%20flow%20index%20at%20Wilder%27s%20extremes%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_mfi14%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20mfi%20%3D%20talib.MFI%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%2C%2014%29%0A%20%20%20%20ok%20%3D%20_finite%28mfi%29%0A%20%20%20%20out%5Bok%20%26%20%28mfi%20%3C%2020.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28mfi%20%3E%2080.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.mfi14_extremes%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Fade%20MFI%20at%2020%20and%2080%22%2C%0A%20%20%20%20rationale%3D%22The%20MFI%20is%20an%20RSI%20in%20which%20each%20candle%20is%20weighted%20by%20its%20volume%20in%20money%20terms%2C%20so%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22it%20only%20reaches%2080%20when%20the%20rise%20has%20been%20made%20on%20growing%20volume.%20That%20state%20is%20one%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20which%20almost%20everybody%20who%20wanted%20to%20buy%20has%20already%20bought%2C%20and%20has%20done%20so%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22size%20on%20top%20of%20that%3A%20the%20incoming%20flow%20runs%20out%20for%20want%20of%20new%20participants%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20marginal%20position%20is%20leveraged%20and%20recent%2C%20which%20is%20to%20say%20fragile.%20Below%2020%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22symmetric%20thing%20happens%20with%20forced%20selling.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20a%20ranging%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20strong%20trend%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22because%20buying%20below%2020%20during%20a%20cascading%20fall%20is%20buying%20in%20front%20of%20a%20train.%20As%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22signal%20is%20a%20state%20and%20not%20an%20event%2C%20we%20also%20expect%20long%20runs%20of%20consecutive%20losses%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20capitulations%20of%20March%202020%20or%20May%202021.%20If%20the%20overall%20edge%20came%20out%20positive%20but%20%22%0A%20%20%20%20%20%20%20%20%20%20%22only%20thanks%20to%20a%20handful%20of%20enormous%20bounces%2C%20we%20will%20count%20it%20as%20inconclusive%20and%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%22as%20a%20success.%22%2C%0A%20%20%20%20fn%3D_mfi14%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2014%2C%20%22oversold%22%3A%2020%2C%20%22overbought%22%3A%2080%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%205.%20Side%20of%20the%20session%20VWAP%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_vwap_side%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2010%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20vwap%2C%20_sd%2C%20_k%20%3D%20_session_vwap%28s%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ok%20%3D%20_finite%28vwap%2C%20c%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20vwap%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20vwap%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.vwap_session_side%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Long%20above%20the%20session%20VWAP%2C%20short%20below%22%2C%0A%20%20%20%20rationale%3D%22The%20session%20VWAP%20is%20not%20just%20one%20more%20indicator%3A%20it%20is%20the%20price%20against%20which%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22institutional%20execution%20is%20measured%20and%20settled%2C%20so%20there%20are%20real%20orders%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22conditioned%20on%20it.%20An%20execution%20algorithm%20with%20a%20buy%20order%20slows%20down%20if%20the%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20above%20the%20VWAP%20and%20speeds%20up%20if%20it%20is%20below%2C%20and%20the%20desks%20judge%20the%20trader%20by%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20difference.%20The%20mechanical%20consequence%20is%20that%20the%20side%20of%20the%20VWAP%20separates%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22two%20different%20regimes%20of%20supply%20and%20demand%20within%20the%20same%20day%2C%20not%20merely%20two%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22ranges.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20on%2015m%20and%201h%2C%20degrading%20as%20the%20timeframe%20rises%2C%20because%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20daily%20anchor%20stops%20meaning%20anything%20once%20each%20candle%20is%20a%20third%20of%20the%20session.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20it%20to%20fail%20on%20days%20with%20no%20direction%2C%20where%20the%20price%20crosses%20the%20VWAP%20ten%20times%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20only%20generates%20cost.%20BTC-specific%20falsification%3A%20crypto%20trades%2024%2F7%20and%20has%20no%20real%20%22%0A%20%20%20%20%20%20%20%20%20%20%22institutional%20session%2C%20so%20if%20the%20mechanism%20is%20true%20the%20edge%20ought%20to%20be%20SMALLER%20than%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22one%20this%20same%20indicator%20shows%20in%20equities%3B%20if%20it%20came%20out%20enormous%2C%20we%20would%20suspect%20we%20%22%0A%20%20%20%20%20%20%20%20%20%20%22are%20only%20measuring%20intraday%20momentum.%22%2C%0A%20%20%20%20fn%3D_vwap_side%2C%0A%20%20%20%20params%3D%7B%22anchor%22%3A%20%22utc_day%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%206.%20The%20VWAP%27s%202-sigma%20band%3A%20stretch%20against%20the%20volume-weighted%20average%20price%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_vwap_band%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20vwap%2C%20sd%2C%20k%20%3D%20_session_vwap%28s%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ok%20%3D%20_finite%28vwap%2C%20sd%2C%20c%29%20%26%20%28sd%20%3E%200.0%29%20%26%20%28k%20%3E%3D%2012%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20vwap%20%2B%202.0%20%2A%20sd%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20vwap%20-%202.0%20%2A%20sd%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.vwap_band2sigma%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Fade%20price%20two%20sigma%20from%20the%20VWAP%22%2C%0A%20%20%20%20rationale%3D%22It%20uses%20the%20same%20indicator%20as%20%60vwap_session_side%60%20but%20asserts%20the%20OPPOSITE%20mechanism%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20that%20is%20why%20it%20is%20a%20separate%20hypothesis%20and%20not%20a%20variant%3A%20here%20what%20matters%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20which%20side%20the%20price%20is%20on%20but%20how%20far%20away%20it%20has%20moved%2C%20measured%20in%20standard%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22deviations%20of%20the%20session%27s%20own%20volume%20distribution.%20Two%20sigma%20above%20means%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22current%20price%20has%20been%20paid%20by%20a%20minuscule%20fraction%20of%20the%20day%27s%20volume%3A%20almost%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nobody%20holds%20a%20position%20there%2C%20and%20the%20inventory%20of%20the%20market%20maker%20who%20absorbed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20rise%20is%20short%20and%20needs%20the%20price%20back%20in%20the%20zone%20where%20the%20bulk%20of%20the%20paper%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22changed%20hands.%20The%202-sigma%20threshold%20is%20Bollinger%27s%20conventional%20one%2C%20not%20a%20searched%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20on%2015m%20and%201h%20within%20sessions%20with%20no%20news%2C%20and%20clear%20losses%20%22%0A%20%20%20%20%20%20%20%20%20%20%22on%20breakout%20days%2C%20on%20which%20the%20price%20crosses%20the%20band%20in%20the%20morning%20and%20never%20comes%20%22%0A%20%20%20%20%20%20%20%20%20%20%22back.%20Since%20fading%20wins%20a%20little%20many%20times%20and%20loses%20a%20lot%20a%20few%20times%2C%20we%20require%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22edge%20to%20survive%20scrutiny%20of%20the%20tail%3A%20if%20the%20result%20depends%20on%20not%20having%20lived%20through%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%2012%20March%202020%2C%20it%20is%20a%20failure%2C%20not%20a%20success.%20We%20require%20at%20least%2012%20session%20candles%20%22%0A%20%20%20%20%20%20%20%20%20%20%22before%20emitting%20a%20signal%20because%20with%20fewer%20the%20sigma%20is%20a%20three-point%20estimate%3B%20it%20is%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22statistical%20minimum%2C%20not%20a%20tuned%20threshold.%22%2C%0A%20%20%20%20fn%3D_vwap_band%2C%0A%20%20%20%20params%3D%7B%22anchor%22%3A%20%22utc_day%22%2C%20%22sigmas%22%3A%202.0%2C%20%22min_session_bars%22%3A%2012%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%207.%20Thrust%3A%20high%20effort%20WITH%20result%20%28double%20volume%20and%20an%20expanding%20range%29%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_volume_thrust%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20h%2C%20l%2C%20c%2C%20v%20%3D%20_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20v_mean%20%3D%20talib.SMA%28v%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20clv%20%3D%20_clv%28s%29%0A%20%20%20%20rel%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28v%2C%20v_mean%2C%20out%3Drel%2C%20where%3D~np.isnan%28v_mean%29%20%26%20%28v_mean%20%3E%200.0%29%29%0A%20%20%20%20ok%20%3D%20_finite%28rel%2C%20atr%2C%20tr%29%20%26%20%28atr%20%3E%200.0%29%0A%20%20%20%20strong%20%3D%20ok%20%26%20%28rel%20%3E%202.0%29%20%26%20%28tr%20%3E%20atr%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bstrong%20%26%20%28clv%20%3E%200.5%29%5D%20%3D%201%0A%20%20%20%20ev%5Bstrong%20%26%20%28clv%20%3C%20-0.5%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.volume_thrust%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Follow%20double%20volume%20on%20an%20expanding%20range%22%2C%0A%20%20%20%20rationale%3D%22A%20candle%20with%20twice%20the%20average%20volume%2C%20a%20range%20greater%20than%20the%20ATR%20and%20a%20close%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20top%20quarter%20of%20that%20range%20only%20happens%20when%20somebody%20crosses%20the%20spread%20over%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22over%20and%20takes%20out%20several%20levels%20of%20the%20book.%20Whoever%20does%20that%20is%20paying%20for%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22immediacy%2C%20which%20reveals%20that%20their%20information%20or%20their%20urgency%20is%20worth%20more%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20cost%2C%20and%20on%20top%20of%20that%20it%20leaves%20the%20book%20emptied%20on%20that%20side%3A%20the%20next%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22levels%20have%20to%20be%20replenished%20higher%20up.%20The%20stops%20of%20the%20shorts%20trapped%20along%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22way%20supply%20additional%20forced%20buying%20over%20the%20following%20candles.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20over%205%20candles%20and%20expect%20it%20to%20be%20LARGER%20on%2015m%20than%20on%204h%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22because%20an%20emptied%20book%20is%20replenished%20in%20minutes%20or%20hours%2C%20not%20days.%20We%20expect%20it%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22fail%2C%20or%20to%20invert%2C%20when%20the%20thrust%20candle%20is%20the%20last%20of%20a%20long%20leg%20%28exhaustion%29%20and%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20minutes%20after%20a%20macro%20release%2C%20where%20the%20expanded%20range%20is%20instantaneous%20repricing%20%22%0A%20%20%20%20%20%20%20%20%20%20%22with%20no%20continuation.%20If%20the%20edge%20were%20the%20same%20on%204h%20and%20on%2015m%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22book-replenishment%20mechanism%20we%20assert%20would%20be%20false.%22%2C%0A%20%20%20%20fn%3D_volume_thrust%2C%0A%20%20%20%20params%3D%7B%22relative_volume%22%3A%202.0%2C%20%22volume_mean%22%3A%2020%2C%20%22atr%22%3A%2014%2C%20%22clv%22%3A%200.5%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22hold_bars%22%3A%205%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%208.%20Climax%3A%203-sigma%20volume%20at%20a%2020-candle%20extreme%2C%20traded%20against%20the%20grain%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_volume_climax%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20140%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20lv%20%3D%20np.log1p%28v%29%20%20%20%23%20log1p%20and%20not%20log%3A%20volume%20can%20be%20exactly%20zero%0A%20%20%20%20mean%20%3D%20talib.SMA%28lv%2C%20100%29%0A%20%20%20%20sigma%20%3D%20talib.STDDEV%28lv%2C%20100%29%0A%20%20%20%20z%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28lv%20-%20mean%2C%20sigma%2C%20out%3Dz%2C%20where%3D~np.isnan%28sigma%29%20%26%20%28sigma%20%3E%200.0%29%29%0A%20%20%20%20max_c%2C%20min_c%20%3D%20talib.MAX%28c%2C%2020%29%2C%20talib.MIN%28c%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28z%2C%20max_c%2C%20min_c%2C%20c%29%0A%20%20%20%20extreme%20%3D%20ok%20%26%20%28z%20%3E%203.0%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bextreme%20%26%20%28c%20%3E%3D%20max_c%29%5D%20%3D%20-1%0A%20%20%20%20ev%5Bextreme%20%26%20%28c%20%3C%3D%20min_c%29%5D%20%3D%201%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.volume_climax%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Fade%20a%20three-sigma%20volume%20spike%20at%20extremes%22%2C%0A%20%20%20%20rationale%3D%22Volume%20more%20than%20three%20sigma%20from%20its%20100-period%20moving%20average%2C%20happening%20right%20at%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%2020-candle%20extreme%2C%20is%20not%20participation%3A%20it%20is%20transfer.%20In%20crypto%20that%20spike%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22almost%20always%20a%20liquidation%20cascade%2C%20in%20which%20the%20exchange%27s%20engine%20sends%20market%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22orders%20that%20represent%20nobody%20who%20wants%20to%20trade%20at%20that%20price.%20When%20the%20liquidation%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22queue%20empties%2C%20all%20that%20involuntary%20supply%20disappears%20at%20once%2C%20and%20the%20price%20goes%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22back%20to%20the%20level%20where%20the%20real%20book%20was.%20The%20mean%20and%20the%20sigma%20are%20rolling%20over%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22100%20candles%2C%20never%20over%20the%20full%20history.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20over%205%20candles%2C%20concentrated%20in%20a%20very%20small%20number%20of%20events%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%28perhaps%2030-80%20across%20the%20whole%20history%20per%20timeframe%29%2C%20which%20caps%20the%20statistical%20power%20%22%0A%20%20%20%20%20%20%20%20%20%20%22from%20the%20outset%3A%20if%20it%20comes%20out%20positive%20but%20with%20n%20%3C%2030%20we%20will%20declare%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%22inconclusive.%20We%20expect%20it%20to%20fail%20when%20the%20volume%20spike%20is%20the%20START%20of%20a%20regime%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expansion%20and%20not%20its%20end%20%E2%80%94a%20range%20break%20with%20news%20behind%20it%E2%80%94%20where%20fading%20means%20%22%0A%20%20%20%20%20%20%20%20%20%20%22stepping%20in%20front%20of%20the%20entire%20move.%20We%20also%20expect%20it%20to%20get%20worse%20from%202021%20onwards%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22as%20the%20exchanges%20have%20gradually%20introduced%20partial-liquidation%20engines%20that%20smooth%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22cascades.%22%2C%0A%20%20%20%20fn%3D_volume_climax%2C%0A%20%20%20%20params%3D%7B%22volume_z%22%3A%203.0%2C%20%22z_window%22%3A%20100%2C%20%22extreme_window%22%3A%2020%2C%20%22hold_bars%22%3A%205%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%209.%20Chaikin%20oscillator%3A%20momentum%20of%20the%20approximated%20volume%20delta%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_chaikin%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20osc%20%3D%20talib.ADOSC%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fastperiod%3D3%2C%20slowperiod%3D10%29%0A%20%20%20%20ok%20%3D%20_finite%28osc%29%0A%20%20%20%20out%5Bok%20%26%20%28osc%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28osc%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.chaikin_osc_3_10%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Side%20with%20accelerating%20Chaikin%20accumulation%22%2C%0A%20%20%20%20rationale%3D%22The%20Accumulation%2FDistribution%20line%20is%20the%20cumulative%20volume%20delta%20that%20can%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22approximated%20without%20aggressor%20data%3A%20it%20splits%20each%20candle%27s%20volume%20between%20buying%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20selling%20according%20to%20where%20it%20closes%20inside%20the%20range%2C%20which%20is%20exactly%20what%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%60taker_buy_base%60%20would%20measure%20if%20%60Series%60%20exposed%20it.%20The%20Chaikin%20oscillator%20is%20its%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22momentum%20%28EMA%203%20minus%20EMA%2010%29%2C%20that%20is%2C%20whether%20the%20cumulative%20delta%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22accelerating.%20An%20accelerating%20delta%20means%20the%20imbalance%20between%20buy-side%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22sell-side%20aggression%20is%20growing%2C%20and%20that%20imbalance%20is%20what%20moves%20the%20price%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22short%20run.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%2C%20smaller%20than%20%60obv_ema21%60%27s%2C%20because%20splitting%20by%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22position%20of%20the%20close%20penalises%20exactly%20the%20candles%20with%20wicks%2C%20which%20in%20BTC%20are%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22informative%20ones.%20We%20expect%20it%20to%20fail%20systematically%20on%20candles%20with%20long%20wicks%20caused%20%22%0A%20%20%20%20%20%20%20%20%20%20%22by%20stop%20runs%2C%20where%20the%20close%20comes%20back%20to%20the%20middle%20of%20the%20range%20and%20the%20indicator%20%22%0A%20%20%20%20%20%20%20%20%20%20%22records%20%27indecision%27%20at%20the%20very%20moment%20of%20maximum%20directional%20flow.%20If%20it%20came%20out%20%22%0A%20%20%20%20%20%20%20%20%20%20%22better%20than%20OBV%2C%20the%20CLV%20aggression%20proxy%20would%20be%20more%20informative%20than%20we%20think%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20whole%20family%20would%20need%20revisiting.%22%2C%0A%20%20%20%20fn%3D_chaikin%2C%0A%20%20%20%20params%3D%7B%22fast%22%3A%203%2C%20%22slow%22%3A%2010%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2010.%20Trend%20ONLY%20when%20participation%20expands%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_trend_with_participation%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20140%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%2020%29%0A%20%20%20%20v20%2C%20v100%20%3D%20talib.SMA%28v%2C%2020%29%2C%20talib.SMA%28v%2C%20100%29%0A%20%20%20%20ok%20%3D%20_finite%28roc%2C%20v20%2C%20v100%29%0A%20%20%20%20expanding%20%3D%20ok%20%26%20%28v20%20%3E%20v100%29%0A%20%20%20%20out%5Bexpanding%20%26%20%28roc%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bexpanding%20%26%20%28roc%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.trend_with_participation%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Ride%20the%20trend%20only%20while%20volume%20expands%22%2C%0A%20%20%20%20rationale%3D%22It%20asserts%20that%20volume%20does%20not%20give%20direction%20but%20does%20give%20permission.%20A%20sustained%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22trend%20needs%20a%20continuous%20flow%20of%20new%20participants%20buying%20higher%20than%20the%20previous%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20did%3B%20if%20the%2020-period%20average%20volume%20falls%20below%20the%20100-period%20one%2C%20those%20still%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22trading%20are%20the%20ones%20already%20inside%2C%20rotating%20among%20themselves%2C%20and%20there%20is%20nobody%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22left%20to%20absorb%20the%20first%20wave%20of%20profit%20taking.%20The%20signal%20is%20the%20sign%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2220-candle%20return%20conditioned%20on%20participation%20expanding%2C%20and%20zero%20when%20it%20does%20not.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%2C%20but%20the%20real%20test%20is%20NOT%20that%20it%20be%20positive%3A%20it%20is%20that%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%22be%20LARGER%20than%20plain%2020-candle%20momentum%20with%20no%20filter.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22control%20was%20not%20registered%20in%20any%20family%20%E2%80%94the%20%60trend%60%20family%20does%20not%20register%20a%2020-bar%20%22%0A%20%20%20%20%20%20%20%20%20%20%22ROC%E2%80%94%20so%20this%20falsification%20criterion%20could%20not%20be%20executed%3B%20it%20has%20been%20registered%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60flow.roc20_unfiltered%60%20and%20that%20is%20what%20this%20must%20be%20measured%20against.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22If%20the%20volume%20filter%20adds%20nothing%20over%20that%20control%2C%20this%20hypothesis%20is%20refuted%20even%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20makes%20money%2C%20because%20what%20it%20would%20be%20earning%20is%20the%20momentum%20and%20not%20the%20flow.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%22further%20expect%20the%20filter%20to%20hurt%20at%20bear-market%20bottoms%2C%20where%20volume%20dries%20up%20for%20%22%0A%20%20%20%20%20%20%20%20%20%20%22months%20and%20the%20filter%20leaves%20out%20precisely%20the%20start%20of%20the%20next%20bull%20cycle.%22%2C%0A%20%20%20%20fn%3D_trend_with_participation%2C%0A%20%20%20%20params%3D%7B%22roc%22%3A%2020%2C%20%22volume_short%22%3A%2020%2C%20%22volume_long%22%3A%20100%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2011.%20A%20move%20on%20thin%20volume%3A%20fade%20it%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_move_without_volume%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20v5%2C%20v20%20%3D%20talib.SMA%28v%2C%205%29%2C%20talib.SMA%28v%2C%2020%29%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%205%29%0A%20%20%20%20ok%20%3D%20_finite%28v5%2C%20v20%2C%20roc%29%20%26%20%28v20%20%3E%200.0%29%0A%20%20%20%20dry%20%3D%20ok%20%26%20%28v5%20%3C%20v20%29%0A%20%20%20%20out%5Bdry%20%26%20%28roc%20%3E%200.0%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bdry%20%26%20%28roc%20%3C%200.0%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.move_without_volume%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Fade%20a%20move%20made%20on%20thinning%20volume%22%2C%0A%20%20%20%20rationale%3D%22The%20exact%20reverse%20of%20%60trend_with_participation%60%2C%20and%20that%20is%20why%20it%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22registered%3A%20a%20five-candle%20move%20made%20on%20volume%20below%20its%20own%2020-period%20average%20has%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22transferred%20no%20inventory%2C%20it%20has%20only%20walked%20the%20price%20through%20an%20empty%20book.%20Nobody%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22has%20had%20to%20accept%20a%20large%20position%20on%20the%20wrong%20side%2C%20so%20there%20is%20no%20participant%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22obliged%20to%20defend%20the%20new%20level%2C%20and%20the%20first%20order%20of%20size%20that%20turns%20up%20will%20put%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22it%20back%20where%20it%20was.%20The%20threshold%20is%20%27below%20the%20average%27%2C%20with%20no%20free%20constant%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22tune.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20on%2015m%2F1h%2C%20above%20all%20at%20weekends%20and%20during%20the%20Asian%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hours%2C%20when%20BTC%27s%20book%20is%20thinnest.%20We%20expect%20it%20to%20fail%20during%20the%20slow%20starts%20of%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trend%2C%20in%20which%20the%20price%20rises%20for%20weeks%20on%20decreasing%20volume%20and%20fading%20loses%20%22%0A%20%20%20%20%20%20%20%20%20%20%22continuously%3B%20that%20is%20the%20failure%20mode%20that%20worries%20us%20most%20because%20it%20is%20persistent%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22not%20noisy.%20If%20this%20hypothesis%20and%20%60trend_with_participation%60%20both%20came%20out%20positive%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20the%20same%20regime%2C%20we%20would%20conclude%20that%20the%20volume%20filter%20separates%20nothing%20and%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22they%20win%20on%20the%20sign%20of%20the%20momentum%2C%20not%20on%20the%20flow.%22%2C%0A%20%20%20%20fn%3D_move_without_volume%2C%0A%20%20%20%20params%3D%7B%22volume_short%22%3A%205%2C%20%22volume_long%22%3A%2020%2C%20%22roc%22%3A%205%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2012.%20Absorption%3A%20high%20effort%20WITHOUT%20result%20%28double%20volume%20and%20a%20narrow%20range%29%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_absorption%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20h%2C%20l%2C%20c%2C%20v%20%3D%20_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20v_mean%20%3D%20talib.SMA%28v%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20clv%20%3D%20_clv%28s%29%0A%20%20%20%20rel%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28v%2C%20v_mean%2C%20out%3Drel%2C%20where%3D~np.isnan%28v_mean%29%20%26%20%28v_mean%20%3E%200.0%29%29%0A%20%20%20%20ok%20%3D%20_finite%28rel%2C%20atr%2C%20tr%29%20%26%20%28atr%20%3E%200.0%29%0A%20%20%20%20absorbing%20%3D%20ok%20%26%20%28rel%20%3E%202.0%29%20%26%20%28tr%20%3C%20atr%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Babsorbing%20%26%20%28clv%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20ev%5Babsorbing%20%26%20%28clv%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.absorption_narrow_range%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Double%20volume%20that%20fails%20to%20move%20price%22%2C%0A%20%20%20%20rationale%3D%22It%20is%20the%20complementary%2C%20disjoint%20cell%20to%20%60volume_thrust%60%20in%20Wyckoff%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22effort%2Fresult%20table%3A%20the%20same%20double%20volume%2C%20but%20a%20range%20SMALLER%20than%20the%20ATR.%20Twice%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20usual%20number%20of%20contracts%20changing%20hands%20while%20the%20price%20does%20not%20move%20has%20only%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20mechanical%20explanation%3A%20there%20is%20a%20large%20passive%20order%20on%20one%20side%20of%20the%20book%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22replenishing%20itself%20as%20fast%20as%20it%20is%20eaten.%20Whoever%20has%20the%20size%20to%20do%20that%20knows%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22their%20target%20price%20and%20is%20not%20finished%3B%20when%20the%20aggressor%20tires%2C%20the%20price%20moves%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22towards%20the%20absorber%27s%20side%2C%20which%20is%20the%20side%20the%20candle%20closed%20on.%20The%20direction%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20given%20by%20the%20sign%20of%20the%20close%20within%20the%20range%2C%20with%20no%20free%20threshold.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20over%205%20candles%2C%20and%20a%20lower%20frequency%20than%20the%20thrust.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22We%20expect%20it%20to%20fail%20in%20areas%20of%20accepted%20value%20%E2%80%94the%20middle%20of%20a%20long%20range%E2%80%94%20where%20high%20%22%0A%20%20%20%20%20%20%20%20%20%20%22volume%20and%20a%20narrow%20range%20is%20simply%20the%20market%27s%20normal%20equilibrium%20and%20there%20is%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%22absorber%20at%20all.%20Being%20disjoint%20from%20%60volume_thrust%60%20by%20construction%2C%20the%20comparison%20%22%0A%20%20%20%20%20%20%20%20%20%20%22between%20the%20two%20is%20clean%3A%20if%20both%20come%20out%20positive%2C%20high%20relative%20volume%20is%20worth%20%22%0A%20%20%20%20%20%20%20%20%20%20%22something%20on%20its%20own%20and%20the%20range%20adds%20nothing%3B%20if%20only%20one%20does%2C%20the%20effort%2Fresult%20%22%0A%20%20%20%20%20%20%20%20%20%20%22axis%20is%20real.%22%2C%0A%20%20%20%20fn%3D_absorption%2C%0A%20%20%20%20params%3D%7B%22relative_volume%22%3A%202.0%2C%20%22volume_mean%22%3A%2020%2C%20%22atr%22%3A%2014%2C%20%22hold_bars%22%3A%205%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2013.%20Negative%20Volume%20Index%20%28Fosback%29%3A%20what%20price%20does%20on%20the%20thin-volume%20days%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_nvi_fosback%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20400%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20ret%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20prev%20%3D%20c%5B%3A-1%5D%0A%20%20%20%20np.divide%28c%5B1%3A%5D%20-%20prev%2C%20prev%2C%20out%3Dret%5B1%3A%5D%2C%20where%3Dprev%20%3E%200.0%29%0A%20%20%20%20lower_volume%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20lower_volume%5B1%3A%5D%20%3D%20v%5B1%3A%5D%20%3C%20v%5B%3A-1%5D%0A%20%20%20%20factor%20%3D%20np.where%28lower_volume%2C%201.0%20%2B%20ret%2C%201.0%29%0A%20%20%20%20factor%20%3D%20np.clip%28factor%2C%200.01%2C%20None%29%20%20%20%23%20no%20candle%20may%20drive%20the%20index%20to%20zero%20or%20below%0A%20%20%20%20nvi%20%3D%201000.0%20%2A%20np.cumprod%28factor%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28nvi%2C%20255%29%0A%20%20%20%20ok%20%3D%20_finite%28nvi%2C%20ema%29%0A%20%20%20%20out%5Bok%20%26%20%28nvi%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.nvi_fosback%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Long%20only%20while%20the%20low-volume%20days%20rise%22%2C%0A%20%20%20%20rationale%3D%22The%20NVI%20accumulates%20the%20return%20ONLY%20of%20the%20candles%20whose%20volume%20falls%20relative%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20previous%20one%2C%20isolating%20what%20price%20does%20when%20the%20public%20is%20not%20trading.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Fosback%27s%20premise%20is%20that%20the%20retail%20crowd%20turns%20up%20with%20the%20volume%20and%20informed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22money%20does%20not%20need%20it%3A%20if%20the%20price%20rises%20on%20the%20quiet%20days%2C%20somebody%20is%20building%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%20without%20wanting%20to%20draw%20attention.%20The%20signal%20is%20asymmetric%20on%20purpose%2C%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20the%20original%3A%20%2B1%20when%20the%20NVI%20is%20above%20its%20255-period%20EMA%20%28a%20year%20of%20sessions%29%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%200%20%E2%80%94not%20short%E2%80%94%20below%20it%2C%20because%20Fosback%20never%20claimed%20that%20the%20opposite%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22indicated%20a%20bear%20market%2C%20only%20an%20absence%20of%20information.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20modest%20positive%20edge%20on%201d%20and%20a%20high%20exposure%20rate%20%28it%20should%20be%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22market%20for%20most%20of%20the%20bull%20run%29.%20The%20expected%20failure%20mode%20is%20twofold%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22retail%2Finformed%20distinction%20was%20built%20on%20exchanges%20with%20opening%20hours%20and%20press%20%22%0A%20%20%20%20%20%20%20%20%20%20%22conferences%2C%20and%20BTC%20trades%2024%2F7%20with%20volume%20dominated%20by%20market%20makers%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22inter-exchange%20arbitrage%2C%20so%20the%20partition%20by%20volume%20may%20separate%20nobody.%20Besides%2C%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%22only%201d%20and%20~600%20warm-up%20candles%20we%20are%20left%20with%20on%20the%20order%20of%202%2C500%20observations%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22very%20few%20complete%20cycles%3A%20if%20the%20edge%20comes%20out%20positive%20but%20depends%20on%20having%20been%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20market%20in%202020-2021%2C%20that%20is%20an%20observation%2C%20not%20evidence.%22%2C%0A%20%20%20%20fn%3D_nvi_fosback%2C%0A%20%20%20%20params%3D%7B%22ema%22%3A%20255%7D%2C%0A%20%20%20%20timeframes%3D%28%221d%22%2C%29%2C%0A%20%20%20%20min_warmup%3D600%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2014.%20CONTROL%20ADDED%20DURING%20THE%20AUDIT%20%282026-09-08%29.%0A%23%0A%23%20What%20was%20wrong.%20Two%20hypotheses%20declared%20their%20falsification%20criterion%20against%20a%20control%20that%20did%0A%23%20not%20exist%3A%20%60flow.trend_with_participation%60%20says%20that%20%22the%20real%20test%20is%20NOT%20that%20it%20be%20positive%3A%0A%23%20it%20is%20that%20it%20be%20LARGER%20than%20plain%2020-candle%20momentum%20with%20no%20filter%2C%20which%20the%20%60trend%60%20family%0A%23%20registers%22%2C%20and%20%60momentum.momentum_with_volume%60%20says%20that%20it%20%22is%20falsified%20if%20the%20volume%20filter%0A%23%20does%20not%20improve%20on%20the%20unfiltered%2020-bar%20ROC%22.%20Neither%20%60trend%60%20nor%20%60momentum%60%20registered%20an%0A%23%20unfiltered%2020-bar%20ROC%3A%20%60momentum%60%20registers%20%60roc10%60%2C%20which%20is%20a%20different%20horizon%20and%20therefore%20a%0A%23%20different%20trial.%0A%23%0A%23%20Why%20it%20mattered.%20The%20two%20hypotheses%20assert%20the%20same%20thing%20%E2%80%94that%20volume%20gives%20PERMISSION%20even%0A%23%20though%20it%20gives%20no%20direction%E2%80%94%20and%20both%20condition%20the%20same%20statistic%20%28the%20sign%20of%20the%2020-candle%0A%23%20return%29%20on%20an%20expansion%20of%20participation.%20That%20is%20a%20claim%20about%20an%20increment%2C%20and%20without%20the%0A%23%20unfiltered%20arm%20all%20that%20could%20be%20judged%20was%20absolute%20profitability%2C%20which%20in%20an%20asset%20with%20a%0A%23%20positive%20secular%20drift%20confirms%20almost%20any%20mostly-long%20rule.%20With%20the%20control%20registered%2C%20the%20two%0A%23%20become%20testable%20and%20all%20three%20count%20towards%20the%20multiple-comparisons%20correction.%0A%23%0A%23%20It%20is%20also%20declared%20here%2C%20for%20whoever%20runs%20the%20correction%3A%20%60flow.trend_with_participation%60%0A%23%20%28ROC-20%20with%20volume%20SMA-20%20%3E%20SMA-100%29%20and%20%60momentum.momentum_with_volume%60%20%28ROC-20%20with%20volume%0A%23%20SMA-5%20%3E%20SMA-20%29%20are%20the%20SAME%20construction%20with%20a%20different%20pair%20of%20volume%20averages.%20Measured%20on%0A%23%20data%20they%20share%20little%20%28Jaccard%20index%20%E2%89%88%200.15%20over%20the%20events%29%2C%20so%20they%20are%20not%20duplicates%20and%0A%23%20neither%20is%20removed%2C%20but%20they%20are%20not%20independent%20trials%20either%3A%20they%20are%20two%20readings%20of%20the%20same%0A%23%20mechanism%20and%20must%20be%20counted%20as%20dependent%20trials%2C%20not%20as%20two%20cross-family%20confirmations%20if%20both%0A%23%20come%20out%20positive.%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_roc20_unfiltered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20roc%20%3D%20talib.ROC%28_f%28s.close%29%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28roc%29%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22flow.roc20_unfiltered%22%2C%0A%20%20%20%20family%3D%22flow%22%2C%0A%20%20%20%20title%3D%22Plain%2020-bar%20momentum%2C%20no%20volume%20filter%22%2C%0A%20%20%20%20rationale%3D%22Unconditional%20control%20for%20%60trend_with_participation%60%20and%20for%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%60momentum.momentum_with_volume%60%3A%20the%20sign%20of%20the%2020-candle%20return%2C%20with%20no%20condition%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22on%20volume%20whatsoever.%20It%20asserts%20no%20flow%20mechanism%20%E2%80%94it%20cannot%2C%20because%20it%20does%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22look%20at%20volume%E2%80%94%20and%20that%20is%20exactly%20its%20role.%20The%20two%20hypotheses%20it%20controls%20do%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bet%20that%2020-candle%20momentum%20wins%2C%20but%20that%20it%20wins%20MORE%20when%20participation%20expands%3B%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20is%20a%20claim%20about%20a%20difference%2C%20and%20a%20difference%20needs%20both%20arms.%20It%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22registered%20in%20%60flow%60%20because%20its%20only%20reason%20to%20exist%20is%20to%20serve%20as%20the%20denominator%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22for%20this%20family%27s%20volume%20filter.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%2C%20and%20we%20expect%20it%20to%20be%20SMALLER%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60trend_with_participation%60%27s%20on%204h%20and%201d.%20All%20the%20information%20is%20in%20the%20comparison%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22if%20this%20control%20matches%20or%20beats%20the%20filtered%20versions%2C%20volume%20gives%20no%20permission%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22two%20filtered%20hypotheses%20are%20refuted%20even%20if%20they%20make%20money%2C%20and%20this%20family%27s%20thesis%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%E2%80%94that%20volume%20measures%20conviction%E2%80%94%20loses%20its%20main%20support.%20On%20its%20own%2C%20a%20positive%20result%20%22%0A%20%20%20%20%20%20%20%20%20%20%22from%20this%20control%20is%20NOT%20a%20finding%3A%20it%20is%20BTC%27s%20secular%20drift%20read%20through%20the%20sign%20of%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22past%20return%2C%20and%20it%20must%20be%20published%20as%20such.%22%2C%0A%20%20%20%20fn%3D_roc20_unfiltered%2C%0A%20%20%20%20params%3D%7B%22roc%22%3A%2020%2C%20%22volume_filter%22%3A%20%22none%22%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=78fc36ce7310fc0c4acfc42a7a8f9d0c38e8d29da2f3b002161fc31e15103d52\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":12,"row_hash":"033ebc2d063bbe441b209589b90e05559d97935ae31b84415745a6bf6dd58b98","body":"wavelab-journal-chain\nv=3\nseq=12\nprev=6f3844db36d074523b45f885402a2bfda0f607781a4a0721f80168ba2d4a52d5\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nprereg_seq=2\nsource_text=%22%22%22Family%20%60mean_reversion%60%3A%20price%20returns%20to%20an%20anchor%20after%20moving%20too%20far%20from%20it.%0A%0APRE-REGISTERED.%20Everything%20in%20this%20file%20was%20written%20BEFORE%20running%20a%20single%20backtest%20and%20before%0Alooking%20at%20a%20single%20number.%20The%20parameters%20are%20the%20conventional%20ones%20from%20the%20literature%20and%20they%0Aare%20FIXED%3A%20there%20are%20no%20variants%20of%20the%20same%20parameter%20%22just%20to%20see%22.%20The%2012%20hypotheses%20are%0Aregistered%20together%20and%20all%2012%20must%20be%20counted%20in%20the%20multiple-comparisons%20correction%2C%20the%20ones%0Athat%20fail%20included.%0A%0AThe%20market%20mechanism%20the%20family%20shares%20%E2%80%94what%20would%20have%20to%20be%20true%20for%20this%20to%20work%E2%80%94%20has%20three%0Aparts%3A%0A%0A%20%201.%20Liquidity%20provision.%20When%20a%20large%2C%20impatient%20order%20sweeps%20the%20book%2C%20the%20price%20moves%20further%0A%20%20%20%20%20than%20the%20information%20that%20order%20carries%20justifies.%20Whoever%20is%20on%20the%20other%20side%20charges%20for%0A%20%20%20%20%20absorbing%20it.%20That%20charge%20is%20the%20reversion%20premium%2C%20and%20it%20is%20the%20only%20%22real%22%20income%20this%0A%20%20%20%20%20family%20can%20capture.%0A%20%202.%20Overreaction.%20Traders%20extrapolate%20the%20last%20leg%20and%20overweight%20what%20is%20recent%3B%20the%20price%20moves%0A%20%20%20%20%20away%20from%20consensus%20further%20than%20the%20flow%20of%20information%20justifies%20and%20then%20corrects.%0A%20%203.%20Forced%20closing.%20In%20a%20market%20with%20high%20leverage%20%28BTC%20perpetuals%29%2C%20cascading%20liquidations%20are%0A%20%20%20%20%20sales%20that%20do%20NOT%20express%20an%20opinion%20about%20value.%20They%20are%20mechanical%20and%20they%20run%20out%20when%0A%20%20%20%20%20the%20collateral%20does.%20The%20hole%20they%20leave%20gets%20filled.%0A%0AAnd%20the%20failure%20mode%20it%20shares%2C%20also%20declared%20in%20advance%3A%20in%20a%20sustained%20trend%2C%20this%20whole%20family%0Asells%20strength%20and%20buys%20weakness%20at%20exactly%20the%20moment%20when%20that%20is%20the%20opposite%20of%20what%20to%20do.%20A%0Areversion%20statistic%20%22pinned%22%20at%20the%20extreme%20throughout%20a%20directional%20leg%20is%20not%20a%20signal%2C%20it%20is%20a%0Aslow%20loss.%20Several%20of%20the%20hypotheses%20below%20exist%20precisely%20in%20order%20to%20measure%20that%20failure%20instead%0Aof%20hiding%20it%20%28%60bb20_2_range_adx14%60%20and%20%60rsi14_cardwell_sma200%60%20against%20their%20versions%20with%20no%0Aregime%20filter%29.%0A%0AA%20note%20on%20%60min_warmup%60.%20It%20is%20a%20decision%20of%20numerical%20hygiene%2C%20not%20a%20parameter%20of%20the%20signal%3A%20it%20is%0Achosen%20to%20discard%20the%20indicators%27%20start-up%20%28and%20the%20unstable%20stretch%20of%20the%20long%20EMAs%2C%20~2x%20the%0Aperiod%29%2C%20not%20to%20improve%20any%20result.%20It%20is%20not%20touched%20after%20seeing%20data.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20Utilities.%20None%20of%20them%20looks%20ahead.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_f%28x%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22talib%20demands%20contiguous%20float64%3B%20otherwise%20it%20raises%20%27input%20array%20type%20is%20not%20double%27.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28x%2C%20dtype%3Dnp.float64%29%0A%0A%0Adef%20_prev%28a%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Value%20of%20the%20PREVIOUS%20bar%2C%20aligned%20to%20i%20%28that%20is%2C%20a%5Bi-1%5D%20placed%20at%20position%20i%29.%0A%0A%20%20%20%20The%20shift%20runs%20from%20the%20past%20towards%20the%20present%2C%20never%20the%20other%20way%20round.%20%60np.roll%28a%2C%201%29%60%20is%0A%20%20%20%20banned%20here%3A%20it%20puts%20a%5B-1%5D%20%E2%80%94the%20last%20data%20point%20of%20the%20whole%20series%E2%80%94%20at%20position%200%2C%20which%20is%0A%20%20%20%20exactly%20the%20information%20leak%20this%20project%20is%20hunting.%0A%0A%20%20%20%20The%20empty%20case%20is%20written%20out%20rather%20than%20left%20to%20NumPy%3A%20%60out%5B0%5D%20%3D%20np.nan%60%20on%20a%20zero-length%0A%20%20%20%20array%20is%20an%20IndexError%2C%20and%20it%20took%20down%20%60sweep_rejection_20%60%20and%20%60streak3_fade%60%20%E2%80%94%20the%20only%20two%0A%20%20%20%20hypotheses%20in%20the%20file%20that%20reach%20%60_prev%60%20without%20a%20length%20guard%20in%20front%20of%20it%20%E2%80%94%20on%20a%20series%0A%20%20%20%20with%20no%20candles.%20%60evaluate_all%60%20swallows%20that%20in%20a%20bare%20%60except%60%20and%20moves%20on%2C%20so%20it%20showed%20up%0A%20%20%20%20as%20two%20hypotheses%20quietly%20missing%20from%20the%20report%20rather%20than%20as%20an%20error.%0A%20%20%20%20%22%22%22%0A%20%20%20%20if%20a.size%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20a.astype%28np.float64%2C%20copy%3DTrue%29%0A%20%20%20%20out%20%3D%20np.empty_like%28a%29%0A%20%20%20%20out%5B0%5D%20%3D%20np.nan%0A%20%20%20%20out%5B1%3A%5D%20%3D%20a%5B%3A-1%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_finite%28%2Aarrays%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Mask%20of%20the%20positions%20where%20ALL%20the%20indicators%20are%20defined.%0A%0A%20%20%20%20talib%20returns%20NaN%20during%20warm-up.%20A%20comparison%20against%20NaN%20yields%20False%2C%20so%20it%20does%20not%20invent%20a%0A%20%20%20%20long%3B%20but%20it%20can%20invent%20a%20short%20if%20the%20condition%20is%20written%20negated.%20That%20is%20why%20the%20check%20is%0A%20%20%20%20explicit%2C%20with%20np.isnan%2C%20and%20is%20ANDed%20into%20every%20condition%2C%20instead%20of%20relying%20on%20the%20implicit%0A%20%20%20%20behaviour%20or%20on%20nan_to_num%20%28which%20WOULD%20invent%20signals%2C%20by%20replacing%20the%20NaN%20with%20a%20number%20that%0A%20%20%20%20compares%20true%29.%0A%20%20%20%20%22%22%22%0A%20%20%20%20ok%20%3D%20np.ones%28arrays%5B0%5D.shape%2C%20dtype%3Dbool%29%0A%20%20%20%20for%20a%20in%20arrays%3A%0A%20%20%20%20%20%20%20%20ok%20%26%3D%20~np.isnan%28a%29%0A%20%20%20%20return%20ok%0A%0A%0Adef%20_sig%28n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%201.%20Bollinger%20bands%3A%20the%20naked%20fade.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_bb_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20upper%2C%20_mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%20%20%20%20ok%20%3D%20_finite%28upper%2C%20lower%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.bb20_2_fade%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20every%20close%20outside%20the%20Bollinger%20band%22%2C%0A%20%20%20%20rationale%3D%22Closing%20outside%20the%202-sigma%20band%20over%2020%20candles%20means%20the%20price%20has%20moved%20further%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22than%20the%20asset%27s%20own%20recent%20dispersion%20considers%20normal.%20The%20behaviour%20that%20would%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22produce%20the%20effect%20is%20that%20of%20the%20market%20maker%20and%20the%20range%20trader%3A%20they%20see%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22temporary%20imbalance%20of%20flow%20%E2%80%94an%20impatient%20order%20sweeping%20the%20book%E2%80%94%20and%20charge%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22premium%20for%20absorbing%20it%2C%20handing%20the%20price%20back%20towards%20the%20SMA20%20once%20that%20order%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22runs%20out.%20It%20is%20the%20barest%20possible%20formulation%20of%20the%20family%20and%20it%20serves%20as%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22baseline%20against%20which%20the%20other%20eleven%20are%20measured.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20but%20small%20edge%20in%20a%20ranging%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20trending%20%22%0A%20%20%20%20%20%20%20%20%20%20%22regime%2C%20because%20in%20a%20trend%20the%20price%20%27walks%20the%20band%27%20for%20dozens%20of%20candles%20and%20this%20%22%0A%20%20%20%20%20%20%20%20%20%20%22rule%20holds%20the%20wrong%20side%20that%20entire%20time.%20Net%20over%20the%20whole%20sample%20we%20expect%20%22%0A%20%20%20%20%20%20%20%20%20%20%22something%20close%20to%20zero%2C%20or%20negative%20after%20costs.%20It%20is%20refuted%20if%20the%20edge%20is%20positive%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20stable%20in%20both%20regimes%3A%20that%20would%20mean%20we%20are%20not%20measuring%20liquidity%20provision%20but%20%22%0A%20%20%20%20%20%20%20%20%20%20%22something%20else.%22%2C%0A%20%20%20%20fn%3D_bb_fade%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2020%2C%20%22deviations%22%3A%202.0%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%202.%20Bollinger%20with%20re-entry.%20SAME%20parameters%2C%20DIFFERENT%20decision%20rule%20%28this%20is%20not%20a%20parameter%0A%23%20%20%20%20variant%3A%20%231%20enters%20during%20the%20excursion%2C%20this%20one%20waits%20for%20the%20excursion%20to%20end%29.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_bb_reentry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20n%20%3D%20c.size%0A%20%20%20%20out%20%3D%20_sig%28n%29%0A%20%20%20%20upper%2C%20mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%281%2C%20n%29%3A%0A%20%20%20%20%20%20%20%20%23%20Only%20indices%20i%20and%20i-1%20are%20read.%20Never%20i%2B1.%0A%20%20%20%20%20%20%20%20if%20np.isnan%28upper%5Bi%5D%29%20or%20np.isnan%28lower%5Bi%5D%29%20or%20np.isnan%28mid%5Bi%5D%29%20%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20or%20np.isnan%28upper%5Bi%20-%201%5D%29%20or%20np.isnan%28lower%5Bi%20-%201%5D%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20%23%20Exit%20first%3A%20the%20target%20is%20the%20moving%20average%2C%20which%20is%20the%20hypothesis%27s%20anchor.%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%201%20and%20c%5Bi%5D%20%3E%3D%20mid%5Bi%5D%20or%20pos%20%3D%3D%20-1%20and%20c%5Bi%5D%20%3C%3D%20mid%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20%23%20Entry%20only%20if%20we%20are%20flat%20and%20the%20previous%20candle%20closed%20OUTSIDE%20and%20this%20one%20closes%20IN.%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%20-%201%5D%20%3C%20lower%5Bi%20-%201%5D%20and%20c%5Bi%5D%20%3E%3D%20lower%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20c%5Bi%20-%201%5D%20%3E%20upper%5Bi%20-%201%5D%20and%20c%5Bi%5D%20%3C%3D%20upper%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.bb20_2_reentry%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Wait%20for%20the%20return%20inside%20the%20band%22%2C%0A%20%20%20%20rationale%3D%22The%20same%20band%20as%20hypothesis%201%20and%20the%20same%2020%2F2%2C%20but%20the%20decision%20rule%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22opposite%20one%20in%20time%3A%20you%20do%20not%20buy%20the%20fall%2C%20you%20buy%20the%20end%20of%20the%20fall.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Requiring%20the%20previous%20candle%20to%20have%20closed%20outside%20and%20this%20one%20inside%20is%20asking%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22for%20proof%20that%20the%20impatient%20flow%20has%20already%20run%20out%2C%20instead%20of%20assuming%20it.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22concrete%20participant%20is%20the%20forced%20seller%3A%20while%20they%20are%20liquidating%2C%20the%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22stays%20outside%20the%20band%3B%20when%20they%20finish%2C%20the%20first%20candle%20that%20closes%20back%20inside%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22marks%20that%20the%20imbalance%20has%20been%20consumed.%20It%20is%20registered%20alongside%20%231%20because%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20comparison%20between%20the%20two%20is%20what%20isolates%20the%20cost%20of%20anticipating%20against%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cost%20of%20waiting.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20FEWER%20trades%20and%20a%20BETTER%20edge%20per%20trade%20than%20hypothesis%201%2C%20and%20above%20all%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22much%20shorter%20left%20tail%2C%20because%20we%20do%20not%20enter%20against%20a%20liquidation%20in%20progress.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20it%20to%20lose%20in%20markets%20with%20very%20fast%20V-shaped%20reversals%2C%20where%20the%20re-entry%20%22%0A%20%20%20%20%20%20%20%20%20%20%22candle%20arrives%20once%20the%20move%20back%20has%20already%20happened.%20It%20is%20refuted%20if%20its%20edge%20per%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trade%20does%20not%20beat%20hypothesis%201%27s%3A%20in%20that%20case%20the%20%27proof%20of%20exhaustion%27%20carries%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%22information%20and%20merely%20arrives%20late.%22%2C%0A%20%20%20%20fn%3D_bb_reentry%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2020%2C%20%22deviations%22%3A%202.0%2C%20%22exit%22%3A%20%22SMA20%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%203.%20Bollinger%20filtered%20by%20regime.%20It%20exists%20to%20MEASURE%20the%20family%27s%20declared%20failure%20mode.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_bb_range_adx%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20upper%2C%20_mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%20%20%20%20adx%20%3D%20talib.ADX%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28upper%2C%20lower%2C%20adx%29%0A%20%20%20%20quiet%20%3D%20ok%20%26%20%28adx%20%3C%2020.0%29%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.bb20_2_range_adx14%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20Bollinger%20band%2C%20ADX%20under%2020%22%2C%0A%20%20%20%20rationale%3D%22Hypothesis%201%20with%20a%20single%20gate%3A%20trade%20only%20when%20the%20ADX14%20is%20below%2020%2C%20Wilder%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22threshold%20for%20%27no%20trend%27.%20The%20claim%20being%20tested%20is%20structural%2C%20not%20cosmetic%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reversion%20premium%20exists%20because%20somebody%20absorbs%20impatient%20flow%2C%20and%20absorbing%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22only%20profitable%20when%20that%20flow%20is%20NOT%20informed.%20When%20there%20is%20a%20trend%2C%20the%20order%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22sweeping%20the%20book%20usually%20carries%20information%20%E2%80%94somebody%20is%20genuinely%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22repositioning%E2%80%94%20and%20whoever%20absorbs%20it%20is%20adversely%20selected.%20A%20low%20ADX%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22classic%20approximation%20to%20%27nobody%20here%20is%20repositioning%27.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20CLEARLY%20larger%20edge%20than%20hypothesis%201%20over%20the%20same%20candles%2C%20and%20we%20expect%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20difference%20to%20come%20from%20removing%20losses%2C%20not%20from%20adding%20gains.%20We%20also%20expect%20fewer%20%22%0A%20%20%20%20%20%20%20%20%20%20%22than%20half%20the%20trades.%20The%20hypothesis%20is%20refuted%20if%20the%20edge%20does%20not%20improve%20on%20%231%27s%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20would%20mean%20the%20ADX%20finds%20out%20about%20the%20regime%20too%20late%20to%20work%20as%20a%20filter%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22then%20the%20family%27s%20explanation%20by%20adverse%20selection%20is%20left%20without%20empirical%20support.%22%2C%0A%20%20%20%20fn%3D_bb_range_adx%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2020%2C%20%22deviations%22%3A%202.0%2C%20%22adx_period%22%3A%2014%2C%20%22adx_max%22%3A%2020.0%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%204.%20Keltner%3A%20the%20same%20idea%20with%20the%20width%20measured%20in%20true%20range%20and%20not%20in%20dispersion%20of%20closes.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_keltner_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%20timeperiod%3D20%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28ema%2C%20atr%29%0A%20%20%20%20upper%20%3D%20ema%20%2B%202.0%20%2A%20atr%0A%20%20%20%20lower%20%3D%20ema%20-%202.0%20%2A%20atr%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.keltner20_atr14_fade%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20Keltner%20channel%2C%20width%20in%20ATR%22%2C%0A%20%20%20%20rationale%3D%22The%20Keltner%20channel%20in%20its%20modern%20form%3A%20EMA20%20as%20the%20anchor%20and%202xATR14%20as%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22width.%20Against%20Bollinger%2C%20what%20changes%20is%20WHAT%20counts%20as%20a%20normal%20move.%20Bollinger%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22measures%20the%20dispersion%20of%20the%20closes%3B%20the%20ATR%20measures%20the%20true%20range%2C%20wicks%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22gaps%20included.%20The%20difference%20matters%20for%20a%20concrete%20microstructure%20reason%3A%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22liquidation%20cascade%20leaves%20an%20enormous%20wick%20and%20a%20recovered%20close%2C%20which%20WIDENS%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22ATR%20immediately%20but%20barely%20moves%20the%20sigma%20of%20the%20closes.%20The%20Keltner%20channel%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22therefore%20stops%20giving%20signals%20right%20after%20a%20liquidation%20event%2C%20while%20Bollinger%20goes%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22on%20giving%20them.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20FEWER%20signals%20than%20Bollinger%20in%20the%20weeks%20following%20a%20crash%2C%20and%20for%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22reason%20a%20worse%20hit%20rate%20but%20a%20shorter%20left%20tail%3A%20it%20gives%20up%20the%20most%20profitable%20bounces%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20exchange%20for%20not%20entering%20at%20the%20worst%20moment.%20We%20expect%20it%20to%20be%20inferior%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22Bollinger%20in%20a%20quiet%20market%2C%20where%20the%20ATR%20narrows%20and%20the%20channel%20turns%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hypersensitive.%20It%20is%20refuted%20if%20its%20signals%20are%20indistinguishable%20from%20hypothesis%201%27s%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20would%20indicate%20that%20in%20BTC%20the%20wick%20and%20the%20close%20carry%20the%20same%20information.%22%2C%0A%20%20%20%20fn%3D_keltner_fade%2C%0A%20%20%20%20params%3D%7B%22ema_period%22%3A%2020%2C%20%22atr_period%22%3A%2014%2C%20%22multiplier%22%3A%202.0%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%205.%20RSI%2014%20with%20fixed%2030%2F70%20thresholds.%20The%20baseline%20Cardwell%20says%20is%20broken.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_rsi_fixed%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28rsi%29%0A%20%20%20%20out%5Bok%20%26%20%28rsi%20%3C%2030.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28rsi%20%3E%2070.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.rsi14_fixed_3070%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Buy%20RSI%20below%2030%2C%20sell%20above%2070%22%2C%0A%20%20%20%20rationale%3D%22RSI%2014%20with%20Wilder%27s%20original%20thresholds%2C%2030%20and%2070.%20It%20is%20registered%20even%20though%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hardly%20anybody%20expects%20it%20to%20work%2C%20and%20for%20a%20methodological%20reason%3A%20it%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22control%20for%20hypothesis%206.%20Cardwell%27s%20claim%20%E2%80%94that%20the%20RSI%20%27pins%27%20at%20the%20extreme%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22during%20trends%20and%20that%20this%20is%20why%20fixed%20thresholds%20fail%E2%80%94%20is%20only%20testable%20if%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22fixed%20control%20is%20registered%20in%20advance.%20If%20we%20only%20registered%20the%20adaptive%20version%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20it%20came%20out%20well%2C%20we%20would%20not%20know%20whether%20the%20credit%20belongs%20to%20Cardwell%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bands%20or%20simply%20to%20the%20RSI.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20NULL%20or%20NEGATIVE%20net%20edge%2C%20and%20in%20particular%20we%20expect%20the%20short%20side%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%28RSI%3E70%29%20to%20be%20the%20one%20that%20loses%20most%2C%20because%20BTC%20spends%20most%20of%20its%20history%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22bullish%20legs%20where%20the%20RSI%20goes%20above%2070%20and%20stays%20there.%20We%20expect%20most%20of%20the%20loss%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22be%20concentrated%20in%20a%20few%20long%2C%20directional%20legs.%20It%20is%20refuted%20if%20the%20fixed%2030%2F70%20%22%0A%20%20%20%20%20%20%20%20%20%20%22matches%20or%20beats%20hypothesis%206%27s%20Cardwell%20bands%3A%20that%20would%20invalidate%20this%20family%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%22central%20premise%20about%20the%20RSI%27s%20bias%20in%20a%20trend.%22%2C%0A%20%20%20%20fn%3D_rsi_fixed%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2014%2C%20%22oversold%22%3A%2030.0%2C%20%22overbought%22%3A%2070.0%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%206.%20RSI%2014%20with%20Cardwell%20bands%20conditioned%20on%20the%20SMA200.%20The%20family%27s%20headline%20act.%0A%23%20%20%20%20Same%20period%2014%20as%20%235%20on%20purpose%3A%20the%20only%20thing%20that%20changes%20is%20the%20threshold%20scheme%2C%20and%20that%0A%23%20%20%20%20is%20exactly%20the%20claim%20to%20be%20tested.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_rsi_cardwell%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%20timeperiod%3D14%29%0A%20%20%20%20sma200%20%3D%20talib.SMA%28c%2C%20timeperiod%3D200%29%0A%20%20%20%20ok%20%3D%20_finite%28rsi%2C%20sma200%29%0A%0A%20%20%20%20bullish%20%3D%20ok%20%26%20%28c%20%3E%20sma200%29%20%20%20%23%20Cardwell%20range%2040-80%0A%20%20%20%20bearish%20%3D%20ok%20%26%20%28c%20%3C%3D%20sma200%29%20%20%23%20Cardwell%20range%2020-60%0A%0A%20%20%20%20out%5Bbullish%20%26%20%28rsi%20%3C%2040.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bbullish%20%26%20%28rsi%20%3E%2080.0%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bbearish%20%26%20%28rsi%20%3C%2020.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bbearish%20%26%20%28rsi%20%3E%2060.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.rsi14_cardwell_sma200%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22RSI%2040%2F80%20above%20SMA%20200%2C%2020%2F60%20below%22%2C%0A%20%20%20%20rationale%3D%22Andrew%20Cardwell%20observed%20that%20the%20RSI%20does%20not%20oscillate%20in%20the%20same%20range%20under%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22every%20regime%3A%20in%20an%20uptrend%20it%20moves%20between%2040%20and%2080%2C%20and%20in%20a%20downtrend%20between%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2220%20and%2060.%20The%20mechanism%20behind%20it%20is%20one%20of%20participant%20composition.%20In%20a%20bull%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22market%20the%20falls%20are%20caused%20by%20profit%20taking%20from%20short-term%20traders%20and%20they%20run%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22into%20structural%20buyers%20waiting%3B%20the%20selling%20pressure%20runs%20out%20sooner%2C%20and%20that%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22why%20the%20oscillator%27s%20floor%20is%20at%2040%20and%20not%20at%2030.%20Buying%20at%2030%20in%20that%20regime%20means%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22waiting%20for%20a%20capitulation%20that%20almost%20never%20arrives%2C%20and%20staying%20out.%20The%20SMA200%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20close%20decides%20which%20regime%20applies%20using%20the%20information%20available%20at%20the%20bar%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22without%20looking%20ahead.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20and%2C%20above%20all%2C%20MORE%20TRADES%20on%20the%20side%20that%20favours%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22regime%20%28longs%20in%20an%20uptrend%2C%20shorts%20in%20a%20downtrend%29%20than%20hypothesis%205%2C%20and%20a%20large%20%22%0A%20%20%20%20%20%20%20%20%20%20%22reduction%20in%20the%20losses%20on%20the%20opposite%20side.%20We%20expect%20it%20to%20fail%20at%20regime%20changes%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22when%20the%20price%20crosses%20the%20SMA200%20several%20times%20in%20a%20row%3A%20there%20the%20bands%20alternate%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22we%20buy%20at%2040%20just%20when%20the%20relevant%20regime%20had%20already%20turned%20bearish.%20It%20is%20refuted%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20does%20not%20improve%20on%20hypothesis%205%2C%20or%20if%20all%20of%20its%20edge%20comes%20from%20the%20SMA200%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%22directional%20filter%20and%20not%20from%20the%20asymmetric%20thresholds.%22%2C%0A%20%20%20%20fn%3D_rsi_cardwell%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2014%2C%20%22regime_sma%22%3A%20200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22bullish_band%22%3A%20%2840.0%2C%2080.0%29%2C%20%22bearish_band%22%3A%20%2820.0%2C%2060.0%29%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D260%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%207.%20Williams%20%25R%3A%20position%20within%20the%20high-low%20RANGE%2C%20not%20momentum%20of%20closes.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_willr_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20wr%20%3D%20talib.WILLR%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28wr%29%0A%20%20%20%20out%5Bok%20%26%20%28wr%20%3C%20-80.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28wr%20%3E%20-20.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.willr14_fade%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20close%20at%20the%2014-candle%20extreme%22%2C%0A%20%20%20%20rationale%3D%22%25R%20does%20not%20measure%20momentum%3A%20it%20measures%20where%20the%20price%20closes%20within%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22high-low%20range%20of%20the%20last%2014%20candles.%20That%20makes%20it%20sensitive%20to%20a%20different%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22behaviour%20from%20the%20one%20the%20RSI%20picks%20up.%20Closing%20at%20the%20absolute%20floor%20of%20a%20two-week%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22range%20is%20the%20signature%20of%20a%20stop%20run%3A%20a%20push%20looking%20for%20the%20liquidity%20accumulated%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22below%20the%20previous%20lows%2C%20executed%20by%20somebody%20who%20needs%20counterparty%20for%20a%20large%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position.%20That%20flow%20is%20mechanical%20and%20uninformed%2C%20and%20once%20executed%20it%20disappears%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22which%20is%20exactly%20the%20condition%20for%20the%20absorption%20to%20be%20profitable.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20concentrated%20at%20SHORT%20horizons%20%28a%20few%20candles%29%3A%20the%20sweep%20%22%0A%20%20%20%20%20%20%20%20%20%20%22effect%20runs%20out%20quickly%20and%2C%20if%20the%20position%20is%20held%2C%20the%20signal%20turns%20into%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22directional%20bet%2C%20which%20is%20not%20what%20the%20hypothesis%20claims.%20We%20expect%20it%20to%20fail%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%22genuine%20range%20breaks%2C%20where%20the%20low%20of%20the%20range%20gives%20way%20because%20there%20is%20new%20%22%0A%20%20%20%20%20%20%20%20%20%20%22information%20and%20the%20%25R%20stays%20glued%20to%20-100%20for%20the%20whole%20leg.%20It%20is%20refuted%20if%20the%20edge%20%22%0A%20%20%20%20%20%20%20%20%20%20%22does%20not%20decay%20with%20the%20holding%20horizon.%22%2C%0A%20%20%20%20fn%3D_willr_fade%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2014%2C%20%22oversold%22%3A%20-80.0%2C%20%22overbought%22%3A%20-20.0%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%208.%20CCI%2020%3A%20deviation%20normalised%20by%20the%20MEAN%20ABSOLUTE%20deviation%20%28robust%20to%20the%20tail%29.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_cci_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20cci%20%3D%20talib.CCI%28h%2C%20low%2C%20c%2C%20timeperiod%3D20%29%0A%20%20%20%20ok%20%3D%20_finite%28cci%29%0A%20%20%20%20out%5Bok%20%26%20%28cci%20%3C%20-100.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28cci%20%3E%20100.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.cci20_fade%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20CCI%20extreme%2C%20robust%20to%20spikes%22%2C%0A%20%20%20%20rationale%3D%22The%20CCI%20uses%20the%20typical%20price%20%28H%2BL%2BC%29%2F3%20and%20normalises%20it%20by%20the%20mean%20ABSOLUTE%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22deviation%2C%20not%20by%20the%20standard%20deviation.%20The%20difference%20is%20not%20cosmetic%20in%20BTC%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22standard%20deviation%20squares%2C%20so%20a%20single%20liquidation%20candle%20inflates%20the%20denominator%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22for%2020%20candles%20and%20anaesthetises%20the%20Bollinger%20signal%20right%20after%20the%20event.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mean%20absolute%20deviation%20barely%20flinches.%20The%20hypothesis%2C%20therefore%2C%20is%20that%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22robust%20statistic%20goes%20on%20detecting%20dislocations%20in%20the%20period%20after%20a%20shock%2C%20which%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20when%20the%20premium%20for%20providing%20liquidity%20ought%20to%20be%20highest%20because%20the%20usual%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22providers%27%20capital%20is%20exhausted.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20CCI%27s%20edge%20to%20beat%20Bollinger%27s%20%28hypothesis%201%29%20precisely%20and%20only%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22windows%20that%20follow%20the%20largest-range%20candles%2C%20and%20to%20be%20similar%20or%20slightly%20worse%20over%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20rest%20of%20the%20sample%2C%20by%20giving%20more%20signals%20of%20poorer%20quality.%20We%20expect%20the%20classic%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%2B-100%20failure%20in%20a%20trend%2C%20just%20like%20the%20rest%20of%20the%20family.%20It%20is%20refuted%20if%20its%20edge%20%22%0A%20%20%20%20%20%20%20%20%20%20%22conditioned%20on%20%27after%20a%20shock%27%20is%20not%20larger%20than%20Bollinger%27s%20in%20those%20same%20windows%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20was%20the%20whole%20argument.%22%2C%0A%20%20%20%20fn%3D_cci_fade%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2020%2C%20%22threshold%22%3A%20100.0%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%209.%20Stretch%20against%20the%20LONG%20anchor.%20A%20different%20horizon%2C%20a%20different%20participant.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_stretch_ema200%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20ema200%20%3D%20talib.EMA%28c%2C%20timeperiod%3D200%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28ema200%2C%20atr%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20ema200%20-%203.0%20%2A%20atr%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20ema200%20%2B%203.0%20%2A%20atr%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.stretch_ema200_atr14%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20a%203-ATR%20stretch%20from%20the%20EMA%20200%22%2C%0A%20%20%20%20rationale%3D%22The%20eight%20previous%20hypotheses%20measure%20dislocations%20against%20an%20anchor%20of%2014-20%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candles%2C%20the%20range%20trader%27s%20horizon.%20This%20one%20changes%20scale%3A%20it%20measures%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22distance%20to%20the%20EMA200%20in%20units%20of%20ATR14%2C%20with%20the%20multiplier%203%20from%20the%20convention%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22for%20ATR-based%20exits.%20The%20participant%20is%20a%20different%20one.%20The%20200-period%20average%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20reference%20that%20capital%20allocators%20and%20structural%20holders%20use%20to%20decide%20whether%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20asset%20is%20%27expensive%27%20or%20%27cheap%27%3B%20when%20the%20price%20moves%20three%20daily%20ranges%20away%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22from%20it%2C%20the%20demand%20that%20shows%20up%20is%20not%20from%20market%20makers%20but%20from%20rebalancing%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20it%20operates%20on%20a%20timescale%20of%20weeks.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20VERY%20FEW%20signals%2C%20a%20positive%20edge%20per%20trade%20but%20with%20an%20enormous%20variance%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20long%20recovery%20horizon%2C%20of%20dozens%20of%20candles.%20We%20expect%20the%20short%20side%20%283%20ATR%20above%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22EMA200%29%20to%20work%20worse%20than%20the%20long%20one%2C%20because%20in%20BTC%27s%20bubbles%20the%20price%20has%20stayed%20%22%0A%20%20%20%20%20%20%20%20%20%20%22stretched%20above%20it%20for%20months.%20It%20is%20refuted%20if%20the%20number%20of%20signals%20is%20high%20%E2%80%94that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22would%20mean%203%20ATR%20is%20not%20an%20extreme%20in%20this%20asset%20and%20the%20%27structural%20dislocation%27%20%22%0A%20%20%20%20%20%20%20%20%20%20%22premise%20is%20false%E2%80%94%20or%20if%20the%20edge%20runs%20out%20within%20a%20few%20candles%2C%20which%20would%20make%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%22indistinguishable%20from%20short-term%20reversion.%22%2C%0A%20%20%20%20fn%3D_stretch_ema200%2C%0A%20%20%20%20params%3D%7B%22ema_period%22%3A%20200%2C%20%22atr_period%22%3A%2014%2C%20%22multiplier%22%3A%203.0%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D420%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2010.%20Extreme%20WITH%20volume%20confirmation.%20This%20is%20where%20%22forced%20closing%22%20becomes%20explicit.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_bb_volume_climax%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20upper%2C%20_mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%20%20%20%20v_mean%20%3D%20talib.SMA%28v%2C%20timeperiod%3D20%29%0A%20%20%20%20ok%20%3D%20_finite%28upper%2C%20lower%2C%20v_mean%29%0A%20%20%20%20climax%20%3D%20ok%20%26%20%28v%20%3E%202.0%20%2A%20v_mean%29%0A%20%20%20%20out%5Bclimax%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bclimax%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.bb20_2_volume_climax%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20Bollinger%20band%20on%20double%20volume%22%2C%0A%20%20%20%20rationale%3D%22The%20same%20Bollinger%20extreme%20as%20hypothesis%201%2C%20with%20one%20added%20condition%3A%20the%20candle%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22volume%20must%20double%20its%2020-period%20average%2C%20the%20conventional%20threshold%20for%20climactic%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22volume.%20Volume%20is%20what%20separates%20the%20two%20reasons%20the%20price%20can%20leave%20the%20band.%20If%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22leaves%20on%20low%20volume%2C%20the%20book%20is%20thin%20and%20there%20is%20no%20premium%20to%20charge%3A%20nobody%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22paying%20to%20get%20out.%20If%20it%20leaves%20on%20volume%20that%20doubles%20the%20average%2C%20somebody%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22closing%20under%20duress%20%E2%80%94cascading%20perpetual%20liquidations%2C%20margin%20calls%E2%80%94%20and%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22seller%20has%20neither%20an%20opinion%20about%20value%20nor%20the%20ability%20to%20wait.%20It%20is%20the%20only%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22case%20in%20which%20the%20hypothesis%20asserts%20that%20a%20structurally%20willing%20counterparty%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exists.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20LARGER%20edge%20per%20trade%20than%20hypothesis%201%20and%20far%20fewer%20trades.%20We%20expect%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22effect%20to%20be%20markedly%20asymmetric%3A%20much%20stronger%20on%20the%20long%20side%20%28buying%20capitulation%29%20%22%0A%20%20%20%20%20%20%20%20%20%20%22than%20on%20the%20short%20one%2C%20because%20bearish%20liquidations%20in%20BTC%20are%20more%20violent%20and%20more%20%22%0A%20%20%20%20%20%20%20%20%20%20%22concentrated%20in%20time%20than%20bullish%20ones.%20We%20expect%20it%20to%20fail%20on%20the%20first%20day%20of%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22genuine%20macro%20shock%2C%20where%20high%20volume%20does%20carry%20information.%20It%20is%20refuted%20if%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22volume%20filter%20does%20not%20improve%20hypothesis%201%27s%20edge%3A%20that%20would%20say%20that%20volume%20does%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%22distinguish%20forced%20flow%20from%20informed%20flow%20in%20this%20market.%22%2C%0A%20%20%20%20fn%3D_bb_volume_climax%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2020%2C%20%22deviations%22%3A%202.0%2C%20%22vol_period%22%3A%2020%2C%20%22vol_multiple%22%3A%202.0%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2011.%20Sweep%20and%20rejection.%20The%20only%20hypothesis%20in%20the%20family%20that%20looks%20at%20candle%20shape.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_sweep_rejection%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%0A%20%20%20%20%23%20Low%2Fhigh%20of%20the%2020%20PREVIOUS%20candles%3A%20talib.MIN%28...%29%5Bi%5D%20covers%20the%20window%20ending%20at%20i%0A%20%20%20%20%23%20INCLUSIVE%2C%20so%20it%20has%20to%20be%20shifted%20by%20one%20bar%20to%20exclude%20the%20current%20candle.%20The%20shift%20runs%0A%20%20%20%20%23%20towards%20the%20future%20%28_prev%29%2C%20never%20backwards.%0A%20%20%20%20min_prev%20%3D%20_prev%28talib.MIN%28low%2C%20timeperiod%3D20%29%29%0A%20%20%20%20max_prev%20%3D%20_prev%28talib.MAX%28h%2C%20timeperiod%3D20%29%29%0A%0A%20%20%20%20rng%20%3D%20h%20-%20low%0A%20%20%20%20ok%20%3D%20_finite%28min_prev%2C%20max_prev%2C%20rng%29%20%26%20%28rng%20%3E%200.0%29%0A%0A%20%20%20%20%23%20Rejection%3A%20the%20candle%20pierces%20the%20previous%20extreme%20but%20closes%20in%20the%20opposite%20third%20of%20its%0A%20%20%20%20%23%20range.%0A%20%20%20%20sweep_low%20%3D%20ok%20%26%20%28low%20%3C%20min_prev%29%20%26%20%28%28c%20-%20low%29%20%2F%20np.where%28ok%2C%20rng%2C%201.0%29%20%3E%202.0%20%2F%203.0%29%0A%20%20%20%20sweep_high%20%3D%20ok%20%26%20%28h%20%3E%20max_prev%29%20%26%20%28%28h%20-%20c%29%20%2F%20np.where%28ok%2C%20rng%2C%201.0%29%20%3E%202.0%20%2F%203.0%29%0A%0A%20%20%20%20out%5Bsweep_low%5D%20%3D%201%0A%20%20%20%20out%5Bsweep_high%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.sweep_rejection_20%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20sweep%20with%20a%20rejection%20wick%22%2C%0A%20%20%20%20rationale%3D%22The%20candle%20pierces%20the%20low%20of%20the%20previous%2020%20but%20closes%20in%20the%20upper%20third%20of%20its%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22own%20range.%20That%20shape%20is%20the%20observable%20footprint%20of%20a%20specific%20sequence%3A%20beneath%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22visible%20low%2C%20buyers%27%20stops%20and%20breakout%20sell%20orders%20accumulate%3B%20a%20participant%20who%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22needs%20to%20buy%20size%20pushes%20the%20price%20down%20there%2C%20those%20orders%20execute%20and%20give%20them%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20counterparty%20they%20needed%2C%20and%20the%20price%20comes%20back%20because%20the%20selling%20was%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mechanical%20and%20exhausted%20itself%20within%20the%20candle.%20The%20key%20is%20that%20the%20rejection%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22confirmed%20INSIDE%20the%20same%20bar%2C%20by%20the%20close%3A%20there%20is%20no%20need%20to%20see%20the%20next%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candle%2C%20and%20that%20is%20why%20the%20signal%20is%20causal.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20and%20short-lived%20edge%2C%20with%20the%20bulk%20of%20the%20move%20in%20the%20first%20%22%0A%20%20%20%20%20%20%20%20%20%20%22candles%20after%20the%20signal.%20We%20expect%20the%20edge%20to%20be%20larger%20on%2015m%20and%201h%20than%20on%204h%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22because%20the%20accumulation%20of%20stops%20at%20visible%20levels%20is%20a%20microstructure%20phenomenon%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20blurs%20under%20aggregation.%20We%20expect%20it%20to%20fail%20when%20the%20piercing%20of%20the%20low%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22real%20start%20of%20a%20bear%20leg%3A%20there%20the%20close%20in%20the%20upper%20third%20is%20only%20a%20technical%20bounce%20%22%0A%20%20%20%20%20%20%20%20%20%20%22inside%20the%20fall.%20It%20is%20refuted%20if%20there%20is%20no%20difference%20in%20edge%20between%20the%20candles%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20pierce%20the%20previous%20low%20and%20the%20ones%20that%20simply%20close%20strong.%22%2C%0A%20%20%20%20fn%3D_sweep_rejection%2C%0A%20%20%20%20params%3D%7B%22lookback%22%3A%2020%2C%20%22rejection_fraction%22%3A%202%20%2F%203%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2012.%20A%20streak%20of%20three%20closes.%20No%20indicator%2C%20no%20normalisation%3A%20overreaction%20in%20the%20raw.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_streak3%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20c1%2C%20c2%2C%20c3%20%3D%20_prev%28c%29%2C%20_prev%28_prev%28c%29%29%2C%20_prev%28_prev%28_prev%28c%29%29%29%0A%20%20%20%20ok%20%3D%20_finite%28c1%2C%20c2%2C%20c3%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20c1%29%20%26%20%28c1%20%3C%20c2%29%20%26%20%28c2%20%3C%20c3%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20c1%29%20%26%20%28c1%20%3E%20c2%29%20%26%20%28c2%20%3E%20c3%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22mean_reversion.streak3_fade%22%2C%0A%20%20%20%20family%3D%22mean_reversion%22%2C%0A%20%20%20%20title%3D%22Fade%20three%20consecutive%20closes%2C%20no%20indicator%22%2C%0A%20%20%20%20rationale%3D%22Three%20consecutive%20closes%20to%20the%20downside%20are%20bought%3B%20three%20to%20the%20upside%20are%20sold.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22There%20is%20no%20indicator%2C%20no%20normalisation%20by%20volatility%20and%20no%20threshold%20to%20tune%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20bareness%20is%20the%20point%3A%20it%20is%20the%20cleanest%20test%20of%20overreaction%20by%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22extrapolation.%20The%20concrete%20behaviour%20is%20that%20of%20the%20trader%20who%20mistakes%20a%20short%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22streak%20for%20a%20trend%20and%20positions%20in%20its%20direction%2C%20together%20with%20the%20risk%20manager%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22who%20mechanically%20cuts%20exposure%20after%20several%20closes%20against%20them.%20If%20mean%20reversion%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20BTC%20really%20exists%20as%20a%20behavioural%20phenomenon%2C%20it%20has%20to%20show%20up%20here%3B%20if%20it%20only%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22shows%20up%20in%20more%20elaborate%20formulations%2C%20we%20should%20suspect%20that%20what%20we%20are%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22measuring%20is%20an%20artefact%20of%20those%20formulations.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20VERY%20small%20edge%2C%20barely%20distinguishable%20from%20noise%2C%20and%20probably%20negative%20%22%0A%20%20%20%20%20%20%20%20%20%20%22after%20costs%20given%20the%20high%20frequency%20of%20signals%3B%20what%20we%20expect%20to%20be%20informative%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22SIGN%20and%20its%20consistency%20across%20timeframes%2C%20not%20the%20magnitude.%20We%20expect%20it%20to%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%22negative%20in%20strongly%20trending%20legs%2C%20where%20streaks%20of%20three%20chain%20together.%20It%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22refuted%2C%20and%20with%20it%20the%20overreaction%20premise%20of%20the%20whole%20family%2C%20if%20the%20sign%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22systematically%20negative%20on%20every%20timeframe%3A%20that%20would%20indicate%20that%20in%20BTC%20short%20%22%0A%20%20%20%20%20%20%20%20%20%20%22streaks%20continue%20instead%20of%20reverting%2C%20and%20then%20whichever%20of%20the%20eleven%20preceding%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hypotheses%20work%20would%20be%20capturing%20something%20else.%22%2C%0A%20%20%20%20fn%3D_streak3%2C%0A%20%20%20%20params%3D%7B%22consecutive_bars%22%3A%203%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=c16e7c0b077d39b2919e24ae7bfe6d33b35ff4de0ca95b7298a888d0e74092a7\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":13,"row_hash":"59eaa17fe96ba3f0294ccbf1ddb023b532f923a63375f1fc8647655b75317b68","body":"wavelab-journal-chain\nv=3\nseq=13\nprev=033ebc2d063bbe441b209589b90e05559d97935ae31b84415745a6bf6dd58b98\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nprereg_seq=2\nsource_text=%22%22%22MOMENTUM%20family%3A%20time-series%20momentum%20on%20BTC.%0A%0APRE-REGISTERED.%20Written%20on%202026-09-08%2C%20before%20running%20a%20single%20backtest%20and%20without%20having%20looked%0Aat%20any%20result.%20The%20parameters%20are%20the%20conventional%20ones%20from%20the%20literature%20and%20they%20are%20FROZEN%3A%20if%0Aa%20hypothesis%20fails%20it%20is%20not%20retried%20with%20another%20value.%20All%20twelve%20count%20towards%20the%0Amultiple-comparisons%20correction%2C%20including%20%E2%80%94above%20all%E2%80%94%20the%20ones%20we%20expect%20to%20fail.%0A%0AMechanisms%20postulated%20across%20the%20whole%20family%2C%20in%20order%20of%20importance%3A%0A%0A%20%201.%20Underreaction.%20Information%20diffuses%20in%20layers%20%28OTC%20desks%20and%20treasuries%20%E2%86%92%20derivatives%20%E2%86%92%0A%20%20%20%20%20retail%29%20over%20days%20or%20months.%20The%20price%20adjusts%20with%20a%20lag%20and%20that%20adjustment%20has%20a%20persistent%0A%20%20%20%20%20sign.%0A%20%202.%20Herding.%20The%20arrival%20of%20new%20participants%20is%20self-reinforcing%20for%20as%20long%20as%20there%20is%20marginal%0A%20%20%20%20%20money%20left%20to%20come%20in%2C%20and%20it%20stops%20dead%20when%20there%20is%20not.%0A%20%203.%20Systematic%20following.%20Trend%20funds%20and%20momentum-indexed%20products%20rebalance%20over%20known%2C%20public%0A%20%20%20%20%20windows%2C%20with%20orders%20that%20are%20large%2C%20slow%20and%20directional.%0A%0ACausality%20note%3A%20every%20statistic%20in%20this%20file%20is%20computed%20backwards.%20The%20indices%20of%20previous%0Aextremes%20%28%60_prior_extreme%60%29%20are%20bounded%20by%20construction%20at%20%60i%20-%20_DIV_SEPARATION%60%2C%20and%20the%20shifts%0A%28%60_back%60%29%20reject%20k%20%3C%3D%200%20with%20an%20exception%20rather%20than%20with%20a%20comment.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0Afrom%20numpy.lib.stride_tricks%20import%20sliding_window_view%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20Parameters.%20ONE%20value%20per%20concept%2C%20fixed%20a%20priori.%20Not%20searched%20over.%0A%23%20--------------------------------------------------------------------------------------------%0A_TSMOM_LONG%20%3D%20360%20%20%20%20%20%20%20%23%20~12%20months%20in%20daily%20candles%0A_TSMOM_SKIP%20%3D%2030%20%20%20%20%20%20%20%20%23%20~1%20month%2C%20the%20one%20that%20gets%20skipped%0A_TSMOM_SHORT%20%3D%2030%20%20%20%20%20%20%20%23%201%20month%20%20%28multi-horizon%20consensus%29%0A_TSMOM_MID%20%3D%2090%20%20%20%20%20%20%20%20%20%23%203%20months%0A_TSMOM_SEMI%20%3D%20180%20%20%20%20%20%20%20%23%206%20months%0A_ROC_SHORT%20%3D%2010%0A_ROC_LONG%20%3D%2020%0A_AO_FAST%20%3D%205%20%20%20%20%20%20%20%20%20%20%20%20%23%20Bill%20Williams%27%20canonical%20Awesome%20Oscillator%0A_AO_SLOW%20%3D%2034%0A_DIV_WINDOW%20%3D%20100%20%20%20%20%20%20%20%23%20window%20in%20which%20the%20previous%20extreme%20is%20looked%20for%0A_DIV_SEPARATION%20%3D%2010%20%20%20%20%23%20minimum%20separation%20between%20the%20previous%20extreme%20and%20the%20current%20bar%0A_LINREG%20%3D%2020%0A_PERSIST_WINDOW%20%3D%2020%0A_PERSIST_HIGH%20%3D%2014%20%20%20%20%20%20%23%2070%20%25%20of%20the%20window%27s%20candles%20with%20the%20same%20sign%0A_ER_PERIOD%20%3D%2010%20%20%20%20%20%20%20%20%20%23%20canonical%20window%20of%20Kaufman%27s%20efficiency%20ratio%0A_ER_THRESHOLD%20%3D%200.30%20%20%20%20%23%20%22efficient%20path%22%20threshold.%20Fixed%20a%20priori%2C%20NOT%20tuned.%0A_KAMA_ER%20%3D%2010%20%20%20%20%20%20%20%20%20%20%20%23%20TA-Lib%20fixes%20fast%3D2%20and%20slow%3D30%20internally%0A_VOL_SHORT%20%3D%205%0A_VOL_LONG%20%3D%2020%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20Utilities%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_f%28x%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Contiguous%20float64%2C%20the%20only%20thing%20TA-Lib%20accepts.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28x%2C%20dtype%3Dnp.float64%29%0A%0A%0Adef%20_base%28s%3A%20Series%2C%20minimum%3A%20int%29%20-%3E%20tuple%5Bnp.ndarray%20%7C%20None%2C%20np.ndarray%5D%3A%0A%20%20%20%20%22%22%22%28closes%2C%20output%29.%20%60closes%60%20is%20None%20if%20the%20series%20is%20too%20short%20or%20unusable.%22%22%22%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20if%20c.size%20%3C%20minimum%20or%20not%20np.isfinite%28c%29.any%28%29%3A%0A%20%20%20%20%20%20%20%20return%20None%2C%20out%0A%20%20%20%20return%20c%2C%20out%0A%0A%0Adef%20_back%28x%3A%20np.ndarray%2C%20k%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22x%5Bi-k%5D%2C%20with%20NaN%20in%20the%20first%20k%20positions.%20k%3E0%20always%3A%20looking%20ahead%20is%20a%20bug.%22%22%22%0A%20%20%20%20if%20k%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28f%22_back%20requires%20k%3E0%20%28causality%29%3B%20got%20%7Bk%7D%22%29%0A%20%20%20%20out%20%3D%20np.full%28x.size%2C%20np.nan%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20if%20k%20%3C%20x.size%3A%0A%20%20%20%20%20%20%20%20out%5Bk%3A%5D%20%3D%20x%5B%3A-k%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_ao%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Awesome%20Oscillator%3A%20SMA%285%29%20-%20SMA%2834%29%20of%20the%20median%20price%20%28H%2BL%29%2F2.%22%22%22%0A%20%20%20%20hl%20%3D%20%28_f%28s.high%29%20%2B%20_f%28s.low%29%29%20%2F%202.0%0A%20%20%20%20return%20talib.SMA%28hl%2C%20_AO_FAST%29%20-%20talib.SMA%28hl%2C%20_AO_SLOW%29%0A%0A%0Adef%20_prior_extreme%28x%3A%20np.ndarray%2C%20find_max%3A%20bool%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Index%20of%20x%27s%20extreme%20within%20%5Bi-_DIV_WINDOW%2C%20i-_DIV_SEPARATION%5D.%0A%0A%20%20%20%20Strictly%20causal%3A%20the%20index%20returned%20for%20bar%20i%20never%20exceeds%20i-_DIV_SEPARATION.%0A%20%20%20%20-1%20where%20there%20is%20no%20complete%20window.%0A%20%20%20%20%22%22%22%0A%20%20%20%20n%20%3D%20x.size%0A%20%20%20%20j%20%3D%20np.full%28n%2C%20-1%2C%20dtype%3Dnp.int64%29%0A%20%20%20%20width%20%3D%20_DIV_WINDOW%20-%20_DIV_SEPARATION%20%2B%201%0A%20%20%20%20if%20n%20%3C%20_DIV_WINDOW%20%2B%201%3A%0A%20%20%20%20%20%20%20%20return%20j%0A%20%20%20%20v%20%3D%20sliding_window_view%28x%2C%20width%29%20%20%20%20%20%20%20%20%20%20%20%20%23%20v%5Bk%5D%20%3D%20x%5Bk%20%3A%20k%2Bwidth%5D%0A%20%20%20%20rel%20%3D%20np.argmax%28v%2C%20axis%3D1%29%20if%20find_max%20else%20np.argmin%28v%2C%20axis%3D1%29%0A%20%20%20%20i%20%3D%20np.arange%28_DIV_WINDOW%2C%20n%29%0A%20%20%20%20k%20%3D%20i%20-%20_DIV_WINDOW%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20window%20%3D%20x%5Bi-100%20%3A%20i-9%5D%0A%20%20%20%20j%5Bi%5D%20%3D%20k%20%2B%20rel%5Bk%5D%0A%20%20%20%20return%20j%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%201.%2012-1%20momentum%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_tsmom_12_1%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_TSMOM_LONG%20%2B%20_TSMOM_SKIP%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20recent%20%3D%20_back%28c%2C%20_TSMOM_SKIP%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20close%20of%20~1%20month%20ago%0A%20%20%20%20old%20%3D%20_back%28c%2C%20_TSMOM_LONG%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20close%20of%20~12%20months%20ago%0A%20%20%20%20ok%20%3D%20np.isfinite%28recent%29%20%26%20np.isfinite%28old%29%20%26%20%28old%20%3E%200%29%0A%20%20%20%20ret%20%3D%20np.full%28c.size%2C%20np.nan%29%0A%20%20%20%20ret%5Bok%5D%20%3D%20recent%5Bok%5D%20%2F%20old%5Bok%5D%20-%201.0%0A%20%20%20%20out%5Bnp.isfinite%28ret%29%20%26%20%28ret%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bnp.isfinite%28ret%29%20%26%20%28ret%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.tsmom_12_1%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22The%20year%27s%20trend%2C%20skipping%20the%20last%20month%22%2C%0A%20%20%20%20rationale%3D%22Systematic%20trend%20funds%20and%20momentum-indexed%20products%20rebuild%20their%20portfolios%20over%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2212-month%20window%3B%20their%20rebalancing%20orders%20are%20large%2C%20slow%20and%20directional%2C%20and%20they%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22push%20the%20price%20in%20the%20direction%20of%20the%20past%20return.%20The%20last%20month%20is%20excluded%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22because%20at%20that%20horizon%20what%20dominates%20is%20the%20reversion%20that%20follows%20liquidation%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cascades%2C%20together%20with%20market-maker%20inventory%2C%20which%20has%20the%20opposite%20sign%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22contaminates%20the%20measurement.%20In%20BTC%20the%20same%20behaviour%20arrives%20via%20corporate%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22treasuries%2C%20spot%20ETF%20flow%20and%20retail%20chasing%20the%20%27twelve-month%20high%27%20headline.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%2C%20persistent%20positive%20edge%20on%20the%20daily%2C%20concentrated%20in%202017%2C%202020-21%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%202023-24%2C%20and%20a%20NEGATIVE%20edge%20in%20the%203-6%20months%20following%20a%20cycle%20top%20%282018%2C%202022%29%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22when%20the%20signal%20stays%20long%20throughout%20the%20fall.%20It%20is%20falsified%20if%20the%20average%20edge%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%E2%89%A40%20within%20the%20trending%20regime%20itself%3A%20that%20would%20mean%20that%20not%20even%20when%20the%20mechanism%20%22%0A%20%20%20%20%20%20%20%20%20%20%22ought%20to%20act%20does%20it%20act.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22AUDIT%20NOTE%20%282026-09-08%29%3A%20%60trend.tsmom_365d%60%20registers%20the%20sign%20of%20the%20365-day%20return%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%221d%2C%20that%20is%2C%20this%20very%20same%20bet%20WITHOUT%20skipping%20the%20last%20month.%20Neither%20of%20the%20two%20%22%0A%20%20%20%20%20%20%20%20%20%20%22files%20declared%20the%20other.%20Neither%20is%20removed%20%E2%80%94the%20one-month%20skip%20is%20the%20substantive%20part%20%22%0A%20%20%20%20%20%20%20%20%20%20%22of%20the%2012-1%20hypothesis%20and%20the%20two%20signal%20series%20differ%20enough%20for%20the%20comparison%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22have%20content%E2%80%94%20but%20let%20it%20be%20written%20down%20that%20they%20are%20DEPENDENT%20trials%20over%20the%20same%20%22%0A%20%20%20%20%20%20%20%20%20%20%22horizon%20and%20the%20same%20timeframe%3A%20if%20both%20come%20out%20positive%20that%20is%20ONE%20result%2C%20not%20two%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20the%20informative%20contrast%20is%20whether%20skipping%20the%20last%20month%20adds%20anything.%22%2C%0A%20%20%20%20fn%3D_tsmom_12_1%2C%0A%20%20%20%20params%3D%7B%22lookback%22%3A%20_TSMOM_LONG%2C%20%22skip%22%3A%20_TSMOM_SKIP%7D%2C%0A%20%20%20%20timeframes%3D%28%221d%22%2C%29%2C%0A%20%20%20%20min_warmup%3D420%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%202.%20Multi-horizon%20consensus%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_tsmom_consensus%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_TSMOM_SEMI%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20r1%20%3D%20talib.ROC%28c%2C%20_TSMOM_SHORT%29%0A%20%20%20%20r3%20%3D%20talib.ROC%28c%2C%20_TSMOM_MID%29%0A%20%20%20%20r6%20%3D%20talib.ROC%28c%2C%20_TSMOM_SEMI%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28r1%29%20%26%20np.isfinite%28r3%29%20%26%20np.isfinite%28r6%29%0A%20%20%20%20out%5Bok%20%26%20%28r1%20%3E%200%29%20%26%20%28r3%20%3E%200%29%20%26%20%28r6%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28r1%20%3C%200%29%20%26%20%28r3%20%3C%200%29%20%26%20%28r6%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.tsmom_consensus%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22One%2C%20three%20and%20six%20months%20all%20agree%22%2C%0A%20%20%20%20rationale%3D%22Information%20diffuses%20at%20different%20speeds%3A%20retail%20reacts%20in%20days%2C%20treasuries%20and%20ETFs%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20months.%20Requiring%20the%201-%2C%203-%20and%206-month%20horizons%20to%20agree%20in%20sign%20selects%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22stretches%20in%20which%20the%20three%20cohorts%20push%20at%20once%2C%20which%20is%20when%20the%20order-book%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22imbalance%20is%20one-directional%20and%20there%20is%20no%20cohort%20selling%20to%20the%20other.%20It%20is%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20grid%3A%20it%20is%20a%20single%20fixed%20configuration%2C%20the%20canonical%20time-series%20momentum%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22triple%2C%20shortened%20from%201%2F3%2F12%20to%201%2F3%2F6%20because%20the%20crypto%20cycle%20lasts%20half%20as%20long.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20less%20time%20in%20the%20market%20and%20a%20HIGHER%20edge%20per%20bar%20than%20tsmom_12_1%2C%20at%20the%20cost%20%22%0A%20%20%20%20%20%20%20%20%20%20%22of%20arriving%20late%20to%20the%202019%20and%202023%20bottoms%20and%20of%20staying%20out%20through%20the%20first%20%22%0A%20%20%20%20%20%20%20%20%20%20%22bounces.%20It%20is%20falsified%20if%20the%20edge%20per%20bar%20does%20not%20beat%20tsmom_12_1%27s%3A%20the%20consensus%20%22%0A%20%20%20%20%20%20%20%20%20%20%22would%20be%20adding%20nothing%20and%20would%20merely%20be%20shrinking%20the%20sample.%22%2C%0A%20%20%20%20fn%3D_tsmom_consensus%2C%0A%20%20%20%20params%3D%7B%22short%22%3A%20_TSMOM_SHORT%2C%20%22mid%22%3A%20_TSMOM_MID%2C%20%22semi%22%3A%20_TSMOM_SEMI%7D%2C%0A%20%20%20%20timeframes%3D%28%221d%22%2C%29%2C%0A%20%20%20%20min_warmup%3D240%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%203.%20Short%20ROC%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_roc_short%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ROC_SHORT%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%20_ROC_SHORT%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28roc%29%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.roc10%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Follow%20the%20last%20ten%20candles%27%20direction%22%2C%0A%20%20%20%20rationale%3D%22Pure%20underreaction.%20When%20relevant%20information%20appears%20%28a%20macro%20print%2C%20a%20move%20by%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22large%20holder%2C%20a%20regulatory%20headline%29%20not%20every%20participant%20processes%20it%20at%20the%20same%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22time%3A%20the%20adjustment%20is%20spread%20across%20several%20candles%20because%20the%20big%20desks%20slice%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22their%20orders%20so%20as%20not%20to%20move%20the%20market.%20The%20sign%20of%20the%20last%20ten%20candles%27%20return%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20the%20most%20direct%20measure%20of%20that%20adjustment%20in%20progress%2C%20before%20the%20positioning%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22saturates.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20on%204h%20and%201d%20and%20a%20NULL%20OR%20NEGATIVE%20edge%20on%201h%2C%20where%20%22%0A%20%20%20%20%20%20%20%20%20%20%22microstructure%20noise%20and%20the%20cost%20per%20turnover%20eat%20the%20effect.%20It%20is%20falsified%20if%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22sign%20of%20the%20ROC%20separates%20future%20returns%20on%20no%20timeframe%3B%20and%20if%20the%20edge%20turned%20out%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22be%20LARGER%20on%201h%20than%20on%201d%2C%20the%20mechanism%20we%20postulate%20is%20false%3A%20we%20would%20be%20measuring%20%22%0A%20%20%20%20%20%20%20%20%20%20%22microstructure%20autocorrelation%2C%20not%20information%20diffusion.%22%2C%0A%20%20%20%20fn%3D_roc_short%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%20_ROC_SHORT%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%204.%20Term%20structure%20of%20the%20ROC%20%28acceleration%29%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_roc_term_structure%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ROC_LONG%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20%23%20Rate%20PER%20CANDLE%2C%20so%20that%20the%20two%20horizons%20are%20comparable%20in%20scale.%0A%20%20%20%20short_rate%20%3D%20talib.ROC%28c%2C%20_ROC_SHORT%29%20%2F%20_ROC_SHORT%0A%20%20%20%20long_rate%20%3D%20talib.ROC%28c%2C%20_ROC_LONG%29%20%2F%20_ROC_LONG%0A%20%20%20%20ok%20%3D%20np.isfinite%28short_rate%29%20%26%20np.isfinite%28long_rate%29%0A%20%20%20%20out%5Bok%20%26%20%28long_rate%20%3E%200%29%20%26%20%28short_rate%20%3E%20long_rate%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28long_rate%20%3C%200%29%20%26%20%28short_rate%20%3C%20long_rate%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.roc_term_structure%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Speeding%20up%2C%20not%20just%20rising%22%2C%0A%20%20%20%20rationale%3D%22Second-order%20herding%20effect.%20A%20trend%20that%20is%20ACCELERATING%20indicates%20that%20new%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22participants%20are%20still%20coming%20in%20%E2%80%94rising%20leverage%2C%20rising%20perpetual%20funding%2C%20FOMO%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22buying%E2%80%94%20whereas%20one%20that%20is%20decelerating%20indicates%20that%20the%20marginal%20buyer%20has%20run%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22out%20and%20all%20that%20is%20left%20is%20rotation%20among%20those%20already%20inside.%20We%20compare%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22per-candle%20rate%20over%2010%20candles%20against%20the%20one%20over%2020%20so%20that%20the%20comparison%20is%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20homogeneous%20scale%3B%20this%20is%20not%20a%20variant%20of%20roc10%2C%20it%20is%20a%20condition%20on%20its%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22derivative.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%2C%20higher%20per%20bar%20than%20roc10%20while%20the%20trend%20accelerates%2C%20and%20we%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20it%20to%20FAIL%20exactly%20at%20blow-off%20tops%2C%20where%20the%20acceleration%20peaks%20on%20the%20eve%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20turn%20%28December%202017%2C%20April%20and%20November%202021%29.%20It%20is%20falsified%20if%20its%20edge%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22indistinguishable%20from%20roc10%27s%3A%20the%20acceleration%20would%20be%20adding%20no%20information%20over%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22level.%22%2C%0A%20%20%20%20fn%3D_roc_term_structure%2C%0A%20%20%20%20params%3D%7B%22short%22%3A%20_ROC_SHORT%2C%20%22long%22%3A%20_ROC_LONG%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%205.%20Sign%20of%20the%20Awesome%20Oscillator%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_ao_sign%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_AO_SLOW%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20ao%20%3D%20_ao%28s%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28ao%29%0A%20%20%20%20out%5Bok%20%26%20%28ao%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28ao%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.ao_sign%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22AO%20above%20zero%2C%20recent%20buyers%20in%20profit%22%2C%0A%20%20%20%20rationale%3D%22The%20AO%20subtracts%20the%20median%20price%20of%20the%20last%2034%20candles%20from%20that%20of%20the%20last%205%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20is%2C%20it%20compares%20the%20average%20cost%20of%20the%20recent%20buying%20cohort%20with%20that%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22previous%20one.%20If%20it%20is%20positive%2C%20those%20who%20bought%20recently%20are%20in%20profit%20and%20are%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22no%20hurry%20to%20sell%2C%20so%20the%20supply%20into%20each%20rise%20is%20thin%3B%20if%20it%20is%20negative%2C%20every%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bounce%20runs%20into%20people%20getting%20out%20at%20break-even%2C%20which%20is%20dense%2C%20continuously%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22renewed%20supply.%20It%20uses%20%28H%2BL%29%2F2%20instead%20of%20the%20close%2C%20which%20reduces%20the%20weight%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20closing-auction%20price%20relative%20to%20the%20range%20actually%20traded.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20a%20trend%20and%20around%20zero%20or%20negative%20in%20a%20range%2C%20where%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22crossover%20of%20the%20two%20averages%20happens%20with%20a%20systematic%20lag.%20We%20expect%20it%20NOT%20to%20beat%20an%20%22%0A%20%20%20%20%20%20%20%20%20%20%22equivalent%20moving-average%20crossover%20from%20the%20trend%20family%3A%20if%20it%20does%2C%20the%20median%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%22contributes%20something%20the%20close%20does%20not%2C%20and%20that%20would%20be%20a%20result%20in%20itself.%20It%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsified%20if%20the%20sign%20of%20the%20AO%20separates%20future%20returns%20not%20even%20in%20a%20trending%20regime.%22%2C%0A%20%20%20%20fn%3D_ao_sign%2C%0A%20%20%20%20params%3D%7B%22fast%22%3A%20_AO_FAST%2C%20%22slow%22%3A%20_AO_SLOW%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%206.%20AO%20that%20CONFIRMS%20the%20new%20extreme%20%28folklore%3A%20wave%203%29%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_ao_confirms%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_DIV_WINDOW%20%2B%20_AO_SLOW%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20ao%20%3D%20_ao%28s%29%0A%20%20%20%20jmax%20%3D%20_prior_extreme%28c%2C%20find_max%3DTrue%29%0A%20%20%20%20jmin%20%3D%20_prior_extreme%28c%2C%20find_max%3DFalse%29%0A%0A%20%20%20%20has_max%20%3D%20jmax%20%3E%3D%200%0A%20%20%20%20jm%20%3D%20np.where%28has_max%2C%20jmax%2C%200%29%0A%20%20%20%20ok_max%20%3D%20has_max%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjm%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjm%5D%29%0A%20%20%20%20out%5Bok_max%20%26%20%28c%20%3E%20c%5Bjm%5D%29%20%26%20%28ao%20%3E%20ao%5Bjm%5D%29%20%26%20%28ao%20%3E%200%29%5D%20%3D%201%0A%0A%20%20%20%20has_min%20%3D%20jmin%20%3E%3D%200%0A%20%20%20%20jn%20%3D%20np.where%28has_min%2C%20jmin%2C%200%29%0A%20%20%20%20ok_min%20%3D%20has_min%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjn%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjn%5D%29%0A%20%20%20%20out%5Bok_min%20%26%20%28c%20%3C%20c%5Bjn%5D%29%20%26%20%28ao%20%3C%20ao%5Bjn%5D%29%20%26%20%28ao%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.ao_confirms_extreme%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22New%20high%20confirmed%20by%20a%20stronger%20AO%22%2C%0A%20%20%20%20rationale%3D%22A%20new%20price%20high%20accompanied%20by%20an%20AO%20HIGHER%20than%20at%20the%20window%27s%20previous%20high%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22means%20that%20the%20displacement%20of%20the%20average%20cost%20is%20bigger%20than%20it%20was%20last%20time%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cohort%20doing%20the%20buying%20is%20more%20numerous%2C%20not%20the%20same%20people%20rotating%20the%20same%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22capital.%20That%20is%20the%20pattern%20Elliott%20practitioners%20call%20a%20third%20wave%2C%20the%20one%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20most%20participation%20and%20the%20least%20resistance.%20The%20real%20mechanism%20is%20herding%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22confirmed%20break%20draws%20in%20the%20systematic%20follower%20and%20retail%20at%20the%20same%20time%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22both%20buy%20on%20the%20same%20side%20of%20the%20book.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20but%20a%20very%20concentrated%20one%3A%20the%20signal%20should%20be%20flat%20most%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20time%20and%20active%20on%20only%20a%20few%20bars%20per%20year.%20We%20expect%20it%20to%20be%20WORSE%20than%20ao_sign%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20total%20edge%20%28by%20being%20in%20the%20market%20far%20less%29%20and%20BETTER%20in%20edge%20per%20bar.%20It%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsified%20if%20its%20edge%20per%20bar%20does%20not%20beat%20ao_divergence_extreme%27s%3A%20in%20that%20case%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22wave%203%20%2F%20wave%205%20distinction%20of%20Elliott%20folklore%20has%20no%20empirical%20content.%22%2C%0A%20%20%20%20fn%3D_ao_confirms%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%20_DIV_WINDOW%2C%20%22separation%22%3A%20_DIV_SEPARATION%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22fast%22%3A%20_AO_FAST%2C%20%22slow%22%3A%20_AO_SLOW%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%207.%20AO%20that%20DIVERGES%20from%20the%20new%20extreme%20%28folklore%3A%20wave%205%29%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_ao_divergence%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_DIV_WINDOW%20%2B%20_AO_SLOW%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20ao%20%3D%20_ao%28s%29%0A%20%20%20%20jmax%20%3D%20_prior_extreme%28c%2C%20find_max%3DTrue%29%0A%20%20%20%20jmin%20%3D%20_prior_extreme%28c%2C%20find_max%3DFalse%29%0A%0A%20%20%20%20has_max%20%3D%20jmax%20%3E%3D%200%0A%20%20%20%20jm%20%3D%20np.where%28has_max%2C%20jmax%2C%200%29%0A%20%20%20%20ok_max%20%3D%20has_max%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjm%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjm%5D%29%0A%20%20%20%20%23%20Bill%20Williams%27%20bearish%20%22twin%20peaks%22%3A%20both%20peaks%20above%20zero.%0A%20%20%20%20out%5Bok_max%20%26%20%28c%20%3E%20c%5Bjm%5D%29%20%26%20%28ao%20%3C%20ao%5Bjm%5D%29%20%26%20%28ao%20%3E%200%29%20%26%20%28ao%5Bjm%5D%20%3E%200%29%5D%20%3D%20-1%0A%0A%20%20%20%20has_min%20%3D%20jmin%20%3E%3D%200%0A%20%20%20%20jn%20%3D%20np.where%28has_min%2C%20jmin%2C%200%29%0A%20%20%20%20ok_min%20%3D%20has_min%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjn%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjn%5D%29%0A%20%20%20%20out%5Bok_min%20%26%20%28c%20%3C%20c%5Bjn%5D%29%20%26%20%28ao%20%3E%20ao%5Bjn%5D%29%20%26%20%28ao%20%3C%200%29%20%26%20%28ao%5Bjn%5D%20%3C%200%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.ao_divergence_extreme%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20high%20the%20AO%20won%27t%20confirm%22%2C%0A%20%20%20%20rationale%3D%22A%20new%20price%20high%20with%20an%20AO%20LOWER%20than%20at%20the%20previous%20high%20says%20that%20the%20price%20was%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22made%20with%20less%20displacement%20of%20the%20average%20cost%3A%20the%20high%20is%20produced%20by%20short%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22covering%20and%20late%20retail%2C%20with%20a%20smaller%20aggregate%20size%2C%20while%20the%20cohort%20that%20drove%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20previous%20leg%20is%20already%20distributing%20into%20them.%20Both%20peaks%20are%20required%20to%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22above%20zero%20%28Bill%20Williams%27%20twin%20peaks%29%20so%20as%20not%20to%20confuse%20exhaustion%20with%20a%20bounce%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22inside%20a%20fall.%20We%20emit%20the%20signal%20against%20the%20price.%22%2C%0A%20%20%20%20prior%3D%22Our%20prior%20is%20UNFAVOURABLE%20and%20we%20register%20it%20all%20the%20same.%20We%20expect%20a%20slightly%20negative%20%22%0A%20%20%20%20%20%20%20%20%20%20%22edge%20over%20the%20history%20as%20a%20whole%20and%20a%20clearly%20negative%20one%20inside%20the%20long%20trends%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%222017-Q4%20and%202020-Q4%2C%20where%20the%20divergence%20appears%20and%20the%20price%20goes%20on%20rising%20for%20%22%0A%20%20%20%20%20%20%20%20%20%20%22weeks%3B%20we%20only%20expect%20a%20positive%20edge%20in%20the%20immediate%20neighbourhood%20of%20cycle%20tops%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22which%20are%20four%20events%20and%20therefore%20an%20insufficient%20n.%20It%20is%20falsified%20as%20a%20trading%20tool%20%22%0A%20%20%20%20%20%20%20%20%20%20%22if%20its%20overall%20edge%20is%20not%20positive%3B%20it%20is%20registered%20in%20order%20to%20leave%20the%20expected%20%22%0A%20%20%20%20%20%20%20%20%20%20%22failure%20of%20a%20very%20popular%20artefact%20on%20the%20record%2C%20not%20to%20endorse%20it.%22%2C%0A%20%20%20%20fn%3D_ao_divergence%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%20_DIV_WINDOW%2C%20%22separation%22%3A%20_DIV_SEPARATION%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22fast%22%3A%20_AO_FAST%2C%20%22slow%22%3A%20_AO_SLOW%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%208.%20Acceleration%20by%20regression%20slope%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_linreg_acceleration%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%202%20%2A%20_LINREG%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20safe%20%3D%20np.where%28np.isfinite%28c%29%20%26%20%28c%20%3E%200%29%2C%20c%2C%20np.nan%29%0A%20%20%20%20with%20np.errstate%28invalid%3D%22ignore%22%2C%20divide%3D%22ignore%22%29%3A%0A%20%20%20%20%20%20%20%20log_c%20%3D%20np.log%28safe%29%0A%20%20%20%20if%20not%20np.isfinite%28log_c%29.any%28%29%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20slope%20%3D%20talib.LINEARREG_SLOPE%28_f%28log_c%29%2C%20_LINREG%29%0A%20%20%20%20delta%20%3D%20slope%20-%20_back%28slope%2C%20_LINREG%29%20%20%20%20%20%20%20%20%20%23%20change%20over%20a%20non-overlapping%20window%0A%20%20%20%20ok%20%3D%20np.isfinite%28slope%29%20%26%20np.isfinite%28delta%29%0A%20%20%20%20out%5Bok%20%26%20%28slope%20%3E%200%29%20%26%20%28delta%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28slope%20%3C%200%29%20%26%20%28delta%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.linreg_acceleration%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Steepening%20regression%20slope%2C%20immune%20to%20wicks%22%2C%0A%20%20%20%20rationale%3D%22The%20least-squares%20slope%20of%20twenty%20log%20prices%20uses%20all%20twenty%20observations%2C%20not%20just%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20endpoints%2C%20so%20a%20single%20cascading-liquidation%20wick%20%E2%80%94which%20is%20forced%20supply%2C%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22informed%20demand%E2%80%94%20does%20not%20dominate%20it.%20Its%20change%20over%20twenty%20candles%20measures%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whether%20the%20force%20sustaining%20the%20trend%20is%20growing%20or%20running%20out.%20The%20concrete%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hypothesis%20is%20that%20momentum%20measured%20with%20an%20estimator%20robust%20to%20liquidation%20noise%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22survives%20where%20momentum%20measured%20from%20endpoints%20does%20not.%22%2C%0A%20%20%20%20prior%3D%22It%20overlaps%20with%20roc_term_structure%20on%20purpose%20and%20is%20registered%20all%20the%20same%3A%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22linreg_acceleration%27s%20edge%20is%20materially%20LARGER%2C%20the%20difference%20is%20down%20to%20the%20noise%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22wicks%20and%20liquidations%20and%20not%20to%20the%20concept%20of%20acceleration%3B%20if%20the%20two%20are%20%22%0A%20%20%20%20%20%20%20%20%20%20%22indistinguishable%2C%20the%20robust%20estimator%20buys%20nothing%20in%20BTC.%20We%20expect%20a%20small%20%22%0A%20%20%20%20%20%20%20%20%20%20%22difference.%20It%20is%20falsified%20if%20neither%20version%20has%20an%20edge%2C%20and%20we%20expect%20both%20to%20fail%20%22%0A%20%20%20%20%20%20%20%20%20%20%22at%20trend%20restarts%20after%20capitulation%2C%20where%20the%20slope%20is%20still%20negative%20once%20the%20bottom%20%22%0A%20%20%20%20%20%20%20%20%20%20%22is%20already%20in.%22%2C%0A%20%20%20%20fn%3D_linreg_acceleration%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%20_LINREG%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%209.%20Persistence%20of%20the%20sign%20of%20the%20return%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_sign_persistence%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_PERSIST_WINDOW%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20r%20%3D%20np.diff%28c%2C%20prepend%3Dnp.nan%29%0A%20%20%20%20up%20%3D%20%28r%20%3E%200%29.astype%28np.float64%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20NaN%20-%3E%20False%20-%3E%200.0%2C%20no%20invented%20signal%0A%20%20%20%20down%20%3D%20%28r%20%3C%200%29.astype%28np.float64%29%0A%20%20%20%20n_up%20%3D%20talib.SUM%28_f%28up%29%2C%20_PERSIST_WINDOW%29%0A%20%20%20%20n_down%20%3D%20talib.SUM%28_f%28down%29%2C%20_PERSIST_WINDOW%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28n_up%29%20%26%20np.isfinite%28n_down%29%0A%20%20%20%20out%5Bok%20%26%20%28n_up%20%3E%3D%20_PERSIST_HIGH%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28n_down%20%3E%3D%20_PERSIST_HIGH%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.sign_persistence%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Counting%20green%20candles%2C%20ignoring%20their%20size%22%2C%0A%20%20%20%20rationale%3D%22It%20counts%20how%20many%20of%20the%20last%20twenty%20candles%20closed%20up%20and%20discards%20magnitude%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entirely.%20The%20reason%20is%20that%20the%20two%20mechanisms%20leave%20different%20footprints%3A%20herding%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20systematic%20following%20produce%20a%20succession%20of%20small%2C%20repeated%20purchases%20%E2%80%94drift%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22with%20many%20candles%20of%20the%20same%20sign%E2%80%94%20whereas%20a%20headline%20or%20a%20liquidation%20produces%20an%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22enormous%20magnitude%20in%20a%20single%20candle%20and%20no%20persistence%20at%20all.%20Separating%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22frequency%20from%20size%20is%20exactly%20what%20this%20hypothesis%20tests%2C%20and%20it%20makes%20it%20immune%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22BTC%27s%20fat%20tails%20into%20the%20bargain.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20SMALLER%20than%20roc10%27s%20but%20more%20stable%20across%20regimes%2C%20it%20being%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20count%20statistic.%20We%20expect%20it%20to%20fail%20explicitly%20in%20stretches%20of%20slow%20bullish%20drift%20%22%0A%20%20%20%20%20%20%20%20%20%20%22followed%20by%20vertical%20falls%20%28the%20second%20half%20of%202021%29%3A%20there%20the%20frequency%20of%20green%20%22%0A%20%20%20%20%20%20%20%20%20%20%22candles%20is%20high%20and%20the%20cumulative%20return%20negative%2C%20and%20the%20signal%20will%20be%20long%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22whole%20way.%20It%20is%20falsified%20if%20the%20count%20of%20signs%20separates%20future%20returns%20on%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%22timeframe.%22%2C%0A%20%20%20%20fn%3D_sign_persistence%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%20_PERSIST_WINDOW%2C%20%22threshold%22%3A%20_PERSIST_HIGH%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2010.%20Momentum%20filtered%20by%20Kaufman%27s%20efficiency%20ratio%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_er_filtered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ER_PERIOD%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20net%20%3D%20c%20-%20_back%28c%2C%20_ER_PERIOD%29%0A%20%20%20%20path%20%3D%20talib.SUM%28_f%28np.abs%28np.diff%28c%2C%20prepend%3Dnp.nan%29%29%29%2C%20_ER_PERIOD%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28net%29%20%26%20np.isfinite%28path%29%20%26%20%28path%20%3E%200%29%0A%20%20%20%20er%20%3D%20np.full%28c.size%2C%20np.nan%29%0A%20%20%20%20er%5Bok%5D%20%3D%20np.abs%28net%5Bok%5D%29%20%2F%20path%5Bok%5D%0A%20%20%20%20efficient%20%3D%20np.isfinite%28er%29%20%26%20%28er%20%3E%3D%20_ER_THRESHOLD%29%0A%20%20%20%20out%5Befficient%20%26%20%28net%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Befficient%20%26%20%28net%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.er_kaufman_filtered%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Momentum%20only%20when%20the%20path%20is%20straight%22%2C%0A%20%20%20%20rationale%3D%22The%20efficiency%20ratio%20divides%20the%20net%20displacement%20by%20the%20total%20path%20travelled%2C%20so%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20high%20when%20the%20price%20goes%20from%20A%20to%20B%20in%20almost%20a%20straight%20line.%20A%20straight%20path%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20the%20signature%20of%20a%20sustained%20imbalance%20of%20the%20book%20%E2%80%94somebody%20large%20executing%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20direction%20for%20days%E2%80%94%20and%20a%20zigzag%20path%20is%20the%20signature%20of%20buyers%20and%20sellers%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22alternating%20against%20a%20liquidity%20provider.%20The%20hypothesis%20is%20that%20momentum%20only%20pays%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20the%20first%20case%2C%20because%20in%20the%20second%20the%20one%20chasing%20the%20trend%20buys%20expensively%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22from%20the%20one%20providing%20it%20and%20pays%20the%20spread%20over%20and%20over.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20edge%20conditioned%20on%20ER%E2%89%A50.30%20to%20be%20clearly%20superior%20to%20roc10%27s%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22filter%20to%20greatly%20reduce%20the%20number%20of%20bars%20in%20position.%20It%20is%20falsified%20if%20the%20filtered%20%22%0A%20%20%20%20%20%20%20%20%20%20%22edge%20does%20NOT%20beat%20roc10%27s%3A%20that%20would%20mean%20the%20straightness%20of%20the%20path%20says%20nothing%20%22%0A%20%20%20%20%20%20%20%20%20%20%22about%20future%20persistence%2C%20which%20is%20precisely%20the%20postulated%20mechanism.%20The%200.30%20%22%0A%20%20%20%20%20%20%20%20%20%20%22threshold%20is%20fixed%20a%20priori%3B%20if%20it%20fails%2C%20no%20other%20threshold%20is%20tried%2C%20the%20hypothesis%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22taken%20as%20refuted.%22%2C%0A%20%20%20%20fn%3D_er_filtered%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%20_ER_PERIOD%2C%20%22threshold%22%3A%20_ER_THRESHOLD%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2011.%20KAMA%20crossover%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_kama_cross%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_KAMA_ER%20%2B%2032%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20kama%20%3D%20talib.KAMA%28c%2C%20_KAMA_ER%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28kama%29%20%26%20np.isfinite%28c%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20kama%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20kama%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.kama_cross%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Above%20a%20KAMA%20that%20flattens%20in%20chop%22%2C%0A%20%20%20%20rationale%3D%22The%20KAMA%20uses%20the%20same%20efficiency%20ratio%20to%20interpolate%20between%20a%202-period%20average%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20a%2030-period%20one%3A%20it%20sticks%20to%20the%20price%20when%20the%20path%20is%20efficient%20and%20flattens%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22out%20when%20it%20is%20noisy.%20The%20participant%20this%20is%20meant%20to%20avoid%20being%20is%20a%20specific%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%3A%20the%20trend%20follower%20who%20buys%20every%20false%20break%20in%20a%20range%20and%20hands%20the%20spread%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20the%20market%20maker%20candle%20after%20candle.%20Against%20er_kaufman_filtered%2C%20which%20decides%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whether%20to%20trade%20at%20all%2C%20here%20efficiency%20decides%20the%20SPEED%20of%20the%20filter%20and%20never%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22stops%20having%20an%20opinion.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20fewer%20signal%20changes%20and%20a%20better%20edge%20per%20bar%20than%20a%20fixed-average%20crossover%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20we%20expect%20it%20to%20fail%20at%20the%20start%20of%20explosive%20trends%2C%20where%20the%20adaptation%20lags%20%22%0A%20%20%20%20%20%20%20%20%20%20%22behind%20and%20it%20enters%20late.%20It%20is%20falsified%20if%20its%20edge%20does%20not%20beat%20that%20of%20the%20fixed%20%22%0A%20%20%20%20%20%20%20%20%20%20%22EMA%20crossover%20from%20the%20trend%20family%3A%20in%20that%20case%20adapting%20the%20speed%20buys%20nothing%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22only%20adds%20a%20moving%20part.%22%2C%0A%20%20%20%20fn%3D_kama_cross%2C%0A%20%20%20%20params%3D%7B%22er_period%22%3A%20_KAMA_ER%2C%20%22fast%22%3A%202%2C%20%22slow%22%3A%2030%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2012.%20Momentum%20confirmed%20by%20participation%0A%23%20--------------------------------------------------------------------------------------------%0Adef%20_momentum_with_volume%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ROC_LONG%20%2B%20_VOL_LONG%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20v%20%3D%20_f%28s.volume%29%0A%20%20%20%20if%20not%20np.isfinite%28v%29.any%28%29%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%20_ROC_LONG%29%0A%20%20%20%20v_short%20%3D%20talib.SMA%28v%2C%20_VOL_SHORT%29%0A%20%20%20%20v_long%20%3D%20talib.SMA%28v%2C%20_VOL_LONG%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28roc%29%20%26%20np.isfinite%28v_short%29%20%26%20np.isfinite%28v_long%29%20%26%20%28v_long%20%3E%200%29%0A%20%20%20%20participating%20%3D%20ok%20%26%20%28v_short%20%3E%20v_long%29%0A%20%20%20%20out%5Bparticipating%20%26%20%28roc%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bparticipating%20%26%20%28roc%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22momentum.momentum_with_volume%22%2C%0A%20%20%20%20family%3D%22momentum%22%2C%0A%20%20%20%20title%3D%22Twenty-bar%20momentum%20backed%20by%20rising%20volume%22%2C%0A%20%20%20%20rationale%3D%22The%20herd%20leaves%20its%20footprint%20in%20the%20volume%3A%20a%20leg%20with%20growing%20participation%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22implies%20new%20money%20coming%20in%2C%20whereas%20one%20with%20falling%20volume%20is%20the%20same%20capital%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rotating%20among%20those%20already%20inside%2C%20and%20that%20one%20runs%20out%20on%20its%20own.%20We%20require%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%205-candle%20volume%20average%20to%20exceed%20the%2020-candle%20one%20at%20the%20same%20time%20as%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2220-candle%20return%20has%20a%20definite%20sign%2C%20so%20that%20the%20signal%20is%20only%20active%20when%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22direction%20and%20participation%20coincide.%20The%20two%20volume%20windows%20are%20not%20two%20variants%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20parameter%3A%20both%20are%20needed%20to%20define%20%27growing%27%2C%20and%20they%20are%20the%20conventional%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22relative-volume%20pair.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20an%20edge%20superior%20to%20the%20plain%20ROC%27s%20only%20on%201d%20and%204h%2C%20and%20FAILURE%20on%201h%20%22%0A%20%20%20%20%20%20%20%20%20%20%22because%20of%20the%20intraday%20seasonality%20of%20volume%20%28the%20Asian%20and%20US%20sessions%29%2C%20which%20fires%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20filter%20by%20hour%20of%20day%20and%20not%20by%20conviction.%20This%20is%20also%20the%20first%20hypothesis%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20family%20that%20ought%20to%20break%20if%20the%20data%20comes%20from%20an%20exchange%20with%20inflated%20or%20%22%0A%20%20%20%20%20%20%20%20%20%20%22washed%20volume.%20It%20is%20falsified%20if%20the%20volume%20filter%20does%20not%20improve%20on%20the%20unfiltered%20%22%0A%20%20%20%20%20%20%20%20%20%20%2220-bar%20ROC.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22AUDIT%20NOTE%20%282026-09-08%29%3A%20that%20control%20%E2%80%94the%20unfiltered%2020-bar%20ROC%E2%80%94%20was%20not%20registered%20%22%0A%20%20%20%20%20%20%20%20%20%20%22anywhere%2C%20so%20the%20falsification%20criterion%20above%20could%20not%20be%20executed%3B%20it%20has%20been%20%22%0A%20%20%20%20%20%20%20%20%20%20%22registered%20as%20%60flow.roc20_unfiltered%60%20and%20that%20is%20what%20this%20hypothesis%20must%20be%20measured%20%22%0A%20%20%20%20%20%20%20%20%20%20%22against.%20It%20is%20further%20declared%20that%20%60flow.trend_with_participation%60%20is%20the%20same%20%22%0A%20%20%20%20%20%20%20%20%20%20%22construction%20%28ROC-20%20conditioned%20on%20an%20expansion%20of%20volume%29%20with%20a%20different%20pair%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22volume%20averages%2C%20and%20that%20the%20two%20are%20dependent%20trials%20even%20though%20they%20share%20few%20%22%0A%20%20%20%20%20%20%20%20%20%20%22signals.%22%2C%0A%20%20%20%20fn%3D_momentum_with_volume%2C%0A%20%20%20%20params%3D%7B%22roc%22%3A%20_ROC_LONG%2C%20%22volume_short%22%3A%20_VOL_SHORT%2C%20%22volume_long%22%3A%20_VOL_LONG%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=3482fbc55f8bba99956430c0c6c1ef413cbf335e74e6b7d5a60ea7d40d370d20\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":14,"row_hash":"fc8e5dac5f05b960b2b8345913210d934104625b795a50b3cad6da7961edd372","body":"wavelab-journal-chain\nv=3\nseq=14\nprev=59eaa17fe96ba3f0294ccbf1ddb023b532f923a63375f1fc8647655b75317b68\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fseasonality.py\nprereg_seq=2\nsource_text=%22%22%22SEASONALITY%20family%3A%20the%20clock%20and%20the%20calendar%20as%20an%20explanatory%20variable.%0A%0AThe%20thesis%20common%20to%20the%20whole%20family%20is%20a%20single%20one%3A%20%2A%2Aliquidity%20and%20participation%20are%20not%0Auniform%20in%20time%2A%2A.%20There%20are%20hours%20in%20which%20the%20book%20is%20held%20up%20by%20American%20desks%20and%20hours%20in%0Awhich%20it%20is%20held%20up%20by%20leveraged%20retail%20flow%3B%20there%20are%20days%20on%20which%20the%20fiat%20rails%20are%20open%20and%0Adays%20on%20which%20they%20are%20not%3B%20there%20are%20dates%20on%20which%20open%20interest%20expires%20and%20dates%20on%20which%20it%20is%0Arebuilt.%20If%20BTC%27s%20return%20depended%20on%20information%20alone%2C%20the%20clock%20would%20be%20irrelevant.%20If%20it%20also%0Adepends%20on%20WHO%20can%20trade%20at%20each%20moment%2C%20it%20is%20not.%0A%0AIt%20is%20also%20the%20family%20most%20prone%20to%20spurious%20findings%2C%20and%20it%20is%20worth%20saying%20why%20before%20looking%20at%0Aanything%3A%20the%20calendar%20offers%20an%20enormous%20number%20of%20partitions%20%2824%20hours%2C%207%20days%2C%2031%20days%20of%20the%0Amonth%2C%204%20quarters%2C%20cycle%20phases%29%20and%20almost%20all%20of%20them%20are%20free%20to%20test.%20With%20enough%20cuts%2C%20one%0Aalways%20comes%20out%20%22significant%22.%20The%20defences%20adopted%20here%2C%20all%20of%20them%20BEFORE%20running%20anything%3A%0A%0A1.%20%2A%2ANo%20window%20is%20chosen%20for%20its%20performance.%2A%2A%20Each%20one%20is%20anchored%20to%20an%20exogenous%2C%20verifiable%0A%20%20%20institutional%20fact%20%28the%20US%20cash%20open%2C%20the%20Tokyo%20session%2C%20the%20CME%20weekly%20close%2C%20the%20perpetual%0A%20%20%20funding%20stamp%2C%20Deribit%20expiry%2C%20the%20halving%29.%20If%20the%20anchor%20exists%20off%20the%20chart%2C%20the%20window%20is%0A%20%20%20not%20a%20degree%20of%20freedom.%0A2.%20%2A%2AEvery%20hypothesis%20declares%20how%20it%20expects%20to%20fail%2A%2A%2C%20and%20in%20several%20cases%20the%20falsification%0A%20%20%20criterion%20is%20stricter%20than%20%22makes%20money%22%3A%20if%20the%20same%20effect%20shows%20up%20in%20equivalent%20control%0A%20%20%20windows%2C%20the%20%2Aseasonal%2A%20claim%20is%20false%20even%20if%20the%20P%26L%20is%20positive.%0A3.%20%2A%2AThese%20hypotheses%20are%20NOT%20independent%20trials.%2A%2A%20Several%20of%20them%20share%20candles%20%28turn%20of%20month%0A%20%20%20with%20monthly%20expiry%3B%20the%20weekend%20with%20Friday%20evening%3B%20US%20hours%20with%20Asian%20hours%2C%20which%20are%0A%20%20%20nearly%20complementary%29.%20A%20Bonferroni%20correction%20over%2011%20trials%20is%20conservative%20here%2C%20and%20a%0A%20%20%20correction%20that%20assumes%20independence%20is%20simply%20wrong%3A%20whoever%20runs%20the%20test%20should%20use%20FDR%20under%0A%20%20%20dependence%2C%20or%20correlate%20the%20signal%20series%20before%20deciding%20the%20effective%20number%20of%20trials.%20It%20is%0A%20%20%20written%20down%20so%20that%20it%20is%20not%20decided%20afterwards.%0A4.%20%2A%2AUnconditional%20drift.%2A%2A%20BTC%20rises%20over%20the%20sample.%20Any%20predominantly%20long%20hypothesis%20will%0A%20%20%20inherit%20that%20drift.%20None%20of%20the%20ones%20in%20this%20family%20can%20be%20considered%20confirmed%20by%20its%20absolute%0A%20%20%20expectation%3A%20only%20the%20delta%20against%20the%20null%20arm%20%28random%20entries%20with%20the%20same%20exposure%29%20counts%2C%0A%20%20%20which%20is%20exactly%20what%20the%20backtest%20harness%20already%20computes.%0A%0A--------------------------------------------------------------------------------------------------%0AASSUMED%20CONVENTIONS%20%28declared%20here%20so%20that%20the%20result%20is%20interpretable%2C%20and%20so%20that%20if%20the%20harness%0Auses%20a%20different%20convention%20it%20is%20known%20exactly%20what%20has%20to%20be%20reinterpreted%29%0A%0A%2A%20%20%20%60%60s.ts%60%60%20is%20the%20OPEN%20timestamp%20of%20the%20candle%20in%20ms%20epoch%20UTC%2C%20aligned%20to%20the%20timeframe%20grid.%20It%0A%20%20%20%20is%20the%20project%20convention%3A%20%60%60resample_from_1m%60%60%20indexes%20by%20%60%60open_time_ms%60%60%20and%0A%20%20%20%20%60%60Bar.__post_init__%60%60%20requires%20%60%60open_time_ms%20%25%20tf.ms%20%3D%3D%200%60%60.%0A%0A%2A%20%20%20The%20signal%20on%20candle%20%60%60i%60%60%20is%20decided%20with%20information%20up%20to%20the%20close%20of%20%60%60i%60%60%20and%20the%0A%20%20%20%20position%20is%20held%20through%20candle%20%60%60i%2B1%60%60.%20That%20is%20why%20the%20hourly%20windows%20are%20evaluated%20over%0A%20%20%20%20%60%60ts%20%2B%20timeframe_duration%60%60%3A%20the%20hour%20that%20matters%20is%20that%20of%20the%20candle%20that%20will%20be%20HELD%2C%20not%0A%20%20%20%20that%20of%20the%20one%20that%20has%20just%20closed.%0A%0A%20%20%20%20This%20is%20%2A%2Anot%2A%2A%20looking%20into%20the%20future.%20Not%20one%20datum%20from%20candle%20%60%60i%2B1%60%60%20is%20read%3A%20all%20that%20is%0A%20%20%20%20computed%20is%20what%20the%20clock%20will%20read%2C%20which%20is%20information%20known%20since%201970%20and%20available%20to%0A%20%20%20%20any%20participant%20at%20any%20earlier%20instant.%20The%20same%20argument%20holds%20for%20the%20calendar%20%28when%20the%20last%0A%20%20%20%20Friday%20of%20March%202019%20falls%20was%20known%20in%202018%29%20and%20for%20the%20halving%20dates%2C%20of%20which%20only%20those%0A%20%20%20%20already%20past%20relative%20to%20the%20candle%20being%20evaluated%20are%20used.%0A%0A%20%20%20%20If%20the%20harness%20instead%20applied%20signal%20%60%60i%60%60%20to%20the%20return%20of%20candle%20%60%60i%60%60%20itself%2C%20ALL%20the%0A%20%20%20%20hypotheses%20in%20this%20file%20would%20be%20displaced%20one%20candle%20backwards%20and%20would%20have%20to%20be%20read%20as%0A%20%20%20%20windows%20brought%20forward%20by%20one%20period.%20It%20is%20declared%20now%2C%20not%20after%20seeing%20the%20numbers.%0A%0A%2A%20%20%20The%20time-of-day%20hypotheses%20are%20registered%20only%20on%20%60%6015m%60%60%20and%20%60%601h%60%60%2C%20where%20the%20open%20and%20the%0A%20%20%20%20close%20of%20the%20candle%20fall%20in%20the%20same%20UTC%20hour%20and%20the%20assignment%20is%20unambiguous.%20On%20%60%604h%60%60%20a%0A%20%20%20%20single%20candle%20spans%20four%20different%20hours%20and%20%22the%20candle%27s%20hour%22%20means%20nothing%3B%20registering%0A%20%20%20%20them%20there%20would%20be%20manufacturing%20an%20ambiguity%20and%20then%20blaming%20it%20on%20the%20market.%0A%0A%2A%20%20%20Daylight%20saving%20time%20%28DST%29%20shifts%20the%20American%20anchors%20%28the%20cash%20open%2C%20the%20CME%20weekly%20close%29%20by%0A%20%20%20%20one%20hour%20for%20part%20of%20the%20year.%20That%20%C2%B11h%20is%20accepted%20instead%20of%20introducing%20a%20DST%20calendar%3A%20the%0A%20%20%20%20windows%20are%20chosen%20wide%20enough%20to%20contain%20the%20anchor%20under%20both%20regimes.%20It%20is%20a%20declared%0A%20%20%20%20imprecision%2C%20not%20a%20tunable%20parameter.%0A%0ACAUSALITY.%20Every%20function%20in%20this%20module%20uses%20exclusively%20data%20up%20to%20and%20including%20%60%60i%60%60.%20The%0Aforward%20fill%20of%20past%20references%20%28the%20day%27s%20open%2C%20Friday%27s%20close%29%20is%20done%20with%0A%60%60np.maximum.accumulate%60%60%20over%20indices%2C%20which%20is%20a%20prefix%20operation%3A%20the%20value%20at%20%60%60i%60%60%20can%20only%0Acome%20from%20an%20index%20%60%60%3C%3D%20i%60%60.%20There%20are%20no%20negative%20%60%60shift%60%60s%2C%20no%20%60%60np.roll%60%60%2C%20and%20no%20extreme%0Adetection%20defined%20against%20the%20whole%20array.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A_MS_HOUR%20%3D%203_600_000%0A_MS_DAY%20%3D%2086_400_000%0A%0A%23%3A%20Duration%20of%20each%20timeframe.%20Static%20metadata%20%28the%20clock%20grid%29%2C%20not%20market%20data.%0A_TF_MS%3A%20dict%5Bstr%2C%20int%5D%20%3D%20%7B%0A%20%20%20%20%221m%22%3A%2060_000%2C%20%223m%22%3A%20180_000%2C%20%225m%22%3A%20300_000%2C%20%2215m%22%3A%20900_000%2C%20%2230m%22%3A%201_800_000%2C%0A%20%20%20%20%221h%22%3A%203_600_000%2C%20%222h%22%3A%207_200_000%2C%20%224h%22%3A%2014_400_000%2C%20%226h%22%3A%2021_600_000%2C%0A%20%20%20%20%228h%22%3A%2028_800_000%2C%20%2212h%22%3A%2043_200_000%2C%20%221d%22%3A%2086_400_000%2C%20%223d%22%3A%20259_200_000%2C%0A%20%20%20%20%221w%22%3A%20604_800_000%2C%0A%7D%0A%0A%23%3A%20Halvings%20that%20have%20already%20happened%2C%20in%20ms%20epoch%20UTC.%20Only%20the%20LAST%20ONE%20BEFORE%20each%20candle%20is%0A%23%3A%20ever%20used%3A%20a%20date%20later%20than%20the%20candle%20being%20evaluated%20is%20never%20consulted%2C%20so%20the%20table%0A%23%3A%20introduces%20no%20lookahead.%0A_HALVINGS_MS%3A%20np.ndarray%20%3D%20np.array%28%0A%20%20%20%20%5B%0A%20%20%20%20%20%20%20%20np.datetime64%28%222012-11-28T15%3A24%22%2C%20%22ms%22%29%2C%20%20%23%20block%20210%2C000%0A%20%20%20%20%20%20%20%20np.datetime64%28%222016-07-09T16%3A46%22%2C%20%22ms%22%29%2C%20%20%23%20block%20420%2C000%0A%20%20%20%20%20%20%20%20np.datetime64%28%222020-05-11T19%3A23%22%2C%20%22ms%22%29%2C%20%20%23%20block%20630%2C000%0A%20%20%20%20%20%20%20%20np.datetime64%28%222024-04-20T00%3A09%22%2C%20%22ms%22%29%2C%20%20%23%20block%20840%2C000%0A%20%20%20%20%5D%2C%0A%20%20%20%20dtype%3D%22datetime64%5Bms%5D%22%2C%0A%29.astype%28np.int64%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%20Clock%20and%20calendar%20utilities.%20All%20of%20them%20return%20arrays%20aligned%20with%20the%20series.%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_hold_ts%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Timestamp%20of%20the%20candle%20DURING%20which%20the%20position%20decided%20at%20%60%60i%60%60%20will%20be%20open.%0A%0A%20%20%20%20It%20is%20%60%60ts%5Bi%5D%20%2B%20duration%60%60%3A%20clock%20arithmetic%2C%20not%20a%20read%20of%20future%20data%20%28see%20the%20module%0A%20%20%20%20docstring%29.%20The%20fallback%20that%20differences%20timestamps%20only%20kicks%20in%20if%20a%20timeframe%20turns%20up%0A%20%20%20%20that%20is%20not%20in%20the%20table%2C%20and%20it%20is%20still%20calendar%20information.%0A%20%20%20%20%22%22%22%0A%20%20%20%20ts%20%3D%20np.asarray%28s.ts%2C%20dtype%3Dnp.int64%29%0A%20%20%20%20step%20%3D%20_TF_MS.get%28s.tf%29%0A%20%20%20%20if%20step%20is%20None%3A%0A%20%20%20%20%20%20%20%20step%20%3D%20int%28ts%5B1%5D%20-%20ts%5B0%5D%29%20if%20ts.size%20%3E%201%20else%200%0A%20%20%20%20return%20ts%20%2B%20step%0A%0A%0Adef%20_hour_utc%28t%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22UTC%20hour%20%280-23%29.%22%22%22%0A%20%20%20%20return%20%28%28t%20%2F%2F%20_MS_HOUR%29%20%25%2024%29.astype%28np.int64%29%0A%0A%0Adef%20_weekday%28t%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Day%20of%20the%20week%20using%20Python%27s%20convention%3A%200%20%3D%20Monday%20%E2%80%A6%206%20%3D%20Sunday.%0A%0A%20%20%20%201970-01-01%20%28epoch%20day%200%29%20was%20a%20Thursday%2C%20which%20is%203%20in%20this%20convention%3B%20hence%20the%20offset.%0A%20%20%20%20%22%22%22%0A%20%20%20%20return%20%28%28%28t%20%2F%2F%20_MS_DAY%29%20%2B%203%29%20%25%207%29.astype%28np.int64%29%0A%0A%0Adef%20_date%28t%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22UTC%20date%20of%20each%20timestamp%2C%20as%20%60%60datetime64%5BD%5D%60%60.%22%22%22%0A%20%20%20%20return%20t.astype%28%22datetime64%5Bms%5D%22%29.astype%28%22datetime64%5BD%5D%22%29%0A%0A%0Adef%20_day_of_month%28dates%3A%20np.ndarray%29%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20%22%22%22Returns%20%28day%20of%20month%201..31%2C%20number%20of%20days%20that%20month%20has%29.%22%22%22%0A%20%20%20%20months%20%3D%20dates.astype%28%22datetime64%5BM%5D%22%29%0A%20%20%20%20dom%20%3D%20%28dates%20-%20months.astype%28%22datetime64%5BD%5D%22%29%29.astype%28np.int64%29%20%2B%201%0A%20%20%20%20length%20%3D%20%28%28months%20%2B%20np.timedelta64%281%2C%20%22M%22%29%29.astype%28%22datetime64%5BD%5D%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20-%20months.astype%28%22datetime64%5BD%5D%22%29%29.astype%28np.int64%29%0A%20%20%20%20return%20dom%2C%20length%0A%0A%0Adef%20_last_friday%28months%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Date%20of%20the%20last%20Friday%20of%20each%20%60%60datetime64%5BM%5D%60%60%20month.%0A%0A%20%20%20%20It%20is%20the%20Deribit%20expiry%20%2808%3A00%20UTC%29%20and%20the%20CME%20one.%20It%20is%20computed%20from%20the%20calendar%2C%20which%0A%20%20%20%20is%20exogenous%20and%20known%20years%20in%20advance.%0A%20%20%20%20%22%22%22%0A%20%20%20%20last%20%3D%20%28months%20%2B%20np.timedelta64%281%2C%20%22M%22%29%29.astype%28%22datetime64%5BD%5D%22%29%20-%20np.timedelta64%281%2C%20%22D%22%29%0A%20%20%20%20wd%20%3D%20%28last.astype%28np.int64%29%20%2B%203%29%20%25%207%20%20%20%20%20%20%20%20%20%20%20%20%23%200%20%3D%20Monday%2C%204%20%3D%20Friday%0A%20%20%20%20return%20last%20-%20%28%28wd%20-%204%29%20%25%207%29.astype%28%22timedelta64%5BD%5D%22%29%0A%0A%0Adef%20_ffill_idx%28flag%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Index%20of%20the%20last%20flagged%20position%20at%20%60%60%3C%3D%20i%60%60%2C%20or%20-1%20if%20there%20has%20not%20been%20one%20yet.%0A%0A%20%20%20%20%60%60np.maximum.accumulate%60%60%20is%20a%20PREFIX%20operation%3A%20the%20result%20at%20%60%60i%60%60%20cannot%20depend%20on%20any%20later%0A%20%20%20%20position.%20It%20is%20the%20piece%20that%20keeps%20every%20forward%20fill%20causal.%0A%20%20%20%20%22%22%22%0A%20%20%20%20n%20%3D%20flag.size%0A%20%20%20%20idx%20%3D%20np.where%28flag%2C%20np.arange%28n%2C%20dtype%3Dnp.int64%29%2C%20np.int64%28-1%29%29%0A%20%20%20%20return%20np.maximum.accumulate%28idx%29%0A%0A%0Adef%20_f64%28x%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22talib%20requires%20contiguous%20float64%3B%20a%20view%20of%20another%20dtype%20either%20raises%20or%20computes%0A%20%20%20%20garbage.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28x%2C%20dtype%3Dnp.float64%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%201.%20US%20cash-session%20hours%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_us_cash_hours%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20h%20%3D%20_hour_utc%28_hold_ts%28s%29%29%0A%20%20%20%20out%5B%28h%20%3E%3D%2013%29%20%26%20%28h%20%3C%3D%2020%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.us_cash_hours_long%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Long%20through%20the%20New%20York%20session%22%2C%0A%20%20%20%20rationale%3D%22Since%20the%20spot%20ETFs%20were%20approved%2C%20BTC%27s%20marginal%20buyer%20trades%20on%20New%20York%20hours%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22ETF%20creations%20and%20redemptions%20are%20struck%20against%20the%2016%3A00%20ET%20close%2C%20CME%20liquidity%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22concentrates%20in%20the%20US%20session%2C%20and%20the%20desks%20that%20arbitrage%20the%20spot-futures%20basis%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22only%20have%20staff%20in%20front%20of%20a%20screen%20during%20those%20hours.%20A%20recurring%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22institutional%2C%20price-insensitive%20buying%20flow%20concentrated%20in%20a%20fixed%20hourly%20window%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22has%20to%20leave%20a%20mark%20on%20the%20average%20return%20of%20those%20hours.%20For%20the%20rest%20of%20the%20day%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20book%20is%20held%20up%20by%20market%20makers%20who%20by%20definition%20have%20no%20direction.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20POSITIVE%20average%20drift%20on%20the%20candles%20held%20between%2013%3A00%20and%2021%3A00%20UTC%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22higher%20than%20that%20of%20the%20null%20arm%20at%20the%20same%20exposure.%20Falsifiable%20in%20two%20ways%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22both%20count%20as%20failure%3A%20%28a%29%20if%20the%20edge%20does%20not%20survive%20comparison%20with%20the%20null%20arm%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22all%20we%20are%20measuring%20is%20BTC%27s%20unconditional%20drift%20spread%20across%20the%20hours%3B%20%28b%29%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22proposed%20mechanism%20%28ETF%2FCME%20flow%29%20is%20recent%2C%20so%20we%20expect%20a%20weak%20or%20nil%20effect%20before%20%22%0A%20%20%20%20%20%20%20%20%20%20%222021%20and%20a%20sharper%20one%20from%20January%202024%20%E2%80%94%20if%20the%20effect%20turns%20out%20to%20be%20uniform%20across%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20whole%20sample%2C%20the%20mechanism%20we%20propose%20is%20NOT%20the%20one%20producing%20it%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hypothesis%20is%20wrongly%20explained%20even%20if%20it%20gets%20the%20sign%20right.%22%2C%0A%20%20%20%20fn%3D_us_cash_hours%2C%0A%20%20%20%20params%3D%7B%22start_hour_utc%22%3A%2013%2C%20%22end_hour_utc%22%3A%2020%2C%20%22anchor%22%3A%20%22US%20cash%20session%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%202.%20Asian%20hours%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_asia_hours%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20h%20%3D%20_hour_utc%28_hold_ts%28s%29%29%0A%20%20%20%20out%5B%28h%20%3E%3D%200%29%20%26%20%28h%20%3C%3D%207%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.asia_hours_short%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Short%20the%20thin%20Asian%20hours%22%2C%0A%20%20%20%20rationale%3D%22Between%2000%3A00%20and%2008%3A00%20UTC%20%2809%3A00-17%3A00%20in%20Tokyo%29%20the%20book%20is%20at%20its%20thinnest%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22European%20and%20American%20desks%20are%20not%20there%2C%20and%20what%20remains%20is%20mostly%20heavily%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22leveraged%20retail%20perpetual%20flow.%20With%20a%20thin%20book%20an%20order%20of%20the%20same%20size%20moves%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22price%20further%2C%20and%20that%20displacement%20is%20mechanical%2C%20not%20informative%2C%20so%20it%20tends%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22be%20given%20back%20once%20London%27s%20depth%20arrives.%20East%20Asian%20participation%20also%20contracted%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22after%20the%20Chinese%20ban%20of%202021%2C%20so%20the%20marginal%20flow%20in%20those%20hours%20looks%20more%20like%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22noise%20than%20like%20informed%20accumulation.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20drift%20of%20the%2000%3A00-08%3A00%20UTC%20hours%20to%20come%20out%20BELOW%20the%20unconditional%20%22%0A%20%20%20%20%20%20%20%20%20%20%22drift%20and%2C%20specifically%2C%20for%20a%20short%20in%20that%20window%20to%20have%20positive%20expectancy%20net%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22costs.%20It%20fails%20if%3A%20%28a%29%20the%20short%27s%20expectancy%20is%20negative%2C%20which%20is%20the%20default%20%22%0A%20%20%20%20%20%20%20%20%20%20%22outcome%20when%20shorting%20an%20asset%20with%20positive%20secular%20drift%3B%20%28b%29%20the%20result%20is%20an%20exact%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mirror%20of%20%60us_cash_hours_long%60%27s%20%E2%80%94%20the%20two%20windows%20are%20nearly%20complementary%2C%20so%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22their%20signal%20series%20are%20correlated%20near%20-1%20they%20are%20not%20two%20findings%20but%20one%2C%20and%20have%20%22%0A%20%20%20%20%20%20%20%20%20%20%22to%20be%20counted%20as%20ONE%20trial.%20We%20also%20expect%20the%20effect%20to%20be%20weaker%20before%202021%2C%20when%20%22%0A%20%20%20%20%20%20%20%20%20%20%22Asian%20participation%20was%20greater%20and%20its%20flow%20genuinely%20was%20informative.%22%2C%0A%20%20%20%20fn%3D_asia_hours%2C%0A%20%20%20%20params%3D%7B%22start_hour_utc%22%3A%200%2C%20%22end_hour_utc%22%3A%207%2C%20%22anchor%22%3A%20%22Tokyo%20session%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%203.%20London-New%20York%20overlap%3A%20continuation%20of%20the%20day%27s%20direction%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_overlap_continuation%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%0A%20%20%20%20ts%20%3D%20np.asarray%28s.ts%2C%20dtype%3Dnp.int64%29%0A%20%20%20%20close%20%3D%20np.asarray%28s.close%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20open_%20%3D%20np.asarray%28s.open%2C%20dtype%3Dnp.float64%29%0A%0A%20%20%20%20%23%20Open%20of%20the%20UTC%20day%20in%20progress%3A%20that%20of%20the%20day%27s%20first%20candle%2C%20forward-filled.%0A%20%20%20%20day%20%3D%20ts%20%2F%2F%20_MS_DAY%0A%20%20%20%20day_start%20%3D%20np.empty%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20day_start%5B0%5D%20%3D%20True%0A%20%20%20%20day_start%5B1%3A%5D%20%3D%20day%5B1%3A%5D%20%21%3D%20day%5B%3A-1%5D%0A%20%20%20%20idx%20%3D%20_ffill_idx%28day_start%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20day_start%5B0%5D%20is%20True%20%E2%87%92%20never%20left%20at%20-1%0A%20%20%20%20anchor%20%3D%20open_%5Bidx%5D%0A%0A%20%20%20%20h%20%3D%20_hour_utc%28_hold_ts%28s%29%29%0A%20%20%20%20window%20%3D%20%28h%20%3E%3D%2013%29%20%26%20%28h%20%3C%3D%2016%29%0A%0A%20%20%20%20move%20%3D%20close%20-%20anchor%0A%20%20%20%20valid%20%3D%20window%20%26%20~np.isnan%28move%29%0A%20%20%20%20out%5Bvalid%20%26%20%28move%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bvalid%20%26%20%28move%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.overlap_day_trend%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Follow%20the%20day%27s%20direction%20into%20the%20overlap%22%2C%0A%20%20%20%20rationale%3D%22The%20overlap%20of%20the%20London%20afternoon%20with%20the%20New%20York%20morning%20%2813%3A00-16%3A30%20UTC%29%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20only%20stretch%20in%20which%20European%20and%20American%20desks%20are%20present%20at%20the%20same%20time%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20therefore%20the%20one%20with%20the%20greatest%20aggregate%20depth%20of%20the%20day.%20A%20directional%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22intent%20formed%20during%20the%20thin%20hours%20cannot%20be%20executed%20in%20size%20until%20that%20depth%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22arrives%3A%20institutional%20slicing%20algorithms%20%28VWAP%2FTWAP%29%20do%20most%20of%20their%20work%20there.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20mechanism%20predicts%20continuation%2C%20not%20reversal%3A%20the%20direction%20accumulated%20since%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%2000%3A00%20UTC%20open%20should%20EXTEND%20itself%20in%20that%20window.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20positive%20expectancy%20from%20following%20the%20sign%20of%20the%20day%27s%20move%20so%20far%20during%20%22%0A%20%20%20%20%20%20%20%20%20%20%2213%3A00-17%3A00%20UTC.%20It%20fails%20if%20the%20expectancy%20is%20indistinguishable%20from%20zero%20or%20from%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22null%20arm%2C%20and%20we%20specifically%20expect%20it%20to%20fail%20in%20a%20low-volatility%20range%2C%20where%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%22orbits%20the%20day%27s%20open%20and%20the%20sign%20is%20a%20coin%20flip.%20Additional%20and%20decisive%20criterion%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22if%20the%20same%20day-sign%20following%20works%20just%20as%20well%20in%20any%20arbitrary%20four-hour%20control%20%22%0A%20%20%20%20%20%20%20%20%20%20%22window%2C%20then%20what%20we%20have%20is%20generic%20intraday%20momentum%20and%20the%20SEASONAL%20claim%20is%20false%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22whatever%20it%20earns.%22%2C%0A%20%20%20%20fn%3D_overlap_continuation%2C%0A%20%20%20%20params%3D%7B%22start_hour_utc%22%3A%2013%2C%20%22end_hour_utc%22%3A%2016%2C%20%22anchor%22%3A%20%22UTC%20day%20open%20%2800%3A00%29%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%204.%20Weekend%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_weekend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20wd%20%3D%20_weekday%28_hold_ts%28s%29%29%0A%20%20%20%20out%5Bwd%20%3E%3D%205%5D%20%3D%20-1%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20Saturday%20%285%29%20and%20Sunday%20%286%29%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.weekend_short%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Short%20the%20weekend%2C%20fiat%20rails%20closed%22%2C%0A%20%20%20%20rationale%3D%22At%20the%20weekend%20the%20fiat%20rails%20are%20closed%3A%20no%20bank%20transfers%2C%20no%20creation%20or%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22redemption%20of%20ETF%20shares%2C%20and%20the%20CME%20does%20not%20trade.%20What%20is%20left%20is%20the%2024%2F7%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22perpetual%20with%20market%20makers%20who%20trim%20inventory%20because%20they%20cannot%20hedge%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22regulated%20market%2C%20so%20the%20book%20thins%20out%20and%20spreads%20widen.%20The%20buying%20flow%20that%20has%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20calendar%20%28institutional%2C%20payroll%2C%20ETF%29%20disappears%20for%2048%20hours%2C%20while%20the%20forced%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22selling%20flow%20%E2%80%94%20leverage%20liquidations%20%E2%80%94%20never%20rests.%20The%20asymmetry%20between%20a%20buyer%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22who%20keeps%20office%20hours%20and%20an%20automatic%20seller%20is%20the%20mechanism.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20Saturday%20and%20Sunday%20drift%20to%20be%20less%20than%20or%20equal%20to%20zero%20and%20clearly%20below%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20of%20weekdays.%20It%20fails%20if%20the%20weekend%20shows%20positive%20drift%20comparable%20to%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22weekday%20one.%20We%20also%20expect%20the%20effect%20to%20have%20WEAKENED%20since%202021%2C%20when%20perpetuals%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22automated%20market%20making%20came%20to%20dominate%20volume%3A%20if%20it%20only%20shows%20up%20in%20the%202017-2020%20%22%0A%20%20%20%20%20%20%20%20%20%20%22subsample%2C%20it%20is%20a%20fossil%20of%20a%20market%20that%20no%20longer%20exists%20and%20we%20will%20declare%20it%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22such%20instead%20of%20selling%20it%20as%20a%20tradeable%20regularity.%22%2C%0A%20%20%20%20fn%3D_weekend%2C%0A%20%20%20%20params%3D%7B%22days%22%3A%20%22Saturday%20and%20Sunday%20UTC%22%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%205.%20Friday-evening%20de-risking%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_friday_evening%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20t%20%3D%20_hold_ts%28s%29%0A%20%20%20%20out%5B%28_weekday%28t%29%20%3D%3D%204%29%20%26%20%28_hour_utc%28t%29%20%3E%3D%2018%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.friday_derisk_short%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Short%20into%20the%20CME%20weekly%20close%22%2C%0A%20%20%20%20rationale%3D%22The%20CME%20weekly%20close%20%2821%3A00%20UTC%20in%20summer%20time%2C%2022%3A00%20in%20winter%29%20forces%20basis%20desks%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20flatten%20or%20roll%20whatever%20they%20cannot%20hold%20against%20a%20closed%20market%2C%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22leveraged%20longs%20paying%20funding%20trim%20before%20two%20days%20without%20fiat%20rails%20or%20regulated%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hedging.%20Both%20flows%20point%20the%20same%20way%20%E2%80%94%20sell%20%E2%80%94%20and%20concentrate%20in%20the%20last%20hours%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22of%20Friday.%20It%20is%20a%20different%20hypothesis%20from%20the%20weekend%20one%3A%20here%20the%20mechanism%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20flattening%20BEFORE%20the%20venue%20closes%2C%20not%20the%20thinness%20of%20the%20book%20DURING%20the%20two%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22following%20days.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20negative%20expectancy%20for%20a%20long%20%28positive%20for%20the%20short%29%20between%2018%3A00%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%2224%3A00%20UTC%20on%20Friday%2C%20smaller%20in%20magnitude%20than%20the%20weekend%20effect%20itself.%20It%20fails%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20expectancy%20is%20not%20negative%2C%20and%20also%20%E2%80%94%20this%20is%20the%20important%20part%20%E2%80%94%20if%20the%20same%20%22%0A%20%20%20%20%20%20%20%20%20%20%22negative%20drift%20shows%20up%20in%20hours%2018-24%20of%20the%20other%20weekdays%3A%20in%20that%20case%20it%20would%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20time-of-day%20effect%2C%20already%20covered%20by%20other%20hypotheses%20in%20this%20family%2C%20and%20not%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22Friday%20effect.%20The%20window%20is%20declared%20wide%20%28six%20hours%29%20on%20purpose%20so%20as%20to%20contain%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22CME%20close%20in%20both%20summer%20and%20winter%20time%20without%20having%20to%20choose.%22%2C%0A%20%20%20%20fn%3D_friday_evening%2C%0A%20%20%20%20params%3D%7B%22day%22%3A%20%22Friday%22%2C%20%22start_hour_utc%22%3A%2018%2C%20%22end_hour_utc%22%3A%2023%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22anchor%22%3A%20%22CME%20weekly%20close%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%206.%20CME%20gap%3A%20reversion%20towards%20Friday%27s%20close%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_cme_gap%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%0A%20%20%20%20ts%20%3D%20np.asarray%28s.ts%2C%20dtype%3Dnp.int64%29%0A%20%20%20%20close%20%3D%20np.asarray%28s.close%2C%20dtype%3Dnp.float64%29%0A%0A%20%20%20%20%23%20Reference%3A%20the%20close%20of%20the%20candle%20that%20OPENS%20on%20Friday%20at%2021%3A00%20UTC%20%28the%20last%20full%20hour%0A%20%20%20%20%23%20before%20the%20CME%20weekly%20close%29.%20It%20is%20flagged%20with%20the%20clock%20of%20the%20candle%20ITSELF%2C%0A%20%20%20%20%23%20not%20with%20that%20of%20the%20next%20one.%0A%20%20%20%20flag%20%3D%20%28_weekday%28ts%29%20%3D%3D%204%29%20%26%20%28_hour_utc%28ts%29%20%3D%3D%2021%29%0A%20%20%20%20idx%20%3D%20_ffill_idx%28flag%29%0A%20%20%20%20has_ref%20%3D%20idx%20%3E%3D%200%0A%20%20%20%20ref%20%3D%20close%5Bnp.clip%28idx%2C%200%2C%20None%29%5D%0A%0A%20%20%20%20%23%20Freshness%3A%20between%20Friday%2021%3A00%20and%20Monday%2012%3A00%20there%20are%20~63%20hours.%20If%20the%20last%20reference%0A%20%20%20%20%23%20is%20older%20than%20that%2C%20there%20was%20a%20data%20gap%20and%20the%20reference%20no%20longer%20describes%20this%20weekend.%0A%20%20%20%20fresh%20%3D%20%28np.arange%28n%2C%20dtype%3Dnp.int64%29%20-%20idx%29%20%3C%3D%2096%0A%0A%20%20%20%20t%20%3D%20_hold_ts%28s%29%0A%20%20%20%20wd%2C%20h%20%3D%20_weekday%28t%29%2C%20_hour_utc%28t%29%0A%20%20%20%20window%20%3D%20%28%28wd%20%3D%3D%206%29%20%26%20%28h%20%3E%3D%2022%29%29%20%7C%20%28%28wd%20%3D%3D%200%29%20%26%20%28h%20%3C%3D%2011%29%29%0A%0A%20%20%20%20atr%20%3D%20talib.ATR%28_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%2C%20timeperiod%3D14%29%0A%20%20%20%20atr_ok%20%3D%20~np.isnan%28atr%29%0A%0A%20%20%20%20gap%20%3D%20close%20-%20ref%0A%20%20%20%20valid%20%3D%20%28window%20%26%20has_ref%20%26%20fresh%20%26%20atr_ok%20%26%20~np.isnan%28gap%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%26%20%28np.abs%28gap%29%20%3E%20np.where%28atr_ok%2C%20atr%2C%20np.inf%29%29%29%0A%20%20%20%20out%5Bvalid%20%26%20%28gap%20%3E%200%29%5D%20%3D%20-1%20%20%20%23%20above%20Friday%27s%20close%20%E2%87%92%20the%20gap%20points%20down%0A%20%20%20%20out%5Bvalid%20%26%20%28gap%20%3C%200%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.cme_gap_monday%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20CME%20gap%20into%20Monday%22%2C%0A%20%20%20%20rationale%3D%22CME%20BTC%20futures%20stop%20trading%20on%20Friday%20afternoon%20and%20reopen%20on%20Sunday%20night%2C%20while%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22spot%20never%20stops%3A%20any%20weekend%20move%20opens%20a%20gap%20on%20the%20CME%20chart.%20On%20reopening%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22desks%20that%20arbitrage%20the%20basis%20have%20to%20rebuild%20the%20hedge%20between%20the%20two%20markets%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20that%20flow%20pulls%20spot%20towards%20the%20last%20price%20traded%20on%20the%20regulated%20venue.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22second%20ingredient%20is%20reflexive%20but%20real%3A%20the%20gap%20is%20a%20level%20the%20whole%20market%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22watching%2C%20and%20orders%20pile%20up%20where%20people%20are%20looking.%20We%20require%20the%20gap%20to%20exceed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20ATR%2814%29%20because%20below%20that%20there%20is%20no%20level%2C%20there%20is%20noise.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20slightly%20positive%20expectancy%20from%20fading%20the%20weekend%27s%20move%20%28short%20if%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%22is%20above%20Friday%27s%20close%2C%20long%20if%20it%20is%20below%29%20between%20the%20Sunday%20reopen%20and%20Monday%20%22%0A%20%20%20%20%20%20%20%20%20%20%22midday.%20It%20fails%20if%20the%20weekend%20move%20turns%20out%20to%20be%20informative%20rather%20than%20noise%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20is%2C%20if%20it%20continues%3B%20we%20expect%20exactly%20that%20failure%20in%20strong%20trends%20and%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%22weekends%20with%20macro%20news%20or%20counterparty%20failures.%20The%20direction%20of%20the%20failure%20is%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22informative%20as%20success%3A%20if%20it%20loses%20systematically%2C%20what%20we%20have%20learned%20is%20that%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22weekend%20DOES%20move%20information.%22%2C%0A%20%20%20%20fn%3D_cme_gap%2C%0A%20%20%20%20params%3D%7B%22atr%22%3A%2014%2C%20%22threshold_in_atr%22%3A%201.0%2C%20%22anchor%22%3A%20%22Friday%2021%3A00%20UTC%20close%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22window%22%3A%20%22Sunday%2022%3A00%20UTC%20-%20Monday%2012%3A00%20UTC%22%2C%20%22max_staleness_bars%22%3A%2096%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%207.%20The%20hour%20before%20the%20funding%20stamp%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_pre_funding%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%0A%20%20%20%20roc%20%3D%20talib.ROC%28_f64%28s.close%29%2C%20timeperiod%3D8%29%20%20%20%20%20%20%23%20return%20over%20the%20funding%20window%20%288%20h%29%0A%20%20%20%20finite%20%3D%20~np.isnan%28roc%29%0A%0A%20%20%20%20h%20%3D%20_hour_utc%28_hold_ts%28s%29%29%0A%20%20%20%20window%20%3D%20%28h%20%3D%3D%207%29%20%7C%20%28h%20%3D%3D%2015%29%20%7C%20%28h%20%3D%3D%2023%29%0A%0A%20%20%20%20valid%20%3D%20window%20%26%20finite%0A%20%20%20%20out%5Bvalid%20%26%20%28roc%20%3E%200%29%5D%20%3D%20-1%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20fade%20the%20window%27s%20move%0A%20%20%20%20out%5Bvalid%20%26%20%28roc%20%3C%200%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.pre_funding_fade%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20move%20before%20the%20funding%20stamp%22%2C%0A%20%20%20%20rationale%3D%22Binance%20and%20the%20other%20perpetual%20venues%20settle%20funding%20at%2000%3A00%2C%2008%3A00%20and%2016%3A00%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22UTC.%20When%20the%20eight-hour%20window%20has%20been%20very%20directional%2C%20the%20crowded%20side%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20that%20pays%2C%20and%20part%20of%20that%20side%20closes%20in%20the%20hour%20before%20the%20stamp%20precisely%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22so%20as%20not%20to%20pay%20it%3B%20symmetrically%2C%20the%20market%20maker%20who%20has%20spent%20eight%20hours%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22accumulating%20the%20opposite%20inventory%20reduces%20it%20before%20the%20cut-off.%20Both%20flows%20push%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22against%20the%20window%27s%20move%20and%20concentrate%20in%20that%20one%20specific%20hour.%20The%208-hour%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22period%20is%20not%20a%20chosen%20parameter%3A%20it%20is%20the%20length%20of%20the%20funding%20interval.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20NEGATIVE%20autocorrelation%20%28fading%29%20in%20hours%2007%2C%2015%20and%2023%20UTC%2C%20and%20not%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22other%20twenty-one.%20The%20falsification%20criterion%20is%20harder%20than%20profitability%20and%20it%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20whole%20reason%20the%20hypothesis%20exists%3A%20if%20the%20same%20fade%20of%20the%208-candle%20ROC%20works%20just%20%22%0A%20%20%20%20%20%20%20%20%20%20%22as%20well%20in%20the%20remaining%20hours%2C%20what%20we%20have%20is%20generic%20mean%20reversion%20and%20the%20seasonal%20%22%0A%20%20%20%20%20%20%20%20%20%20%22claim%20is%20FALSE%20even%20if%20the%20P%26L%20is%20positive.%20We%20also%20expect%20it%20to%20fail%20in%20a%20sustained%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trend%2C%20where%20the%20crowded%20side%20is%20also%20the%20right%20side%20and%20whoever%20is%20paying%20funding%20%22%0A%20%20%20%20%20%20%20%20%20%20%22keeps%20on%20winning.%22%2C%0A%20%20%20%20fn%3D_pre_funding%2C%0A%20%20%20%20params%3D%7B%22funding_window_h%22%3A%208%2C%20%22pre_stamp_hours_utc%22%3A%20%287%2C%2015%2C%2023%29%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%208.%20Turn%20of%20the%20month%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_turn_of_month%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20dates%20%3D%20_date%28_hold_ts%28s%29%29%0A%20%20%20%20dom%2C%20length%20%3D%20_day_of_month%28dates%29%0A%20%20%20%20out%5B%28dom%20%3C%3D%203%29%20%7C%20%28dom%20%3D%3D%20length%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.turn_of_month_long%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Long%20the%20last%20day%20of%20the%20month%20and%20the%20first%20three%22%2C%0A%20%20%20%20rationale%3D%22Recurring%20purchases%20have%20a%20calendar%3A%20payroll%2C%20automatic%20DCA%20programmes%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exchanges%20and%20periodic%20contributions%20from%20funds%20and%20treasuries%20all%20cluster%20at%20month%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22end%20and%20in%20the%20first%20days%20of%20the%20next%20one.%20That%20flow%20is%20price-insensitive%20%E2%80%94%20it%20buys%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20amount%2C%20whatever%20it%20costs%20%E2%80%94%20and%20it%20arrives%20synchronised%20into%20a%20book%20whose%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22sellers%20do%20not%20share%20that%20synchrony.%20It%20is%20the%20same%20turn-of-month%20effect%20documented%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20equities%20since%20the%201980s%2C%20transplanted%20to%20an%20asset%20whose%20retail%20base%20buys%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22fixed%20amount%20rather%20than%20on%20a%20one-off%20conviction.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%20on%20the%20last%20calendar%20day%20of%20the%20month%20and%20the%20first%20%22%0A%20%20%20%20%20%20%20%20%20%20%22three%20of%20the%20next%2C%20above%20the%20null%20arm.%20It%20fails%20if%20the%20edge%20is%20nil%2C%20which%20is%20what%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20if%20crypto%20flow%20is%20not%20synchronised%20with%20any%20payroll%2C%20being%20a%20global%20base%20with%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%22common%20payday.%20Second%20criterion%2C%20and%20a%20stricter%20one%3A%20if%20the%20edge%20is%20concentrated%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22just%20ONE%20of%20the%20four%20days%2C%20it%20is%20a%20coincidence%20and%20not%20a%20flow%20%E2%80%94%20the%20mechanism%20predicts%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20BLOCK%20of%20days%2C%20not%20a%20date.%20We%20expect%20it%20to%20weaken%20in%20the%20months%20whose%201st%20falls%20at%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22weekend%2C%20with%20the%20fiat%20rails%20closed.%22%2C%0A%20%20%20%20fn%3D_turn_of_month%2C%0A%20%20%20%20params%3D%7B%22days%22%3A%20%22last%20calendar%20day%20of%20the%20month%20and%20days%201%2C%202%20and%203%20of%20the%20next%22%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%209.%20The%20week%20before%20quarterly%20expiry%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_pre_quarterly_expiry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20dates%20%3D%20_date%28_hold_ts%28s%29%29%0A%20%20%20%20months%20%3D%20dates.astype%28%22datetime64%5BM%5D%22%29%0A%20%20%20%20quarterly%20%3D%20np.isin%28%28months.astype%28np.int64%29%20%25%2012%29%2C%20%282%2C%205%2C%208%2C%2011%29%29%20%20%20%23%20Mar%2C%20Jun%2C%20Sep%2C%20Dec%0A%20%20%20%20days_to%20%3D%20%28_last_friday%28months%29%20-%20dates%29.astype%28np.int64%29%0A%20%20%20%20out%5Bquarterly%20%26%20%28days_to%20%3E%3D%201%29%20%26%20%28days_to%20%3C%3D%207%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.pre_quarterly_expiry_short%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Short%20the%20week%20before%20quarterly%20expiry%22%2C%0A%20%20%20%20rationale%3D%22The%20largest%20open%20interest%20in%20options%20and%20futures%20%28Deribit%20and%20CME%29%20expires%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22last%20Friday%20of%20March%2C%20June%2C%20September%20and%20December.%20In%20the%20week%20before%2C%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22interest%20is%20closed%20or%20rolled%3A%20the%20spot-futures%20basis%20compresses%2C%20the%20desks%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22were%20funding%20the%20carry%20unwind%20the%20spot%20long%20that%20hedged%20it%2C%20and%20options%20holders%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22adjust%20delta%20against%20an%20ever-nearer%20expiry.%20The%20net%20of%20those%20trades%20removes%20LONG%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22leverage%2C%20which%20is%20the%20structurally%20dominant%20side%20in%20crypto%2C%20and%20removing%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22dominant%20side%20pushes%20the%20price%20down.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20slightly%20negative%20drift%20in%20the%20seven%20days%20before%20quarterly%20expiry.%20It%20fails%20%22%0A%20%20%20%20%20%20%20%20%20%20%22if%20the%20drift%20is%20positive%20or%20indistinguishable%20from%20the%20rest%20of%20the%20quarter.%20A%20warning%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20is%20part%20of%20the%20registration%3A%20there%20are%20four%20quarterly%20expiries%20a%20year%2C%20so%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22effective%20sample%20is%20a%20few%20dozen%20EVENTS%2C%20not%20thousands%20of%20candles%3B%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22multiple-comparison%20correction%20has%20to%20be%20applied%20over%20events%20and%20the%20confidence%20%22%0A%20%20%20%20%20%20%20%20%20%20%22intervals%20computed%20by%20blocks%2C%20not%20per%20candle%2C%20or%20the%20standard%20error%20will%20come%20out%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsely%20tiny.%20If%20the%20effect%20only%20shows%20up%20in%20the%20quarters%20of%20one%20particular%20bull%20year%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22what%20we%20have%20is%20that%20year%20and%20not%20the%20expiry.%22%2C%0A%20%20%20%20fn%3D_pre_quarterly_expiry%2C%0A%20%20%20%20params%3D%7B%22months%22%3A%20%283%2C%206%2C%209%2C%2012%29%2C%20%22days_before%22%3A%207%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22anchor%22%3A%20%22last%20Friday%20of%20the%20quarter%2C%2008%3A00%20UTC%22%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%2010.%20The%20days%20after%20monthly%20expiry%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_post_monthly_expiry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20dates%20%3D%20_date%28_hold_ts%28s%29%29%0A%20%20%20%20months%20%3D%20dates.astype%28%22datetime64%5BM%5D%22%29%0A%0A%20%20%20%20%23%20The%20expiry%20in%20force%20is%20this%20month%27s%20if%20it%20has%20already%20happened%3B%20if%20not%2C%20the%20previous%20month%27s.%0A%20%20%20%20%23%20Without%20this%2C%20the%20first%20days%20of%20a%20month%20%28when%20the%20last%20Friday%20falls%20on%20the%2030th%20or%2031st%29%0A%20%20%20%20%23%20would%20be%20left%20out.%0A%20%20%20%20exp_current%20%3D%20_last_friday%28months%29%0A%20%20%20%20exp_previous%20%3D%20_last_friday%28months%20-%20np.timedelta64%281%2C%20%22M%22%29%29%0A%20%20%20%20in_force%20%3D%20np.where%28dates%20%3E%3D%20exp_current%2C%20exp_current%2C%20exp_previous%29%0A%0A%20%20%20%20days_since%20%3D%20%28dates%20-%20in_force%29.astype%28np.int64%29%0A%20%20%20%20out%5B%28days_since%20%3E%3D%201%29%20%26%20%28days_since%20%3C%3D%203%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.post_monthly_expiry_long%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Long%20the%20three%20days%20after%20monthly%20expiry%22%2C%0A%20%20%20%20rationale%3D%22Once%20the%20monthly%20expiry%20has%20passed%20%28last%20Friday%2C%2008%3A00%20UTC%20on%20Deribit%29%2C%20the%20delta%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hedging%20that%20anchors%20price%20to%20the%20strikes%20with%20the%20most%20open%20interest%20disappears%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20positioning%20is%20rebuilt%3A%20expired%20calls%20are%20rolled%20to%20the%20next%20month%2C%20the%20desks%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22reopen%20the%20carry%20and%20the%20leverage%20that%20was%20trimmed%20comes%20back.%20That%20rebuilding%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22long%20positioning%20is%2C%20mechanically%2C%20buying%20flow%20spread%20over%20the%20immediately%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22following%20days.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20small%20positive%20drift%20in%20the%20three%20days%20after%20each%20monthly%20expiry.%20It%20fails%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20is%20nil%2C%20and%20most%20especially%20if%20it%20turns%20out%20to%20be%20the%20symmetric%20mirror%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60pre_quarterly_expiry_short%60%3A%20if%20what%20we%20are%20measuring%20is%20a%20single%20pivot%20around%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expiry%2C%20they%20are%20not%20two%20findings%20but%20one%20and%20it%20has%20to%20be%20counted%20as%20ONE%20trial.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20it%20to%20fail%20in%20the%20months%20where%20the%20expiry%20falls%20next%20to%20the%20turn%20of%20the%20month%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22where%20its%20window%20blurs%20into%20%60turn_of_month_long%60%27s%20and%20neither%20of%20the%20two%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22attributable.%22%2C%0A%20%20%20%20fn%3D_post_monthly_expiry%2C%0A%20%20%20%20params%3D%7B%22days_after%22%3A%203%2C%20%22anchor%22%3A%20%22last%20Friday%20of%20each%20month%2C%2008%3A00%20UTC%22%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------%0A%23%2011.%20Halving%20cycle%20phase%0A%23%20--------------------------------------------------------------------------------------%0A%0Adef%20_halving_phase%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%0A%20%20%20%20t%20%3D%20_hold_ts%28s%29%0A%20%20%20%20%23%20%60side%3D%22right%22%60%20%E2%87%92%20only%20halvings%20STRICTLY%20at%20or%20before%20the%20candle.%20Never%20the%20next%20one.%0A%20%20%20%20k%20%3D%20np.searchsorted%28_HALVINGS_MS%2C%20t%2C%20side%3D%22right%22%29%20-%201%0A%20%20%20%20has_halving%20%3D%20k%20%3E%3D%200%0A%20%20%20%20days%20%3D%20%28t%20-%20_HALVINGS_MS%5Bnp.clip%28k%2C%200%2C%20None%29%5D%29%20%2F%2F%20_MS_DAY%0A%0A%20%20%20%20out%5Bhas_halving%20%26%20%28days%20%3E%3D%20180%29%20%26%20%28days%20%3C%3D%20540%29%5D%20%3D%201%20%20%20%20%20%20%23%20months%206-18%3A%20expansion%0A%20%20%20%20out%5Bhas_halving%20%26%20%28days%20%3E%20540%29%20%26%20%28days%20%3C%3D%20900%29%5D%20%3D%20-1%20%20%20%20%20%20%23%20months%2018-30%3A%20contraction%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22seasonality.halving_cycle_phase%22%2C%0A%20%20%20%20family%3D%22seasonality%22%2C%0A%20%20%20%20title%3D%22Long%20the%20halving%20expansion%2C%20short%20the%20contraction%22%2C%0A%20%20%20%20rationale%3D%22The%20halving%20cuts%20miner%20issuance%20in%20half%20from%20one%20block%20to%20the%20next.%20Miners%20are%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22structural%20sellers%20%E2%80%94%20they%20pay%20for%20energy%20in%20fiat%20currency%20%E2%80%94%20so%20the%20daily%20selling%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22flow%20the%20market%20has%20to%20absorb%20halves%20on%20a%20date%20known%20in%20advance.%20The%20folk%20model%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20cycle%20holds%20that%20the%20effect%20is%20not%20instantaneous%20but%20accumulates%20over%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22following%206-18%20months%2C%20as%20the%20supply%20deficit%20shows%20itself%2C%20and%20that%20it%20gives%20way%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20contraction%20of%20about%20twelve%20months%20once%20price%20has%20already%20discounted%20it%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22marginal%20buyer%20runs%20out.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20positive%20expectancy%20in%20months%206-18%20after%20the%20halving%20and%20negative%20expectancy%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20months%2018-30.%20WARNING%2C%20and%20this%20is%20as%20much%20part%20of%20the%20pre-registration%20as%20the%20sign%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20effective%20sample%20is%20TWO%20complete%20cycles%20in%20a%20Binance%20series%20that%20starts%20in%202017%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%E2%80%94n%E2%89%882%2C%20not%20thousands%20of%20candles%E2%80%94%20and%20no%20multiple-comparison%20correction%20fixes%20an%20n%20of%202.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22Worse%20still%2C%20the%206-%2C%2018-%20and%2030-month%20boundaries%20come%20from%20a%20description%20written%20while%20%22%0A%20%20%20%20%20%20%20%20%20%20%22LOOKING%20at%20those%20very%20cycles%3A%20it%20is%20in-sample%20contamination%20that%20can%20no%20longer%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%22undone.%20We%20declare%20in%20advance%20that%20we%20will%20read%20the%20result%20as%20descriptive%20and%20never%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22evidence%2C%20and%20we%20register%20it%20precisely%20so%20that%20its%20outcome%20%E2%80%94success%20or%20failure%E2%80%94%20is%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20record%20instead%20of%20turning%20up%20later%20as%20an%20idea%20we%20had%20%27always%20had%27.%20Additional%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsification%20of%20the%20mechanism%3A%20if%20the%20cycle%20that%20began%20in%202024%2C%20in%20which%20issuance%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22already%20insignificant%20next%20to%20daily%20ETF%20volume%2C%20does%20not%20reproduce%20the%20pattern%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mechanism%20is%20dead%20even%20if%20the%20historical%20average%20survives.%22%2C%0A%20%20%20%20fn%3D_halving_phase%2C%0A%20%20%20%20params%3D%7B%22expansion_days%22%3A%20%28180%2C%20540%29%2C%20%22contraction_days%22%3A%20%28541%2C%20900%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22halvings%22%3A%20%28%222012-11-28%22%2C%20%222016-07-09%22%2C%20%222020-05-11%22%2C%20%222024-04-20%22%29%7D%2C%0A%20%20%20%20timeframes%3D%28%221d%22%2C%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=a4e48c8bdf4d541c2862ec7eb714f618198d1991e06fac4beeb4c050c4ed9155\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":15,"row_hash":"74102be0adb0214051264484e26796ad66b1169b153f83646da17e4ed0a697d6","body":"wavelab-journal-chain\nv=3\nseq=15\nprev=fc8e5dac5f05b960b2b8345913210d934104625b795a50b3cad6da7961edd372\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nprereg_seq=2\nsource_text=%22%22%22%60structure%60%20family%3A%20market%20structure%20as%20a%20source%20of%20edge.%0A%0APRE-REGISTRATION.%20Nothing%20here%20has%20been%20run%20against%20data.%20The%20parameters%20are%20the%20conventional%20ones%0Afrom%20the%20literature%20%E2%80%94%20Donchian%2020%20and%2055%20%28Turtle%20systems%201%20and%202%29%2C%20Williams%27%205-candle%20fractal%20%28k%3D2%0Aon%20each%20side%29%2C%20ATR%2014%2C%2020-period%20volume%20average%20%E2%80%94%20and%20the%20horizon%20of%20the%20event%20hypotheses%20is%2010%0Acandles%20for%20ALL%20of%20them%2C%20chosen%20once%20and%20applied%20without%20exception%20so%20that%20there%20is%20no%20hidden%20grid%0Adressed%20up%20as%20%22variants%22.%0A%0ATHE%20FAMILY%27S%20SHARED%20MECHANISM.%20Previous%20highs%20and%20lows%20are%20the%20few%20levels%20every%20participant%20sees%0Athe%20same%20way%2C%20without%20ambiguity%20and%20without%20parameters.%20That%20is%20where%20the%20long%20puts%20the%20stop%2C%20where%0Awhoever%20waits%20for%20confirmation%20puts%20the%20breakout%20order%2C%20and%20where%20the%20market%20maker%20knows%20there%20is%0Aexecutable%20volume.%20In%20other%20words%3A%20structure%20does%20not%20predict%2C%20but%20it%20DOES%20concentrate%20orders%2C%20and%0Aa%20concentration%20of%20orders%20is%20the%20only%20thing%20that%20can%20move%20a%20price.%20Each%20hypothesis%20below%20bets%20on%0Awhat%20happens%20when%20price%20reaches%20that%20liquidity%3A%20either%20the%20break%20drags%20along%20whoever%20was%20on%20the%0Aother%20side%20%28continuation%29%20or%20the%20liquidity%20is%20consumed%20in%20one%20go%20and%20price%20comes%20back%20inside%20%28a%0Asweep%29.%0A%0AThe%20two%20families%20of%20bets%20CANNOT%20both%20be%20true%20in%20the%20same%20regime.%20The%20conflict%20is%20deliberate%3A%0A%60structure.donchian_break_20%60%20and%20%60structure.sweep_reversal_20%60%20trade%20the%20same%20level%20in%20opposite%0Adirections%2C%20and%20so%20do%20%60structure.bos_swing%60%20and%20%60structure.range_fade_swing%60.%20If%20both%20%22work%22%20at%0Aonce%20without%20the%20regime%20separating%20them%2C%20the%20likeliest%20explanation%20is%20not%20that%20there%20are%20two%20edges%0Abut%20that%20the%20estimator%20is%20measuring%20noise%2C%20and%20that%20is%20informative.%0A%0ACAUSALITY.%20Every%20reference%20level%20comes%20from%20candles%20STRICTLY%20earlier%20than%20i%20%28%60_shift1%60%20over%20talib%27s%0Awindows%2C%20which%20include%20the%20current%20candle%29%20and%20every%20pivot%20is%20placed%20on%20the%20candle%20where%20it%20is%0ACONFIRMED%2C%20not%20on%20the%20one%20where%20the%20extreme%20happened.%20Neither%20%60find_peaks%60%20nor%20any%20statistic%0Adefined%20against%20the%20whole%20array%20is%20used.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20Single%20horizon%20for%20the%20event%20hypotheses%20%28sweep%2C%20retest%2C%20inside%20bar%2C%20range%20fade%29.%0A%23%20One%20number%20for%20all%20of%20them%3A%20if%20each%20carried%20its%20own%2C%20this%20would%20be%20a%20grid.%0A_HOLD%20%3D%2010%0A%0A%23%20Half-width%20of%20the%20Williams%20fractal%3A%205%20candles%2C%202%20on%20each%20side.%20Confirmation%20arrives%202%20candles%0A%23%20after%20the%20extreme%2C%20and%20that%20delay%20is%20honoured%20explicitly.%0A_K%20%3D%202%0A%0A%23%20Series%20shorter%20than%20this%20return%20all%20zeros.%20It%20matches%20%60min_warmup%60%20on%20purpose%3A%20that%20way%20the%0A%23%20guard%27s%20threshold%20never%20falls%20INSIDE%20the%20region%20the%20backtest%20evaluates%2C%20and%20the%20signal%20at%20i%20is%0A%23%20identical%20whether%20it%20is%20computed%20over%20the%20prefix%20%5B0..i%5D%20or%20over%20the%20whole%20series.%0A_MIN_BARS%20%3D%20200%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20Utilities.%20All%20causal%3A%20position%20i%20only%20looks%20at%20positions%20%3C%3D%20i.%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_f%28x%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22talib%20requires%20contiguous%20float64.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28x%2C%20dtype%3Dnp.float64%29%0A%0A%0Adef%20_shift1%28x%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22out%5Bi%5D%20%3D%20x%5Bi-1%5D%2C%20out%5B0%5D%20%3D%20NaN.%20Shifts%20towards%20the%20FUTURE%20%28never%20a%20negative%20np.roll%29.%22%22%22%0A%20%20%20%20out%20%3D%20np.empty_like%28x%29%0A%20%20%20%20out%5B0%5D%20%3D%20np.nan%0A%20%20%20%20out%5B1%3A%5D%20%3D%20x%5B%3A-1%5D%0A%20%20%20%20return%20out%0A%0A%0A%23%20%60_shiftk%60%20used%20to%20live%20here.%20It%20goes%20with%20the%20duplicate%20hypothesis%20that%20was%20its%20only%20user%20%28see%0A%23%20the%20note%20at%20point%2011%29%3A%20leaving%20dead%20utilities%20lying%20around%20invites%20the%20next%20hypothesis%20to%20reuse%0A%23%20them%20without%20rechecking%20their%20causality.%0A%0A%0Adef%20_prev_max%28high%3A%20np.ndarray%2C%20n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Maximum%20of%20the%20n%20candles%20BEFORE%20i.%20talib.MAX%20includes%20candle%20i%2C%20so%20it%20is%20shifted.%22%22%22%0A%20%20%20%20return%20_shift1%28talib.MAX%28_f%28high%29%2C%20n%29%29%0A%0A%0Adef%20_prev_min%28low%3A%20np.ndarray%2C%20n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Minimum%20of%20the%20n%20candles%20BEFORE%20i.%22%22%22%0A%20%20%20%20return%20_shift1%28talib.MIN%28_f%28low%29%2C%20n%29%29%0A%0A%0Adef%20_gt%28a%3A%20np.ndarray%2C%20b%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22a%20%3E%20b%2C%20False%20wherever%20either%20is%20NaN.%20The%20check%20is%20explicit%3A%20nan_to_num%20with%20a%20sentinel%0A%20%20%20%20would%20invent%20breakouts%20during%20warm-up.%22%22%22%0A%20%20%20%20out%20%3D%20np.zeros%28a.shape%2C%20dtype%3Dbool%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28a%29%20%7C%20np.isnan%28b%29%29%0A%20%20%20%20np.greater%28a%2C%20b%2C%20out%3Dout%2C%20where%3Dok%29%0A%20%20%20%20return%20out%0A%0A%0Adef%20_lt%28a%3A%20np.ndarray%2C%20b%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22a%20%3C%20b%2C%20False%20wherever%20either%20is%20NaN.%22%22%22%0A%20%20%20%20out%20%3D%20np.zeros%28a.shape%2C%20dtype%3Dbool%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28a%29%20%7C%20np.isnan%28b%29%29%0A%20%20%20%20np.less%28a%2C%20b%2C%20out%3Dout%2C%20where%3Dok%29%0A%20%20%20%20return%20out%0A%0A%0Adef%20_fresh%28cond%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Only%20the%20candle%20on%20which%20%60cond%60%20flips%20from%20false%20to%20true.%20Needed%20for%20the%20event%20hypotheses%0A%20%20%20%20whose%20condition%20is%20a%20persistent%20STATE%20%28%22price%20is%20above%20the%20pivot%22%29%3A%20without%20this%20the%20event%0A%20%20%20%20re-arms%20on%20every%20candle%20and%20a%20one-off%20rejection%20hypothesis%20turns%2C%20unintentionally%2C%20into%20a%0A%20%20%20%20permanent%20counter-trend%20position.%20It%20looks%20at%20i%20and%20i-1%2C%20nothing%20else.%22%22%22%0A%20%20%20%20out%20%3D%20cond.copy%28%29%0A%20%20%20%20out%5B1%3A%5D%20%26%3D%20~cond%5B%3A-1%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_ffill%28x%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Carries%20the%20last%20non-NaN%20value%20forward.%20%60maximum.accumulate%60%20is%20a%20prefix%3A%20the%20value%20at%20i%0A%20%20%20%20can%20only%20come%20from%20%3C%3D%20i.%22%22%22%0A%20%20%20%20idx%20%3D%20np.where%28~np.isnan%28x%29%2C%20np.arange%28x.size%29%2C%200%29%0A%20%20%20%20np.maximum.accumulate%28idx%2C%20out%3Didx%29%0A%20%20%20%20return%20x%5Bidx%5D%0A%0A%0Adef%20_events%28up%3A%20np.ndarray%2C%20dn%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Encodes%20events%20into%20%7B-1%2C0%2C%2B1%7D.%20If%20both%20fire%20on%20the%20same%20candle%20the%20situation%20is%20ambiguous%0A%20%20%20%20and%200%20is%20emitted%20%28there%20is%20no%20information%29%2C%20never%20an%20arbitrary%20tie-break.%22%22%22%0A%20%20%20%20both%20%3D%20up%20%26%20dn%0A%20%20%20%20ev%20%3D%20np.zeros%28up.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bup%20%26%20~both%5D%20%3D%201%0A%20%20%20%20ev%5Bdn%20%26%20~both%5D%20%3D%20-1%0A%20%20%20%20return%20ev%0A%0A%0Adef%20_hold%28up%3A%20np.ndarray%2C%20dn%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Holds%20the%20last%20event%20until%20the%20opposite%20one%20appears%20%28always%20in%20the%20market%20after%20the%0A%20%20%20%20first%29.%22%22%22%0A%20%20%20%20ev%20%3D%20_events%28up%2C%20dn%29%0A%20%20%20%20idx%20%3D%20np.where%28ev%20%21%3D%200%2C%20np.arange%28ev.size%29%2C%200%29%0A%20%20%20%20np.maximum.accumulate%28idx%2C%20out%3Didx%29%0A%20%20%20%20out%20%3D%20ev%5Bidx%5D%0A%20%20%20%20out%5Bidx%20%3D%3D%200%5D%20%3D%20ev%5B0%5D%20%20%20%20%20%20%20%20%20%20%23%20before%20the%20first%20event%20there%20is%20no%20position%0A%20%20%20%20return%20out%0A%0A%0Adef%20_hold_n%28up%3A%20np.ndarray%2C%20dn%3A%20np.ndarray%2C%20bars%3A%20int%20%3D%20_HOLD%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Holds%20the%20last%20event%20for%20%60bars%60%20candles%20and%20then%20exits.%20For%20event%20hypotheses%2C%20where%20the%0A%20%20%20%20effect%20%E2%80%94if%20it%20exists%E2%80%94%20is%20transient%20by%20construction.%22%22%22%0A%20%20%20%20ev%20%3D%20_events%28up%2C%20dn%29%0A%20%20%20%20n%20%3D%20ev.size%0A%20%20%20%20idx%20%3D%20np.where%28ev%20%21%3D%200%2C%20np.arange%28n%29%2C%200%29%0A%20%20%20%20np.maximum.accumulate%28idx%2C%20out%3Didx%29%0A%20%20%20%20out%20%3D%20ev%5Bidx%5D.copy%28%29%0A%20%20%20%20age%20%3D%20np.arange%28n%29%20-%20idx%0A%20%20%20%20out%5Bage%20%3E%3D%20bars%5D%20%3D%200%0A%20%20%20%20out%5Bev%5Bidx%5D%20%3D%3D%200%5D%20%3D%200%0A%20%20%20%20return%20out%0A%0A%0Adef%20_pivots%28s%3A%20Series%2C%20k%3A%20int%20%3D%20_K%29%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20%22%22%22Williams%20fractals%20PLACED%20ON%20THE%20CANDLE%20THAT%20CONFIRMS%20THEM%2C%20not%20on%20the%20candle%20of%20the%20extreme.%0A%0A%20%20%20%20A%20fractal%20high%20at%20candle%20j%20is%20only%20known%20at%20j%2Bk%2C%20once%20the%20k%20following%20candles%20have%20closed.%0A%20%20%20%20Returning%20the%20pivot%20at%20j%20would%20be%20looking%20into%20the%20future%3A%20it%20is%20exactly%20the%20mistake%20that%20makes%0A%20%20%20%20%22structure%22%20strategies%20look%20profitable%20on%20paper.%20Here%20%60ph%5Bi%5D%60%20holds%20the%20price%20of%20the%20high%0A%20%20%20%20confirmed%20AT%20i%20%28the%20extreme%20having%20occurred%20at%20i-k%29%20and%20NaN%20if%20nothing%20is%20confirmed%20at%20i.%0A%20%20%20%20%22%22%22%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20w%20%3D%202%20%2A%20k%20%2B%201%0A%20%20%20%20ph%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20pl%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20if%20n%20%3C%3D%20w%3A%0A%20%20%20%20%20%20%20%20return%20ph%2C%20pl%0A%0A%20%20%20%20hi%2C%20lo%20%3D%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20rmax%20%3D%20talib.MAX%28hi%2C%20w%29%20%20%20%20%20%20%23%20maximum%20over%20%5Bi-w%2B1%2C%20i%5D%3A%20every%20datum%20%3C%3D%20i%0A%20%20%20%20rmin%20%3D%20talib.MIN%28lo%2C%20w%29%0A%0A%20%20%20%20i%20%3D%20np.arange%28w%20-%201%2C%20n%29%20%20%20%20%20%20%23%20from%20the%20first%20complete%20window%20onwards%0A%20%20%20%20c%20%3D%20i%20-%20k%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20central%20candle%3A%20the%20candidate%20extreme%0A%0A%20%20%20%20ok_h%20%3D%20~%28np.isnan%28rmax%5Bi%5D%29%20%7C%20np.isnan%28hi%5Bc%5D%29%29%0A%20%20%20%20is_h%20%3D%20np.zeros%28i.size%2C%20dtype%3Dbool%29%0A%20%20%20%20np.equal%28hi%5Bc%5D%2C%20rmax%5Bi%5D%2C%20out%3Dis_h%2C%20where%3Dok_h%29%0A%20%20%20%20ph%5Bi%5Bis_h%5D%5D%20%3D%20hi%5Bc%5Bis_h%5D%5D%0A%0A%20%20%20%20ok_l%20%3D%20~%28np.isnan%28rmin%5Bi%5D%29%20%7C%20np.isnan%28lo%5Bc%5D%29%29%0A%20%20%20%20is_l%20%3D%20np.zeros%28i.size%2C%20dtype%3Dbool%29%0A%20%20%20%20np.equal%28lo%5Bc%5D%2C%20rmin%5Bi%5D%2C%20out%3Dis_l%2C%20where%3Dok_l%29%0A%20%20%20%20pl%5Bi%5Bis_l%5D%5D%20%3D%20lo%5Bc%5Bis_l%5D%5D%0A%0A%20%20%20%20return%20ph%2C%20pl%0A%0A%0Adef%20_pivot_levels%28s%3A%20Series%29%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%2C%20np.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20%22%22%22%28last%20confirmed%20high%2C%20the%20one%20before%20it%2C%20last%20confirmed%20low%2C%20the%20one%20before%20it%29%20at%20each%0A%20%20%20%20candle.%22%22%22%0A%20%20%20%20ph%2C%20pl%20%3D%20_pivots%28s%29%0A%20%20%20%20ph1%2C%20pl1%20%3D%20_ffill%28ph%29%2C%20_ffill%28pl%29%0A%20%20%20%20%23%20On%20a%20confirmation%20candle%2C%20the%20%22previous%22%20one%20is%20the%20value%20carried%20forward%20to%20the%20candle%0A%20%20%20%20%23%20before.%0A%20%20%20%20ph2%20%3D%20_ffill%28np.where%28~np.isnan%28ph%29%2C%20_shift1%28ph1%29%2C%20np.nan%29%29%0A%20%20%20%20pl2%20%3D%20_ffill%28np.where%28~np.isnan%28pl%29%2C%20_shift1%28pl1%29%2C%20np.nan%29%29%0A%20%20%20%20return%20ph1%2C%20ph2%2C%20pl1%2C%20pl2%0A%0A%0Adef%20_structure_state%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22%2B1%20if%20the%20last%20confirmed%20structure%20is%20higher%20highs%20and%20higher%20lows%2C%20-1%20if%20lower%2C%200%20if%20it%20is%0A%20%20%20%20mixed.%20Shared%20base%20for%20several%20hypotheses.%22%22%22%0A%20%20%20%20ph1%2C%20ph2%2C%20pl1%2C%20pl2%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20up%20%3D%20_gt%28ph1%2C%20ph2%29%20%26%20_gt%28pl1%2C%20pl2%29%0A%20%20%20%20dn%20%3D%20_lt%28ph1%2C%20ph2%29%20%26%20_lt%28pl1%2C%20pl2%29%0A%20%20%20%20st%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20st%5Bup%5D%20%3D%201%0A%20%20%20%20st%5Bdn%5D%20%3D%20-1%0A%20%20%20%20return%20st%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%201.%20Donchian%2020%20breakout%2C%20always%20in%20the%20market%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_donchian_break_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20_prev_max%28s.high%2C%2020%29%29%2C%20_lt%28c%2C%20_prev_min%28s.low%2C%2020%29%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.donchian_break_20%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Flip%20sides%20on%20every%20Donchian%2020%20break%22%2C%0A%20%20%20%20rationale%3D%22The%20high%20of%20the%20previous%2020%20candles%20is%20the%20level%20where%20the%20largest%20quantity%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22resting%20orders%20converges%3A%20the%20shorts%27%20stops%2C%20stop%20entries%20from%20those%20waiting%20for%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22confirmation%2C%20and%20hedges%20from%20option%20sellers.%20When%20price%20takes%20it%20out%2C%20those%20orders%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22execute%20as%20market%20orders%20and%20consume%20the%20book%20in%20the%20same%20direction%2C%20which%20pushes%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22price%20further%20and%20forces%20more%20closing.%20If%20that%20cascade%20exists%20in%20BTC%2C%20a%20plain%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22stop-and-reverse%20on%20the%20channel%20should%20capture%20it%20with%20no%20further%20machinery.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20concentrated%20in%20a%20few%20right-tail%20episodes%20%28a%20handful%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trades%20supply%20almost%20the%20entire%20result%29%2C%20with%20a%20LOW%20hit%20rate%2C%20below%2045%25.%20We%20expect%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%22to%20fail%20%E2%80%94a%20negative%20edge%2C%20not%20a%20nil%20one%E2%80%94%20in%20prolonged%20ranges%2C%20where%20every%20breakout%20%22%0A%20%20%20%20%20%20%20%20%20%20%22reverses%20and%20the%20system%20pays%20the%20spread%20in%20both%20directions.%20If%20it%20comes%20out%20with%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22positive%20edge%20AND%20a%20high%20hit%20rate%2C%20the%20hypothesis%20is%20wrong%3A%20that%20would%20point%20to%20a%20data%20%22%0A%20%20%20%20%20%20%20%20%20%20%22or%20execution%20fault%2C%20not%20to%20a%20structural%20effect.%22%2C%0A%20%20%20%20fn%3D_donchian_break_20%2C%0A%20%20%20%20params%3D%7B%22channel%22%3A%2020%2C%20%22mode%22%3A%20%22stop-and-reverse%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%202.%20Donchian%2055%20breakout%20with%20a%20Donchian%2020%20exit%20%28with%20a%20flat%20state%29%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_donchian_55_exit_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20hi55%2C%20lo55%20%3D%20_prev_max%28s.high%2C%2055%29%2C%20_prev_min%28s.low%2C%2055%29%0A%20%20%20%20hi20%2C%20lo20%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%23%20Explicit%20loop%3A%20the%20state%20at%20i%20depends%20on%20the%20state%20at%20i-1%20and%20on%20data%20from%20i.%20Nothing%0A%20%20%20%20%20%20%20%20%23%20else.%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20np.isnan%28hi55%5Bi%5D%29%20and%20c%5Bi%5D%20%3E%20hi55%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20not%20np.isnan%28lo55%5Bi%5D%29%20and%20c%5Bi%5D%20%3C%20lo55%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20elif%20pos%20%3D%3D%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20np.isnan%28lo20%5Bi%5D%29%20and%20c%5Bi%5D%20%3C%20lo20%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%20%20%20%20%20%20%20%20%20%20%23%20exit%20and%20stay%20flat%3A%20re-entering%20on%20the%20same%20close%20is%20ambiguous%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20np.isnan%28hi20%5Bi%5D%29%20and%20c%5Bi%5D%20%3E%20hi20%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.donchian_55_exit_20%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Donchian%2055%20entry%2C%20exit%20flat%20at%2020%22%2C%0A%20%20%20%20rationale%3D%22This%20is%20not%20the%20same%20hypothesis%20as%20the%2020%20channel%20with%20a%20different%20number%2C%20and%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20why%20it%20is%20registered%20separately%3A%20the%20claim%20here%20is%20not%20about%20the%20entry%20level%20but%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22about%20the%20ASYMMETRY%20between%20entering%20and%20exiting.%20Entry%20happens%20only%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2255-candle%20break%2C%20the%20one%20that%20requires%20an%20imbalance%20that%20has%20already%20absorbed%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whole%20quarter%27s%20liquidity%2C%20and%20the%20exit%20uses%20a%20shorter%2020%20channel%20and%20goes%20FLAT%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22with%20no%20reversal.%20The%20bet%20is%20that%20the%20participant%20who%20triggers%20the%20cascade%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%28leveraged%20liquidations%2C%20treasury%20rebalancing%29%20takes%20weeks%20to%20exhaust%20itself%2C%20while%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22its%20disappearance%20shows%20up%20within%20days%3B%20exiting%20flat%20instead%20of%20flipping%20avoids%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22paying%20the%20wrong%20side%20of%20a%20consolidation.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20and%20FEWER%20trades%20than%20%60donchian_break_20%60%2C%20with%20a%20smaller%20%22%0A%20%20%20%20%20%20%20%20%20%20%22maximum%20cumulative%20loss%20thanks%20to%20the%20flat%20state.%20We%20expect%20it%20to%20fail%20on%20low%20%22%0A%20%20%20%20%20%20%20%20%20%20%22timeframes%20%2815m%2C%201h%29%2C%20where%2055%20candles%20are%20a%20few%20hours%20and%20the%20break%20identifies%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%22structural%20flow%20at%20all%3A%20there%20the%20result%20should%20be%20indistinguishable%20from%20zero%2C%20or%20%22%0A%20%20%20%20%20%20%20%20%20%20%22negative%20after%20costs.%20If%20the%20edge%20were%20equal%20or%20greater%20on%2015m%20than%20on%201d%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mechanical%20explanation%20above%20is%20false.%22%2C%0A%20%20%20%20fn%3D_donchian_55_exit_20%2C%0A%20%20%20%20params%3D%7B%22entry%22%3A%2055%2C%20%22exit%22%3A%2020%2C%20%22mode%22%3A%20%22long%2Fshort%20with%20a%20flat%20state%22%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%203.%20BOS%3A%20break%20of%20the%20last%20CONFIRMED%20pivot%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_bos_swing%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20_%2C%20pl1%2C%20_%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20ph1%29%2C%20_lt%28c%2C%20pl1%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.bos_swing%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Break%20of%20the%20last%20confirmed%20swing%22%2C%0A%20%20%20%20rationale%3D%22The%20structural%20version%20of%20the%20breakout%3A%20instead%20of%20a%20fixed-length%20channel%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22level%20is%20the%20last%20swing%20high%20or%20low%20CONFIRMED%20by%20a%205-candle%20fractal.%20The%20mechanical%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22difference%20matters%3A%20a%2020%20channel%20moves%20through%20the%20mere%20passage%20of%20time%20even%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nothing%20has%20happened%2C%20whereas%20a%20pivot%20only%20changes%20when%20the%20market%20has%20genuinely%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22turned%20and%20left%20somebody%20trapped%20at%20the%20extreme.%20That%20is%20where%20the%20real%20stops%20are%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22because%20it%20is%20the%20only%20point%20that%20invalidates%20the%20thesis%20of%20whoever%20bought%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22previous%20impulse.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20similar%20to%20or%20slightly%20below%20the%2020%20channel%27s%20but%20with%20FEWER%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trades%2C%20because%20the%20levels%20are%20more%20stable.%20We%20expect%20it%20to%20fail%20when%20volatility%20%22%0A%20%20%20%20%20%20%20%20%20%20%22compresses%3A%20with%20small%20candles%20the%20fractal%20confirms%20trivial%20pivots%2C%20the%20level%20ends%20up%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22tick%20away%20from%20price%20and%20the%20signal%20flips%20sign%20constantly.%20The%20hypothesis%20is%20refuted%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20edge%20per%20trade%20does%20not%20beat%20the%2020%20channel%27s%2C%20because%20then%20the%20%27structural%27%20part%20%22%0A%20%20%20%20%20%20%20%20%20%20%22adds%20nothing%20over%20a%20rolling%20maximum.%22%2C%0A%20%20%20%20fn%3D_bos_swing%2C%0A%20%20%20%20params%3D%7B%22fractal_k%22%3A%20_K%2C%20%22fractal_window%22%3A%202%20%2A%20_K%20%2B%201%2C%20%22confirmation_lag%22%3A%20_K%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%204.%20CHoCH%3A%20change%20of%20character%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_choch%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20ph2%2C%20pl1%2C%20pl2%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20uptrend%20%3D%20_gt%28ph1%2C%20ph2%29%20%26%20_gt%28pl1%2C%20pl2%29%20%20%20%20%20%20%23%20rising%20sequence%20in%20force%0A%20%20%20%20downtrend%20%3D%20_lt%28ph1%2C%20ph2%29%20%26%20_lt%28pl1%2C%20pl2%29%20%20%20%20%23%20falling%20sequence%20in%20force%0A%20%20%20%20%23%20Change%20of%20character%3A%20first%20low%20lost%20after%20a%20rising%20sequence%20%28and%20its%20mirror%20image%29.%0A%20%20%20%20choch_dn%20%3D%20uptrend%20%26%20_lt%28c%2C%20pl1%29%0A%20%20%20%20choch_up%20%3D%20downtrend%20%26%20_gt%28c%2C%20ph1%29%0A%20%20%20%20return%20_hold%28choch_up%2C%20choch_dn%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.choch%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22First%20break%20against%20the%20structure%20in%20force%22%2C%0A%20%20%20%20rationale%3D%22The%20change%20of%20character%20is%20the%20first%20time%20the%20sequence%20breaks%3A%20we%20had%20been%20making%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22higher%20highs%20and%20higher%20lows%20and%20suddenly%20the%20last%20low%20is%20lost.%20The%20mechanism%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20the%20break%20itself%20but%20WHO%20is%20on%20the%20other%20side%3A%20in%20a%20rising%20sequence%2C%20each%20low%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20where%20the%20latest%20batch%20of%20trend%20buyers%20got%20in%2C%20with%20the%20stop%20just%20underneath.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Losing%20that%20low%20means%20the%20demand%20that%20was%20holding%20the%20impulse%20up%20no%20longer%20shows%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22up%2C%20and%20it%20turns%20the%20recent%20buyers%20into%20forced%20sellers.%20The%20difference%20from%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%60bos_swing%60%20is%20that%20here%20only%20the%20break%20AGAINST%20the%20structure%20in%20force%20is%20traded%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20the%20one%20with%20it.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20but%20SMALLER%20than%20the%20continuation%20one%2C%20and%20heavily%20dependent%20%22%0A%20%20%20%20%20%20%20%20%20%20%22on%20the%20timeframe%3A%20credible%20on%204h%20and%201d%2C%20doubtful%20on%2015m.%20We%20expect%20it%20to%20fail%20clearly%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20strong%20trends%2C%20where%20most%20CHoCHs%20are%20shakeouts%20inside%20the%20impulse%20and%20price%20resumes%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22there%20it%20should%20give%20a%20NEGATIVE%20edge%2C%20and%20if%20it%20does%20not%2C%20the%20signal%20is%20not%20capturing%20%22%0A%20%20%20%20%20%20%20%20%20%20%22what%20we%20think%20it%20is.%20It%20is%20also%20refuted%20if%20its%20result%20is%20indistinguishable%20from%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60bos_swing%60%27s%20with%20the%20sign%20flipped%3A%20that%20would%20mean%20we%20are%20only%20measuring%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%22autocorrelation%2C%20not%20structure.%22%2C%0A%20%20%20%20fn%3D_choch%2C%0A%20%20%20%20params%3D%7B%22fractal_k%22%3A%20_K%2C%20%22context%22%3A%20%222%20pivots%20per%20side%22%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%205.%20Structural%20regime%20HH%2FHL%20vs%20LH%2FLL%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_swing_trend_state%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20return%20_structure_state%28s%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.swing_trend_state%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Long%20on%20higher%20highs%2C%20flat%20when%20mixed%22%2C%0A%20%20%20%20rationale%3D%22The%20family%27s%20minimal%20hypothesis%2C%20and%20deliberately%20the%20dullest%3A%20no%20event%20and%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22breakout%2C%20just%20the%20classic%20Dow%20classification.%20Long%20while%20the%20last%20two%20confirmed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22pivots%20are%20a%20higher%20high%20AND%20a%20higher%20low%2C%20short%20in%20the%20mirror%20case%2C%20and%20flat%20when%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20structure%20is%20mixed.%20It%20serves%20as%20the%20BENCHMARK%3A%20if%20the%20event%20hypotheses%20do%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22beat%20this%2C%20what%20they%20are%20capturing%20is%20the%20underlying%20trend%20and%20not%20the%20liquidity%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mechanism%20they%20claim%20to%20exploit.%20Being%20flat%20on%20mixed%20structure%20is%20the%20part%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22contributes%2C%20because%20that%20is%20where%20trend%20following%20loses%20money.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%2C%20dominated%20by%20BTC%27s%20historical%20bullish%20bias%2C%20with%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22substantial%20amount%20of%20time%20out%20of%20the%20market%20%28more%20than%2025%25%20of%20candles%29.%20We%20expect%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22short%20side%20to%20have%20a%20negative%20or%20nil%20edge%20on%20its%20own%3A%20if%20the%20shorts%20contribute%20as%20much%20%22%0A%20%20%20%20%20%20%20%20%20%20%22as%20the%20longs%2C%20the%20data%20period%20should%20be%20treated%20with%20suspicion%20rather%20than%20celebrated.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22It%20is%20refuted%20as%20a%20useful%20benchmark%20if%20its%20result%20is%20indistinguishable%20from%20buying%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22sitting%20still.%22%2C%0A%20%20%20%20fn%3D_swing_trend_state%2C%0A%20%20%20%20params%3D%7B%22fractal_k%22%3A%20_K%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%206.%20Liquidity%20sweep%3A%20false%20break%20of%20the%2020%20channel%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_sweep_reversal_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%2C%20hi%2C%20lo%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20short_ev%20%3D%20_gt%28hi%2C%20hh%29%20%26%20_lt%28c%2C%20hh%29%20%20%20%20%23%20pierces%20the%20previous%20high%20and%20closes%20below%20it%0A%20%20%20%20long_ev%20%3D%20_lt%28lo%2C%20ll%29%20%26%20_gt%28c%2C%20ll%29%20%20%20%20%20%23%20pierces%20the%20previous%20low%20and%20closes%20above%20it%0A%20%20%20%20return%20_hold_n%28long_ev%2C%20short_ev%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.sweep_reversal_20%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20break%20that%20closes%20back%20inside%22%2C%0A%20%20%20%20rationale%3D%22The%20opposite%20face%20of%20%60donchian_break_20%60%2C%20on%20the%20SAME%20level%20and%20on%20purpose.%20If%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22liquidity%20is%20piled%20up%20just%20behind%20the%2020-candle%20extreme%2C%20there%20is%20a%20participant%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22with%20a%20direct%20incentive%20to%20go%20and%20get%20it%3A%20whoever%20needs%20to%20execute%20size%20and%20can%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22only%20do%20so%20against%20everybody%20else%27s%20stops.%20The%20observable%20signature%20is%20a%20candle%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20pierces%20the%20level%20on%20the%20high%20but%20closes%20INSIDE%20the%20range%3A%20the%20stops%20were%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22filled%2C%20there%20was%20no%20continuation%20behind%20them%20and%20price%20comes%20back.%20Closing%20inside%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20the%20key%20condition%2C%20because%20it%20separates%20absorption%20from%20a%20genuine%20break.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20short-lived%20positive%20edge%20%E2%80%94concentrated%20in%20the%20first%20candles%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%2210-candle%20horizon%E2%80%94%20with%20a%20HIGH%20hit%20rate%20and%20a%20small%20average%20gain%2C%20the%20inverse%20profile%20%22%0A%20%20%20%20%20%20%20%20%20%20%22to%20the%20breakout%27s.%20We%20expect%20it%20to%20fail%20in%20strong%20trends%2C%20where%20the%20false%20break%20is%20only%20%22%0A%20%20%20%20%20%20%20%20%20%20%22a%20pause%20before%20continuing%2C%20and%20to%20fail%20on%201d%2C%20where%20a%20daily%20candle%20bundles%20too%20many%20%22%0A%20%20%20%20%20%20%20%20%20%20%22events%20for%20the%20close%20to%20mean%20%27absorption%27.%20If%20both%20this%20hypothesis%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60donchian_break_20%60%20come%20out%20positive%20over%20the%20same%20period%20and%20regime%2C%20the%20estimator%20%22%0A%20%20%20%20%20%20%20%20%20%20%22should%20be%20suspected%20before%20either%20of%20them%20is%20believed.%22%2C%0A%20%20%20%20fn%3D_sweep_reversal_20%2C%0A%20%20%20%20params%3D%7B%22channel%22%3A%2020%2C%20%22horizon%22%3A%20_HOLD%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%207.%20Retest%20of%20the%20broken%20level%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_retest_hold%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%2C%20hi%2C%20lo%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20ev_up%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20ev_dn%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%0A%20%20%20%20lvl_u%20%3D%20np.nan%0A%20%20%20%20ttl_u%20%3D%200%0A%20%20%20%20touched_u%20%3D%20False%0A%20%20%20%20lvl_d%20%3D%20np.nan%0A%20%20%20%20ttl_d%20%3D%200%0A%20%20%20%20touched_d%20%3D%20False%0A%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%23%20Everything%20read%20here%20is%20from%20candle%20i%20or%20from%20state%20accumulated%20over%20earlier%20candles.%0A%20%20%20%20%20%20%20%20brk_u%20%3D%20%28not%20np.isnan%28hh%5Bi%5D%29%29%20and%20c%5Bi%5D%20%3E%20hh%5Bi%5D%0A%20%20%20%20%20%20%20%20brk_d%20%3D%20%28not%20np.isnan%28ll%5Bi%5D%29%29%20and%20c%5Bi%5D%20%3C%20ll%5Bi%5D%0A%0A%20%20%20%20%20%20%20%20if%20brk_u%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20lvl_u%2C%20ttl_u%2C%20touched_u%20%3D%20hh%5Bi%5D%2C%20_HOLD%2C%20False%0A%20%20%20%20%20%20%20%20elif%20ttl_u%20%3E%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ttl_u%20-%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20lo%5Bi%5D%20%3C%3D%20lvl_u%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20touched_u%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20touched_u%20and%20c%5Bi%5D%20%3E%20lvl_u%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ev_up%5Bi%5D%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ttl_u%20%3D%200%0A%0A%20%20%20%20%20%20%20%20if%20brk_d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20lvl_d%2C%20ttl_d%2C%20touched_d%20%3D%20ll%5Bi%5D%2C%20_HOLD%2C%20False%0A%20%20%20%20%20%20%20%20elif%20ttl_d%20%3E%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ttl_d%20-%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20hi%5Bi%5D%20%3E%3D%20lvl_d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20touched_d%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20touched_d%20and%20c%5Bi%5D%20%3C%20lvl_d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ev_dn%5Bi%5D%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ttl_d%20%3D%200%0A%0A%20%20%20%20return%20_hold_n%28ev_up%2C%20ev_dn%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.retest_hold%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Trade%20the%20break%20only%20after%20its%20retest%22%2C%0A%20%20%20%20rationale%3D%22The%20broken%20level%20changes%20role%2C%20and%20there%20is%20a%20concrete%20flow%20reason%20for%20it%3A%20those%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22who%20sold%20at%20resistance%20and%20got%20trapped%20try%20to%20get%20out%20at%20their%20entry%20point%20when%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22price%20comes%20back%2C%20and%20those%20who%20missed%20the%20break%20have%20their%20reference%20there%20to%20buy%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22without%20chasing.%20Both%20act%20in%20the%20same%20place%20and%20in%20the%20same%20direction.%20The%20trading%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22condition%20is%20demanding%20on%20purpose%3A%20it%20has%20to%20break%2C%20COME%20BACK%20and%20touch%20the%20level%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22within%2010%20candles%2C%20and%20close%20on%20the%20right%20side%20again.%20If%20only%20the%20break%20mattered%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22this%20would%20add%20nothing%20over%20hypothesis%201.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20FEWER%20trades%20than%20the%20plain%20break%20and%20a%20better%20result%20per%20trade%2C%20because%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22retest%20filters%20out%20the%20breaks%20with%20no%20buyer%20behind%20them.%20We%20expect%20it%20to%20fail%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22most%20violent%20breaks%20%E2%80%94precisely%20the%20ones%20that%20contribute%20most%20to%20hypothesis%201%E2%80%94%20because%20%22%0A%20%20%20%20%20%20%20%20%20%20%22those%20never%20come%20back%20to%20touch%20the%20level%20and%20the%20filter%20discards%20them%3A%20if%20the%20breakout%20%22%0A%20%20%20%20%20%20%20%20%20%20%22effect%20is%20pure%20right%20tail%2C%20this%20filter%20should%20DESTROY%20the%20edge%20rather%20than%20improve%20it.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22That%20is%20the%20test%20that%20matters%2C%20and%20both%20conclusions%20are%20publishable.%22%2C%0A%20%20%20%20fn%3D_retest_hold%2C%0A%20%20%20%20params%3D%7B%22channel%22%3A%2020%2C%20%22retest_window%22%3A%20_HOLD%2C%20%22horizon%22%3A%20_HOLD%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%208.%20Breakout%20after%20channel%20compression%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_compression_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20width%20%3D%20hh%20-%20ll%0A%20%20%20%20min_width%20%3D%20talib.MIN%28_f%28np.nan_to_num%28width%2C%20nan%3Dnp.inf%29%29%2C%2060%29%0A%20%20%20%20%23%20%60width%60%20at%20i%20already%20depends%20only%20on%20candles%20%3C%20i%3B%20talib%27s%2060-window%20ends%20at%20i.%0A%20%20%20%20compressed%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28width%29%20%7C%20np.isnan%28min_width%29%20%7C%20np.isinf%28min_width%29%29%0A%20%20%20%20np.less_equal%28width%2C%20min_width%2C%20out%3Dcompressed%2C%20where%3Dok%29%0A%20%20%20%20return%20_hold%28compressed%20%26%20_gt%28c%2C%20hh%29%2C%20compressed%20%26%20_lt%28c%2C%20ll%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.compression_break%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Break%20with%20the%20channel%20at%20its%20narrowest%22%2C%0A%20%20%20%20rationale%3D%22A%20break%20only%20matters%20if%20there%20was%20contained%20disagreement%20beforehand.%20When%20the%20width%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22of%20the%2020%20channel%20falls%20to%20its%20lowest%20of%20the%20last%2060%20candles%2C%20buyers%20and%20sellers%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22have%20reached%20a%20narrow%20equilibrium%20and%20both%20camps%20have%20been%20stacking%20stops%20very%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22close%20by%2C%20a%20few%20ticks%20from%20price%20and%20from%20each%20other.%20Leaving%20that%20zone%20executes%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22both%20stop%20books%20in%20a%20chain%2C%20which%20is%20the%20only%20moment%20when%20a%20break%20drags%20along%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22volume%20disproportionate%20to%20the%20size%20of%20the%20preceding%20move.%20Compression%20does%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22predict%20direction%3A%20it%20only%20says%20that%20the%20move%20which%20resolves%20it%20will%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22disproportionate.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20an%20edge%20per%20trade%20HIGHER%20than%20%60donchian_break_20%60%27s%20with%20far%20fewer%20trades%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20that%20comparison%20is%20the%20hypothesis%27s%20real%20test%3A%20if%20the%20compression%20filter%20improves%20%22%0A%20%20%20%20%20%20%20%20%20%20%22nothing%2C%20the%20twin-stop-book%20idea%20is%20false%20and%20all%20we%20were%20doing%20was%20trading%20less.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20it%20to%20fail%20after%20violent%20falls%2C%20where%20the%20compression%20appears%20through%20exhaustion%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20not%20through%20equilibrium%2C%20and%20on%201d%2C%20where%2060%20candles%20are%20two%20months%20and%20the%20width%20%22%0A%20%20%20%20%20%20%20%20%20%20%22minimum%20arrives%20late.%22%2C%0A%20%20%20%20fn%3D_compression_break%2C%0A%20%20%20%20params%3D%7B%22channel%22%3A%2020%2C%20%22compression_window%22%3A%2060%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%209.%20Volume-confirmed%20breakout%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_volume_confirmed_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20v_avg%20%3D%20talib.SMA%28v%2C%2020%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20includes%20candle%20i%3A%20a%20datum%20available%20at%20i%0A%20%20%20%20strong%20%3D%20_gt%28v%2C%20v_avg%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20hh%29%20%26%20strong%2C%20_lt%28c%2C%20ll%29%20%26%20strong%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.volume_confirmed_break%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Only%20the%20break%20that%20volume%20confirms%22%2C%0A%20%20%20%20rationale%3D%22If%20the%20breakout%20mechanism%20is%20the%20cascading%20execution%20of%20accumulated%20orders%2C%20then%20it%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22has%20a%20compulsory%20fingerprint%3A%20volume.%20A%20break%20on%20volume%20below%20its%2020-period%20average%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22means%20there%20was%20nobody%20waiting%20at%20that%20level%2C%20that%20price%20got%20there%20by%20drift%20and%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22by%20execution%2C%20and%20that%20there%20is%20therefore%20no%20forced%20flow%20to%20continue%20the%20move.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Volume%20is%20not%20used%20here%20as%20an%20indicator%20but%20as%20a%20VERIFICATION%20of%20the%20mechanism%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hypotheses%201%20and%208%20take%20for%20granted.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20and%2C%20above%20all%2C%20an%20edge%20per%20trade%20GREATER%20than%20unfiltered%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60donchian_break_20%60%27s.%20If%20the%20volume%20filter%20improves%20nothing%2C%20the%20order-cascade%20%22%0A%20%20%20%20%20%20%20%20%20%20%22explanation%20is%20seriously%20weakened%20for%20every%20breakout%20hypothesis%20in%20this%20family%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20is%20a%20more%20valuable%20result%20than%20the%20hypothesis%20itself.%20We%20expect%20it%20to%20fail%20on%201d%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22where%20BTC%27s%20daily%20volume%20is%20dominated%20by%20the%20weekly%20cycle%20and%20by%20the%20split%20across%20%22%0A%20%20%20%20%20%20%20%20%20%20%22exchanges%2C%20not%20by%20the%20breakout%20event.%22%2C%0A%20%20%20%20fn%3D_volume_confirmed_break%2C%0A%20%20%20%20params%3D%7B%22channel%22%3A%2020%2C%20%22volume_average%22%3A%2020%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2010.%20Breakout%20with%20an%20ATR%20buffer%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_atr_buffered_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20c%2C%2014%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20hh%20%2B%200.5%20%2A%20atr%29%2C%20_lt%28c%2C%20ll%20-%200.5%20%2A%20atr%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.atr_buffered_break%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Break%20half%20an%20ATR%20past%20the%20level%22%2C%0A%20%20%20%20rationale%3D%22A%20direct%20complement%20to%20%60sweep_reversal_20%60%20and%20an%20explicit%20test%20of%20hypothesis%201.%20If%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22it%20is%20true%20that%20the%20stops%20pile%20up%20just%20behind%20the%20level%20and%20that%20somebody%20goes%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22looking%20for%20them%2C%20then%20the%20MARGINAL%20break%20%E2%80%94the%20one%20that%20pokes%20a%20few%20ticks%20above%E2%80%94%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22systematically%20the%20worst%2C%20because%20it%20is%20exactly%20the%20one%20produced%20by%20whoever%20wants%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20sell.%20Requiring%20the%20close%20to%20clear%20the%20level%20by%20half%20a%2014-candle%20ATR%20discards%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20zone%20without%20changing%20anything%20else%20about%20the%20rule%2C%20and%20it%20makes%20the%20buffer%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22adapt%20to%20volatility%20on%20its%20own%20instead%20of%20fixing%20an%20arbitrary%20percentage.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20and%20a%20larger%20one%20per%20trade%20than%20the%20break%20without%20a%20buffer%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20this%20is%20the%20comparison%20that%20matters.%20Since%20%60sweep_reversal_20%60%20claims%20the%20discarded%20%22%0A%20%20%20%20%20%20%20%20%20%20%22zone%20has%20a%20NEGATIVE%20edge%2C%20the%20two%20hypotheses%20have%20to%20be%20consistent%20with%20each%20other%3A%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20sweep%20turns%20out%20profitable%20but%20the%20buffer%20does%20not%20improve%20the%20break%2C%20or%20the%20other%20%22%0A%20%20%20%20%20%20%20%20%20%20%22way%20round%2C%20one%20of%20the%20two%20is%20measuring%20something%20else.%20We%20expect%20the%20buffer%20to%20hurt%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%221d%2C%20where%20half%20a%20daily%20ATR%20is%20an%20enormous%20move%20and%20entering%20that%20late%20gives%20away%20most%20%22%0A%20%20%20%20%20%20%20%20%20%20%22of%20the%20displacement.%22%2C%0A%20%20%20%20fn%3D_atr_buffered_break%2C%0A%20%20%20%20params%3D%7B%22channel%22%3A%2020%2C%20%22atr%22%3A%2014%2C%20%22atr_buffer%22%3A%200.5%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2011.%20GAP%20LEFT%20BY%20A%20HYPOTHESIS%20WITHDRAWN%20IN%20THE%20AUDIT%20%282026-09-08%29%0A%23%0A%23%20%60structure.inside_bar_break%60%20used%20to%20be%20here.%20It%20has%20been%20DELETED%20for%20being%20an%20exact%20DUPLICATE%20of%0A%23%20%60candles.inside_bar_break%60%3A%20same%20containment%20condition%20%28candle%20i-1%20inside%20candle%20i-2%29%2C%20same%0A%23%20breakout%20level%20%28the%20extremes%20of%20the%20mother%20candle%2C%20i-2%29%20and%20same%20confirmation%20%28the%20close%20of%20i%29.%0A%23%20The%20only%20things%20separating%20them%20were%20%60%3C%60%20versus%20%60%3C%3D%60%20in%20the%20containment%20and%20the%20holding%20horizon%0A%23%20%2810%20candles%20here%2C%20a%201-candle%20pulse%20there%29.%20Measured%20against%20data%2C%20this%20hypothesis%27s%20event%20set%20was%0A%23%20a%20STRICT%20SUBSET%20of%20the%20other%27s%3A%20244%20out%20of%20244%20events%20matched%20candle%20for%20candle.%0A%23%0A%23%20Why%20it%20mattered%2C%20and%20why%20this%20is%20not%20cosmetic.%20A%20pre-registration%20is%20only%20worth%20anything%20if%20the%0A%23%20number%20of%20trials%20entering%20the%20multiple-comparisons%20correction%20is%20the%20number%20of%20DISTINCT%20BETS.%0A%23%20Registering%20the%20same%20bet%20in%20two%20families%20counts%20it%20twice%2C%20and%20since%20the%20two%20also%20share%20almost%20all%0A%23%20their%20signals%2C%20their%20results%20are%20correlated%3A%20if%20the%20pattern%20works%20by%20chance%20it%20%22works%22%20twice%20and%0A%23%20looks%20like%20cross-family%20confirmation%20when%20it%20is%20the%20same%20observation%20repeated.%20That%20is%20exactly%0A%23%20the%20bias%20this%20registry%20exists%20to%20prevent%2C%20and%20the%20difference%20in%20horizon%20does%20not%20fix%20it%3A%20holding%0A%23%2010%20candles%20instead%20of%201%20multiplies%20each%20event%20into%20ten%20overlapping%20observations%20over%20almost%20the%0A%23%20same%20future%20window%2C%20which%20inflates%20%60n_signals%60%20without%20adding%20information%20%28that%20is%20what%0A%23%20%60effective_n%60%20is%20for%29.%0A%23%0A%23%20The%20%60candles%60%20version%20is%20kept%20because%20it%20is%20the%20superset%20%28non-strict%20containment%29%20and%20its%0A%23%20one-candle%20pulse%20is%20the%20clean%20encoding%20of%20the%20bet.%20The%20%60volatility.inside_bar_breakout%60%20variant%0A%23%20is%20NOT%20removed%3A%20it%20breaks%20the%20extremes%20of%20the%20INSIDE%20candle%2C%20not%20the%20mother%27s%2C%20which%20is%20a%0A%23%20different%20level%20and%20a%20different%20mechanical%20claim%3B%20it%20is%20declared%20as%20a%20dependent%20trial%20in%0A%23%20%60volatility%60%27s%20own%20file.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2012.%20Fading%20the%20extremes%20when%20the%20structure%20is%20NOT%20trending%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_range_fade_swing%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20_%2C%20pl1%2C%20_%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20mixed%20%3D%20_structure_state%28s%29%20%3D%3D%200%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20neither%20HH%2BHL%20nor%20LH%2BLL%0A%20%20%20%20%23%20%60_fresh%60%3A%20the%20event%20is%20the%20TOUCH%20of%20the%20extreme%2C%20not%20the%20state%20of%20being%20beyond%20it.%0A%20%20%20%20short_ev%20%3D%20mixed%20%26%20_fresh%28_gt%28c%2C%20ph1%29%29%0A%20%20%20%20long_ev%20%3D%20mixed%20%26%20_fresh%28_lt%28c%2C%20pl1%29%29%0A%20%20%20%20return%20_hold_n%28long_ev%2C%20short_ev%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.range_fade_swing%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20swing%20extremes%20in%20mixed%20structure%22%2C%0A%20%20%20%20rationale%3D%22Deliberately%20contradicts%20%60bos_swing%60%20on%20the%20same%20level%2C%20and%20only%20activates%20where%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20one%20should%20be%20weakest%3A%20when%20the%20sequence%20of%20pivots%20is%20mixed%20and%20there%20is%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22directional%20structure.%20The%20reasoning%20is%20about%20inventory.%20With%20no%20trend%20to%20absorb%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whoever%20provides%20liquidity%20at%20the%20swing%20extremes%20runs%20no%20risk%20of%20ending%20up%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22wrong%20side%20of%20a%20sustained%20move%2C%20so%20they%20can%20defend%20those%20levels%20with%20size%3B%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22break%20finds%20no%20continuation%20and%20price%20reverts%20towards%20the%20middle%20of%20the%20range.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22strong%20claim%20is%20not%20%27ranges%20revert%27%2C%20but%20that%20the%20SAME%20signal%20changes%20sign%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22according%20to%20the%20structural%20state.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20ONLY%20under%20the%20mixed-structure%20filter%2C%20and%20we%20explicitly%20%22%0A%20%20%20%20%20%20%20%20%20%20%22expect%20the%20same%20rule%20without%20that%20filter%20to%20give%20a%20negative%20edge.%20AUDIT%20NOTE%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%282026-09-08%29%3A%20that%20unfiltered%20rule%20was%20not%20registered%2C%20so%20this%20hypothesis%27s%20central%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsification%20criterion%20could%20not%20be%20run%3B%20it%20has%20been%20registered%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60structure.swing_fade_unfiltered%60%20and%20that%20is%20what%20it%20must%20be%20measured%20against.%20A%20%22%0A%20%20%20%20%20%20%20%20%20%20%225-candle%20fractal%20leaves%20the%20level%20very%20close%20to%20price%2C%20so%20we%20expect%20MANY%20trades%20and%20for%20%22%0A%20%20%20%20%20%20%20%20%20%20%22costs%20to%20eat%20a%20small%20gross%20edge%3A%20if%20the%20net%20edge%20does%20not%20survive%20realistic%20commissions%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20spread%2C%20the%20hypothesis%20is%20refuted%20even%20if%20the%20gross%20one%20is%20positive%2C%20and%20it%20is%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%22legitimate%20to%20rescue%20it%20by%20raising%20k.%20We%20expect%20it%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22fail%20at%20regime%20turns%2C%20where%20the%20structure%20looks%20mixed%20exactly%20while%20the%20new%20trend%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22being%20built%3A%20there%20the%20fades%20execute%20against%20the%20initial%20impulse%20and%20should%20be%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22worst%20trades%20in%20the%20whole%20family.%20If%20the%20result%20is%20positive%20both%20here%20and%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60bos_swing%60%20without%20the%20regime%20separating%20them%2C%20the%20filter%20is%20doing%20nothing%20and%20both%20%22%0A%20%20%20%20%20%20%20%20%20%20%22conclusions%20must%20be%20discarded.%22%2C%0A%20%20%20%20fn%3D_range_fade_swing%2C%0A%20%20%20%20params%3D%7B%22fractal_k%22%3A%20_K%2C%20%22filter%22%3A%20%22mixed%20structure%22%2C%20%22horizon%22%3A%20_HOLD%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2012b.%20CONTROL%20ADDED%20IN%20THE%20AUDIT%20%282026-09-08%29%20so%20that%20%60range_fade_swing%60%20is%20falsifiable.%0A%23%0A%23%20What%20was%20wrong.%20The%20prior%20of%20%60structure.range_fade_swing%60%20says%2C%20literally%2C%20that%20it%20expects%20a%0A%23%20positive%20edge%20%22ONLY%20under%20the%20mixed-structure%20filter%22%20and%20that%20%22the%20same%20rule%20without%20that%20filter%0A%23%20gives%20a%20negative%20edge%22.%20That%20is%20its%20falsification%20criterion%20and%20it%20is%20the%20right%20one%3A%20the%20strong%0A%23%20claim%20is%20not%20that%20fading%20extremes%20wins%2C%20but%20that%20the%20STRUCTURAL%20STATE%20changes%20the%20sign.%20The%0A%23%20problem%20was%20that%20the%20unfiltered%20rule%20was%20registered%20nowhere%2C%20so%20the%20test%20could%20not%20be%20run%3A%20a%0A%23%20prior%20whose%20failure%20criterion%20names%20a%20control%20that%20does%20not%20exist%20cannot%20fail%2C%20and%20a%20prior%20that%0A%23%20cannot%20fail%20is%20not%20a%20prior.%20The%20control%20is%20registered%20here%2C%20with%20its%20own%20prior%20and%20counting%20as%0A%23%20one%20more%20trial%20in%20the%20multiple-comparisons%20correction.%0A%23%20--------------------------------------------------------------------------------------------%0A%0Adef%20_swing_fade_unfiltered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20_%2C%20pl1%2C%20_%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20%23%20Identical%20to%20%60range_fade_swing%60%20except%20for%20the%20absence%20of%20the%20%60mixed%60%20filter.%0A%20%20%20%20return%20_hold_n%28_fresh%28_lt%28c%2C%20pl1%29%29%2C%20_fresh%28_gt%28c%2C%20ph1%29%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22structure.swing_fade_unfiltered%22%2C%0A%20%20%20%20family%3D%22structure%22%2C%0A%20%20%20%20title%3D%22Fade%20the%20swing%20extremes%20in%20any%20structure%22%2C%0A%20%20%20%20rationale%3D%22Unconditional%20control%20for%20%60range_fade_swing%60%3A%20fading%20the%20touch%20of%20the%20last%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22confirmed%20pivot%20in%20ALL%20structural%20states%2C%20not%20only%20when%20the%20sequence%20is%20mixed.%20It%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22claims%20no%20mechanism%20of%20its%20own%20%E2%80%94on%20the%20contrary%2C%20the%20inventory%20mechanism%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22justifies%20the%20fade%20only%20holds%20when%20there%20is%20no%20trend%20to%20absorb%E2%80%94%20and%20it%20is%20here%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22because%20a%20conditional%20claim%20is%20only%20testable%20if%20the%20unconditional%20case%20is%20measured%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22too.%20Without%20this%20control%2C%20a%20positive%20result%20for%20%60range_fade_swing%60%20would%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22distinguish%20%27the%20structural%20filter%20contributes%27%20from%20%27fading%20swing%20extremes%20always%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22wins%20and%20the%20filter%20is%20decorative%27.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20NEGATIVE%20edge%2C%20and%20we%20are%20committed%20to%20that%20sign%20in%20advance%3A%20without%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22filter%2C%20the%20same%20rule%20goes%20short%20against%20every%20breakout%20of%20a%20live%20trend%2C%20which%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22declared%20failure%20mode%20of%20all%20fading.%20The%20joint%20reading%20is%20what%20matters%20and%20it%20is%20fixed%20%22%0A%20%20%20%20%20%20%20%20%20%20%22now%3A%20if%20this%20one%20comes%20out%20negative%20and%20%60range_fade_swing%60%20positive%2C%20the%20structural%20%22%0A%20%20%20%20%20%20%20%20%20%20%22state%20does%20separate%20regimes%20and%20the%20conditional%20claim%20holds%3B%20if%20both%20come%20out%20similar%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20filter%20does%20nothing%20and%20both%20must%20be%20discarded%3B%20if%20this%20one%20comes%20out%20POSITIVE%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22what%20we%20have%20is%20generic%20mean%20reversion%20at%20the%20swing%20extremes%20and%20%60range_fade_swing%60%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%22inventory%20argument%20is%20false%20even%20if%20its%20number%20is%20good.%22%2C%0A%20%20%20%20fn%3D_swing_fade_unfiltered%2C%0A%20%20%20%20params%3D%7B%22fractal_k%22%3A%20_K%2C%20%22filter%22%3A%20%22none%22%2C%20%22horizon%22%3A%20_HOLD%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=958f6748c95f3938991b592302ae3d5ff11f513f3db0b274ae7a93d48b05e9cf\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":16,"row_hash":"d86e72c940afdc9008588968fa0b004101c063ff315c41e1a18720b90771f5f0","body":"wavelab-journal-chain\nv=3\nseq=16\nprev=74102be0adb0214051264484e26796ad66b1169b153f83646da17e4ed0a697d6\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nprereg_seq=2\nsource_text=%22%22%22%60trend%60%20family%3A%20trend%20following.%20PRE-REGISTRATION%20%E2%80%94%20written%20before%20looking%20at%20a%20single%20number.%0A%0ANone%20of%20these%20twelve%20hypotheses%20has%20been%20run.%20The%20parameters%20are%20the%20conventional%20ones%20from%20the%0Aliterature%20%28EMA%2021%2F55%2F200%2C%20MACD%2012%2F26%2F9%2C%20ADX%2FDMI%2014%2C%20ATR%2014%2C%20Donchian%2055%2F20%20from%20Turtle%20System%202%2C%0AIchimoku%209%2F26%2F52%2C%20Aroon%2025%2C%20SAR%200.02%2F0.2%29.%20There%20are%20no%20variants%20of%20the%20same%20parameter%3A%20where%20two%0Anumbers%20appear%20%28Donchian%27s%2055%2F20%2C%20Supertrend%27s%203xATR%29%20they%20are%20a%20pair%20published%20as%20a%20unit%2C%20and%20the%0A%60rationale%60%20says%20why%20they%20are%20one%20hypothesis%20and%20not%20a%20grid.%0A%0AThe%20family%20shares%20a%20single%20question%3A%20%2A%2Awhy%20would%20a%20trend%20persist%3F%2A%2A%20Each%20hypothesis%20proposes%20a%0ADIFFERENT%20mechanism%20%28order%20slicing%2C%20agreement%20across%20horizons%2C%20a%20reflexive%20focal%20point%2C%20flow%0Aacceleration%2C%20the%20resolution%20of%20disagreement%2C%20a%20stop%20cascade%2C%20stop%20distance%2C%20renewal%20of%20extremes%2C%0Adrift%20over%20noise%2C%20the%20allocation%20horizon%29.%20Several%20of%20them%20predict%20results%20that%20CONTRADICT%20one%0Aanother%20%28e.g.%20%60supertrend%60%20vs%20%60psar%60%20on%20whether%20to%20give%20the%20position%20room%20or%20tighten%20the%20stop%29.%0AThat%20is%20deliberate%3A%20if%20they%20could%20all%20win%20at%20once%2C%20none%20of%20them%20would%20be%20falsifiable.%0A%0ACausality.%20Every%20indicator%20here%20is%20a%20backward-looking%20window%20function.%20The%20only%20shift%20used%20is%0A%60_lag%28a%2C%20k%29%60%20with%20k%20%3E%3D%201%2C%20which%20brings%20the%20value%20from%20k%20bars%20ago%20to%20the%20current%20index%3B%20there%20is%20no%0Anegative%20shift%2C%20no%20%60np.roll%60%2C%20and%20no%20extreme%20detector%20defined%20against%20the%20whole%20array.%20Two%20places%0Adeserve%20to%20be%20spelled%20out%3A%0A%0A%20%20-%20Donchian%3A%20%60talib.MAX%28high%2C%2055%29%5Bi%5D%60%20INCLUDES%20bar%20i%2C%20so%20comparing%20%60close%5Bi%5D%60%20against%20it%20would%20not%0A%20%20%20%20break%20%E2%80%94%20but%20it%20fails%20to%20break%20for%20the%20wrong%20reason%20%28%60high%5Bi%5D%20%3E%3D%20close%5Bi%5D%60%20always%29.%20The%0A%20%20%20%20reference%20channel%20is%20lagged%20by%20one%20bar%20so%20that%20it%20is%20the%20maximum%20of%20the%2055%20PRECEDING%20bars.%0A%20%20-%20Ichimoku%3A%20the%20cloud%20is%20displaced%20by%20%2B26.%20That%20means%20TODAY%27s%20level%20was%20computed%20from%20data%2026%0A%20%20%20%20bars%20old.%20It%20is%20past%20information%20drawn%20forward%2C%20never%20future%20information.%0A%0ANaN.%20talib%20returns%20NaN%20during%20warm-up.%20%60nan_to_num%60%20is%20used%20nowhere%20here%3A%20an%20explicit%20mask%20is%20built%0Awith%20%60np.isfinite%60%20and%20signals%20are%20written%20only%20where%20ALL%20the%20inputs%20are%20finite.%20Filling%20a%20NaN%20with%0A0%20or%20with%201e18%20invents%20signals%20at%20the%20start%20of%20the%20series.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20utilities%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_f64%28a%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22talib%20requires%20contiguous%20float64.%22%22%22%0A%20%20%20%20return%20np.ascontiguousarray%28a%2C%20dtype%3Dnp.float64%29%0A%0A%0Adef%20_lag%28a%3A%20np.ndarray%2C%20k%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22The%20value%20from%20%60k%60%20bars%20ago%2C%20read%20at%20the%20current%20bar.%20k%20%3E%3D%201%2C%20ALWAYS%20into%20the%20past.%0A%0A%20%20%20%20The%20head%20is%20left%20as%20NaN%20on%20purpose%3A%20there%20is%20no%20past%20value%20to%20bring%20forward%2C%20and%20any%20fill%0A%20%20%20%20would%20manufacture%20signal%20where%20there%20is%20no%20information.%0A%20%20%20%20%22%22%22%0A%20%20%20%20if%20k%20%3C%201%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28%22_lag%20only%20shifts%20into%20the%20past%20%28k%20%3E%3D%201%29%22%29%0A%20%20%20%20out%20%3D%20np.full%28a.shape%2C%20np.nan%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20if%20k%20%3C%20a.size%3A%0A%20%20%20%20%20%20%20%20out%5Bk%3A%5D%20%3D%20a%5B%3A%20a.size%20-%20k%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_ok%28%2Aarrays%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Mask%20of%20the%20positions%20where%20every%20input%20is%20finite.%22%22%22%0A%20%20%20%20m%20%3D%20np.isfinite%28arrays%5B0%5D%29%0A%20%20%20%20for%20a%20in%20arrays%5B1%3A%5D%3A%0A%20%20%20%20%20%20%20%20m%20%26%3D%20np.isfinite%28a%29%0A%20%20%20%20return%20m%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%201.%20two-moving-average%20cross%3A%20order%20slicing%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_ema_cross_21_55%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20fast%20%3D%20talib.EMA%28c%2C%2021%29%0A%20%20%20%20slow%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20ok%20%3D%20_ok%28fast%2C%20slow%29%0A%20%20%20%20out%5Bok%20%26%20%28fast%20%3E%20slow%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28fast%20%3C%20slow%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.ema_cross_21_55%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Side%20with%20the%20faster%20of%20two%20averages%22%2C%0A%20%20%20%20rationale%3D%22New%20information%20is%20not%20incorporated%20within%20one%20candle%20because%20the%20large%20participant%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cannot%20execute%20within%20one%20candle%3A%20a%20mandate%20of%20any%20size%20is%20sliced%20over%20days%20so%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20to%20move%20the%20price%20against%20itself%2C%20so%20today%27s%20buyer%20is%20also%20tomorrow%27s%20buyer.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22That%20slicing%20leaves%20positive%20autocorrelation%20in%20the%20drift%20at%20the%20scale%20of%20weeks.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20EMA21%2FEMA55%20cross%20predicts%20nothing%3A%20it%20merely%20declares%20that%20the%20flow%20imbalance%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20still%20live%2C%20and%20it%20gets%20paid%20for%20as%20long%20as%20the%20same%20participant%20keeps%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22executing.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20a%20trending%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20range%2C%20with%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22loss%20concentrated%20in%20a%20few%20weeks%20of%20whipsaw.%20If%20the%20edge%20were%20positive%20in%20ranges%20too%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20slicing%20mechanism%20would%20be%20false%20and%20we%20would%20be%20measuring%20something%20else.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22Falsifiable%20cross-prediction%3A%20the%20effect%20must%20degrade%20as%20the%20timeframe%20drops%2C%20because%20%22%0A%20%20%20%20%20%20%20%20%20%20%22sliced%20institutional%20execution%20does%20not%20live%20at%20the%2015m%20scale.%22%2C%0A%20%20%20%20fn%3D_ema_cross_21_55%2C%0A%20%20%20%20params%3D%7B%22fast%22%3A%2021%2C%20%22slow%22%3A%2055%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%202.%20three%20horizons%20aligned%3A%20the%20opposing%20liquidity%20withdraws%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_ema_stack_21_55_200%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20e21%20%3D%20talib.EMA%28c%2C%2021%29%0A%20%20%20%20e55%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20e200%20%3D%20talib.EMA%28c%2C%20200%29%0A%20%20%20%20ok%20%3D%20_ok%28e21%2C%20e55%2C%20e200%29%0A%20%20%20%20out%5Bok%20%26%20%28e21%20%3E%20e55%29%20%26%20%28e55%20%3E%20e200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28e21%20%3C%20e55%29%20%26%20%28e55%20%3C%20e200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.ema_stack_21_55_200%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Only%20when%20all%20three%20horizons%20agree%22%2C%0A%20%20%20%20rationale%3D%22Each%20horizon%20belongs%20to%20a%20different%20participant%3A%20intraday%2C%20swing%20and%20allocator.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22While%20they%20disagree%2C%20whoever%20is%20positioned%20against%20the%20move%20provides%20the%20liquidity%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20absorbs%20whoever%20is%20positioned%20with%20it%2C%20and%20price%20reverts.%20When%20all%20three%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22agree%2C%20nobody%20is%20left%20structurally%20obliged%20to%20sell%20into%20the%20advance%2C%20depth%20on%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22opposite%20side%20withdraws%20and%20the%20SAME%20flow%20moves%20more%20price.%20The%20hypothesis%20is%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22about%20moving%20averages%20but%20about%20the%20absence%20of%20a%20natural%20counterparty.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20far%20fewer%20bars%20in%20the%20market%20than%20trend.ema_cross_21_55%20and%20better%20%22%0A%20%20%20%20%20%20%20%20%20%20%22performance%20PER%20BAR.%20Falsifiable%20in%20two%20ways%3A%20if%20time%20in%20market%20does%20not%20fall%20clearly%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20agreement%20condition%20is%20filtering%20nothing%3B%20and%20if%20per-bar%20performance%20does%20not%20beat%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20plain%20cross%2C%20the%20%27absence%20of%20counterparty%27%20adds%20nothing.%20We%20expect%20it%20to%20go%20flat%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20give%20up%20the%20whole%20opening%20move%20at%20every%20regime%20change%2C%20because%20the%20EMA200%20aligns%20%22%0A%20%20%20%20%20%20%20%20%20%20%22late.%22%2C%0A%20%20%20%20fn%3D_ema_stack_21_55_200%2C%0A%20%20%20%20params%3D%7B%22short%22%3A%2021%2C%20%22medium%22%3A%2055%2C%20%22long%22%3A%20200%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D600%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%203.%20the%20200%20average%3A%20a%20reflexive%20focal%20point%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_ema200_filter%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20e200%20%3D%20talib.EMA%28c%2C%20200%29%0A%20%20%20%20ok%20%3D%20_ok%28c%2C%20e200%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20e200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20e200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.ema200_filter%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Long%20above%20the%20EMA%20200%2C%20short%20below%22%2C%0A%20%20%20%20rationale%3D%22The%20200%20average%20measures%20no%20physical%20property%20of%20the%20market%3A%20it%20is%20a%20public%20focal%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22point%20that%20risk%20desks%2C%20the%20financial%20press%20and%20allocation%20bots%20quote%20daily.%20Its%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22power%2C%20if%20it%20has%20any%2C%20is%20entirely%20reflexive%20%E2%80%94%20there%20are%20real%20mandates%20that%20cut%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exposure%20%27below%20the%20200%27%2C%20and%20that%20cut%20is%20genuine%20flow%20executed%20at%20the%20level.%20We%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22register%20the%20bare%20level%20and%20not%20the%20slope%20because%20for%20an%20EMA200%20the%20slope%20is%20very%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nearly%20a%20function%20of%20the%20cross%20itself%2C%20and%20adding%20it%20would%20be%20the%20same%20trial%20run%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22twice.%22%2C%0A%20%20%20%20prior%3D%22The%20prediction%20that%20matters%20is%20a%20cross-prediction%2C%20not%20one%20about%20profit%3A%20if%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22mechanism%20is%20reflexive%2C%20the%20effect%20must%20be%20LARGER%20on%201d%2C%20which%20is%20where%20the%20level%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22published%20and%20watched%2C%20and%20close%20to%20nil%20on%2015m%20and%201h.%20An%20edge%20equal%20to%20or%20greater%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%2215m%20would%20falsify%20the%20explanation%20even%20if%20the%20number%20came%20out%20profitable%2C%20and%20in%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22case%20the%20hypothesis%20must%20be%20declared%20failed%20despite%20making%20money.%20We%20expect%20a%20nil%20or%20%22%0A%20%20%20%20%20%20%20%20%20%20%22negative%20edge%20in%20periods%20without%20a%20secular%20trend.%22%2C%0A%20%20%20%20fn%3D_ema200_filter%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%20200%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D600%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%204.%20MACD%3A%20acceleration%20of%20the%20imbalance%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_macd_12_26_9%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20macd%2C%20signal%2C%20_%20%3D%20talib.MACD%28c%2C%2012%2C%2026%2C%209%29%0A%20%20%20%20ok%20%3D%20_ok%28macd%2C%20signal%29%0A%20%20%20%20out%5Bok%20%26%20%28macd%20%3E%20signal%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28macd%20%3C%20signal%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.macd_12_26_9%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Trade%20MACD%20acceleration%2C%20not%20the%20level%22%2C%0A%20%20%20%20rationale%3D%22The%20MACD%20against%20its%20signal%20line%20measures%20the%20ACCELERATION%20of%20the%20flow%20imbalance%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20its%20level.%20Systematic%20momentum%20programmes%20scale%20size%20continuously%20as%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22function%20of%20the%20signal%20rather%20than%20in%20binary%20fashion%3A%20when%20the%20drift%20accelerates%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22they%20add%20to%20the%20position%2C%20and%20that%20addition%20is%20literally%20tomorrow%27s%20drift.%20The%20bet%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20that%20this%20feedback%20loop%20shows%20up%20in%20the%20second%20derivative%20before%20it%20shows%20up%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22price.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20more%20position%20changes%20and%20a%20lower%20hit%20rate%20per%20trade%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trend.ema_cross_21_55%2C%20and%20a%20similar%20GROSS%20edge%20that%20may%20disappear%20net%20of%20costs.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22Directly%20falsifiable%3A%20if%20the%20MACD%20does%20not%20beat%20the%20moving-average%20cross%20net%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%27anticipating%20through%20acceleration%27%20has%20no%20content%20and%20it%20is%20an%20expensive%20moving%20%22%0A%20%20%20%20%20%20%20%20%20%20%22average.%20We%20expect%20a%20clearly%20negative%20edge%20in%20a%20low-volatility%20range%2C%20where%20%22%0A%20%20%20%20%20%20%20%20%20%20%22acceleration%20is%20only%20noise.%22%2C%0A%20%20%20%20fn%3D_macd_12_26_9%2C%0A%20%20%20%20params%3D%7B%22fast%22%3A%2012%2C%20%22slow%22%3A%2026%2C%20%22signal%22%3A%209%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%205.%20ADX%2FDMI%3A%20the%20dispersion%20of%20opinion%20has%20resolved%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_adx_dmi_14%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20adx%20%3D%20talib.ADX%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20pdi%20%3D%20talib.PLUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20mdi%20%3D%20talib.MINUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_ok%28adx%2C%20pdi%2C%20mdi%29%0A%20%20%20%20strong%20%3D%20ok%20%26%20%28adx%20%3E%3D%2025.0%29%0A%20%20%20%20out%5Bstrong%20%26%20%28pdi%20%3E%20mdi%29%5D%20%3D%201%0A%20%20%20%20out%5Bstrong%20%26%20%28mdi%20%3E%20pdi%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.adx_dmi_14%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Trade%20direction%20only%20above%20ADX%2025%22%2C%0A%20%20%20%20rationale%3D%22Separates%20two%20questions%20that%20moving%20averages%20run%20together%3A%20is%20there%20a%20trend%3F%20%28ADX%29%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20in%20which%20direction%3F%20%28DMI%29.%20The%20proposed%20mechanism%20is%20that%20persistence%20only%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22appears%20once%20the%20dispersion%20of%20opinion%20has%20already%20resolved%3A%20if%20most%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22aggressive%20volume%20arrives%20on%20the%20same%20side%2C%20the%20market%20maker%20accumulates%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22directional%20inventory%20and%20hedges%20IN%20THE%20SAME%20DIRECTION%2C%20amplifying%20the%20very%20move%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20is%20hurting%20him.%20Below%20ADX%2025%20there%20are%20two%20camps%20of%20similar%20size%20and%20the%20flow%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cancels%20out%20without%20leaving%20any%20drift.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20edge%20to%20come%20from%20AVOIDING%20the%20range%2C%20not%20from%20getting%20the%20direction%20%22%0A%20%20%20%20%20%20%20%20%20%20%22right%20more%20often.%20Explicit%20falsifiable%20test%3A%20per-bar%20performance%20INSIDE%20the%20filter%20must%20%22%0A%20%20%20%20%20%20%20%20%20%20%22beat%20that%20of%20the%20bars%20the%20filter%20discards%3B%20if%20it%20does%20not%2C%20the%20ADX%20carries%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%22information%20and%20the%20hypothesis%20dies%20even%20if%20the%20overall%20result%20is%20positive.%20We%20expect%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20to%20enter%20late%20and%20give%20up%20a%20large%20part%20of%20the%20start%20of%20every%20trend%2C%20because%20the%20ADX%20%22%0A%20%20%20%20%20%20%20%20%20%20%22needs%20a%20move%20that%20has%20already%20happened%20in%20order%20to%20climb%20above%2025.%22%2C%0A%20%20%20%20fn%3D_adx_dmi_14%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2014%2C%20%22adx_threshold%22%3A%2025%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%206.%20Donchian%2055%2F20%3A%20stop%20cascade%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_donchian_turtle_55_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20n%20%3D%20c.size%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20%23%20%2B1%20bar%20of%20lag%3A%20channel%20of%20the%2055%20%28or%2020%29%20PRECEDING%20bars%2C%20excluding%20the%20current%20one.%0A%20%20%20%20hh_entry%20%3D%20_lag%28talib.MAX%28h%2C%2055%29%2C%201%29%0A%20%20%20%20ll_entry%20%3D%20_lag%28talib.MIN%28l%2C%2055%29%2C%201%29%0A%20%20%20%20hh_exit%20%3D%20_lag%28talib.MAX%28h%2C%2020%29%2C%201%29%0A%20%20%20%20ll_exit%20%3D%20_lag%28talib.MIN%28l%2C%2020%29%2C%201%29%0A%20%20%20%20ok%20%3D%20_ok%28hh_entry%2C%20ll_entry%2C%20hh_exit%2C%20ll_exit%2C%20c%29%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20if%20not%20ok%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3E%20hh_entry%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20c%5Bi%5D%20%3C%20ll_entry%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20elif%20pos%20%3D%3D%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3C%20ll_exit%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%20if%20c%5Bi%5D%20%3C%20ll_entry%5Bi%5D%20else%200%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3E%20hh_exit%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%20if%20c%5Bi%5D%20%3E%20hh_entry%5Bi%5D%20else%200%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.donchian_turtle_55_20%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Break%20the%2055-bar%20high%2C%20exit%20at%2020%22%2C%0A%20%20%20%20rationale%3D%22Above%20a%2055-bar%20high%2C%20short%20sellers%27%20stops%20and%20breakout%20buy%20orders%20pile%20up.%20Their%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22execution%20is%20a%20mechanical%20demand%20shock%2C%20insensitive%20to%20price%2C%20and%20the%20book%20is%20thin%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22right%20there%20precisely%20because%20nobody%20has%20been%20willing%20to%20sell%20at%20that%20level%20yet%3B%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22every%20stop%20that%20fills%20pushes%20into%20the%20next%20one.%20The%2055%2F20%20pair%20is%20Turtle%20System%202%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22published%20as%20a%20unit%2C%20not%20a%20grid%3A%20the%20shorter%20exit%20exists%20so%20that%20the%20position%20dies%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22before%20the%20capital%20does%2C%20and%20separating%20the%20two%20numbers%20would%20be%20a%20different%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hypothesis.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20very%20asymmetric%20distribution%3A%20mostly%20small%20losing%20trades%20and%20a%20right%20tail%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20carries%20the%20whole%20result%20%E2%80%94%20that%20is%2C%20a%20positive%20MEAN%20with%20a%20negative%20MEDIAN.%20If%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22median%20comes%20out%20positive%2C%20what%20is%20at%20work%20is%20not%20the%20stop%20cascade%20but%20something%20else%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20the%20declared%20mechanism%20is%20refuted.%20We%20expect%20clear%20failure%20in%20high-volatility%20%22%0A%20%20%20%20%20%20%20%20%20%20%22markets%20without%20direction%2C%20where%20the%20false%20breakout%20is%20the%20norm.%22%2C%0A%20%20%20%20fn%3D_donchian_turtle_55_20%2C%0A%20%20%20%20params%3D%7B%22entry%22%3A%2055%2C%20%22exit%22%3A%2020%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%207.%20Supertrend%3A%20the%20stop%20where%20a%20risk%20desk%20would%20put%20it%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_supertrend_atr14_x3%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20n%20%3D%20c.size%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20hl2%20%3D%20%28h%20%2B%20l%29%20%2F%202.0%0A%20%20%20%20upper_band%20%3D%20hl2%20%2B%203.0%20%2A%20atr%0A%20%20%20%20lower_band%20%3D%20hl2%20-%203.0%20%2A%20atr%0A%20%20%20%20ok%20%3D%20_ok%28upper_band%2C%20lower_band%2C%20c%29%0A%20%20%20%20upper%20%3D%20np.nan%0A%20%20%20%20lower%20%3D%20np.nan%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%281%2C%20n%29%3A%0A%20%20%20%20%20%20%20%20if%20not%20ok%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20if%20not%20np.isfinite%28upper%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20upper%2C%20lower%20%3D%20upper_band%5Bi%5D%2C%20lower_band%5Bi%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20%23%20ratchet%3A%20the%20band%20only%20tightens%2C%20and%20is%20released%20only%20when%20price%20breaks%20through%20it.%0A%20%20%20%20%20%20%20%20if%20upper_band%5Bi%5D%20%3C%20upper%20or%20c%5Bi%20-%201%5D%20%3E%20upper%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20upper%20%3D%20upper_band%5Bi%5D%0A%20%20%20%20%20%20%20%20if%20lower_band%5Bi%5D%20%3E%20lower%20or%20c%5Bi%20-%201%5D%20%3C%20lower%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20lower%20%3D%20lower_band%5Bi%5D%0A%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3E%20upper%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20elif%20c%5Bi%5D%20%3C%20lower%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.supertrend_atr14_x3%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Trail%20a%20wide%20stop%2C%20three%20ATR%20out%22%2C%0A%20%20%20%20rationale%3D%22An%20invalidation%20threshold%20fixed%20as%20a%20percentage%20is%20incoherent%20across%20volatility%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22regimes%3A%20the%20same%202%25%20is%20noise%20in%20one%20regime%20and%20a%20signal%20in%20another.%20Supertrend%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22puts%20the%20flip%203%20ATR%20away%20from%20the%20midpoint%2C%20which%20is%20roughly%20where%20a%20risk%20desk%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22places%20the%20stop%20%E2%80%94%20far%20enough%20that%20ordinary%20noise%20does%20not%20touch%20it.%20If%20real%20stops%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cluster%20at%20that%20distance%2C%20the%20level%20stops%20being%20a%20drawn%20line%20and%20starts%20having%20flow%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22behind%20it.%20The%20band%27s%20ratchet%20is%20the%20hypothesis%20that%20it%20pays%20to%20GIVE%20the%20position%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22room.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20same%20sign%20as%20the%20moving-average%20cross%20in%20a%20trend%2C%20but%20far%20fewer%20position%20%22%0A%20%20%20%20%20%20%20%20%20%20%22changes%20thanks%20to%20the%20band%27s%20hysteresis%2C%20and%20that%20ALL%20the%20edge%20over%20the%20cross%20comes%20%22%0A%20%20%20%20%20%20%20%20%20%20%22from%20that%20reduction%20and%20not%20from%20better%20accuracy.%20Falsifiable%3A%20if%20the%20number%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22position%20changes%20does%20not%20fall%20clearly%20relative%20to%20trend.ema_cross_21_55%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hysteresis%20is%20doing%20nothing.%20We%20expect%20it%20to%20give%20back%20a%20lot%20of%20profit%20on%20sharp%20%22%0A%20%20%20%20%20%20%20%20%20%20%22reversals%2C%20precisely%20because%20of%20how%20far%20away%20the%20level%20sits%3B%20we%20predict%20it%20loses%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trend.psar_002_020%20in%20markets%20that%20turn%20in%20a%20V.%22%2C%0A%20%20%20%20fn%3D_supertrend_atr14_x3%2C%0A%20%20%20%20params%3D%7B%22atr%22%3A%2014%2C%20%22multiplier%22%3A%203.0%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%208.%20parabolic%20SAR%3A%20the%20opposing%20hypothesis%20%E2%80%94%20tighten%20the%20stop%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_psar_002_020%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20sar%20%3D%20talib.SAR%28h%2C%20l%2C%20acceleration%3D0.02%2C%20maximum%3D0.2%29%0A%20%20%20%20ok%20%3D%20_ok%28sar%2C%20c%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20sar%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20sar%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.psar_002_020%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Tighten%20the%20stop%20with%20every%20new%20high%22%2C%0A%20%20%20%20rationale%3D%22The%20SAR%20tightens%20the%20stop%20as%20the%20trend%20matures%2C%20accelerating%20with%20every%20new%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22extreme.%20It%20reproduces%20an%20observable%20behaviour%3A%20the%20manager%20raises%20the%20stop%20after%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22each%20new%20high%20to%20protect%20unrealised%20profit%2C%20and%20that%20staircase%20of%20stops%20is%20latent%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22supply%20which%2C%20once%20touched%2C%20executes%20as%20a%20cascade.%20It%20is%20registered%20explicitly%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20OPPOSITE%20hypothesis%20to%20trend.supertrend_atr14_x3%20on%20the%20same%20question%3A%20whether%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20tighten%20the%20stop%20or%20to%20give%20it%20room.%22%2C%0A%20%20%20%20prior%3D%22We%20predict%20that%20SAR%20and%20Supertrend%20disagree%20systematically%20about%20how%20long%20the%20position%20%22%0A%20%20%20%20%20%20%20%20%20%20%22is%20held%20and%20that%20ONE%20of%20the%20two%20is%20clearly%20worse%3B%20we%20bet%20on%20the%20SAR%20losing%20net%20through%20%22%0A%20%20%20%20%20%20%20%20%20%20%22excess%20trading.%20The%20result%20that%20would%20refute%20the%20whole%20question%20is%20that%20both%20perform%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20same%3A%20that%20would%20mean%20stop%20distance%20is%20not%20a%20relevant%20variable%20and%20that%20both%20%22%0A%20%20%20%20%20%20%20%20%20%20%22rationalisations%20are%20noise.%20The%20SAR%20is%20always%20in%20the%20market%2C%20so%20we%20expect%20severe%20damage%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20a%20range.%22%2C%0A%20%20%20%20fn%3D_psar_002_020%2C%0A%20%20%20%20params%3D%7B%22acceleration%22%3A%200.02%2C%20%22maximum%22%3A%200.2%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%209.%20regression%20slope%20over%20ATR%3A%20drift%20measured%20in%20units%20of%20noise%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_linreg_slope_55_atr14%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20slope%20%3D%20talib.LINEARREG_SLOPE%28c%2C%2055%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_ok%28slope%2C%20atr%29%20%26%20%28atr%20%3E%200.0%29%0A%20%20%20%20%23%20cumulative%20displacement%20of%20the%20window%2C%20in%20ATR%3A%20requiring%20%3E%201%20is%20requiring%20that%20the%20drift%0A%20%20%20%20%23%20dominate%20the%20noise%20in%20the%20noise%27s%20own%20unit.%20It%20is%20not%20a%20tuned%20threshold%3A%20it%20is%20a%20change%20of%0A%20%20%20%20%23%20unit.%0A%20%20%20%20ratio%20%3D%20np.full%28c.size%2C%20np.nan%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ratio%5Bok%5D%20%3D%20%28slope%5Bok%5D%20%2A%2055.0%29%20%2F%20atr%5Bok%5D%0A%20%20%20%20out%5Bok%20%26%20%28ratio%20%3E%201.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28ratio%20%3C%20-1.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.linreg_slope_55_atr14%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Only%20when%20the%20drift%20outruns%20the%20noise%22%2C%0A%20%20%20%20rationale%3D%22Drift%20is%20only%20exploitable%20relative%20to%20the%20noise%20you%20have%20to%20wade%20through%20to%20collect%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22it%3B%20a%20market%20that%20grinds%20higher%20in%20the%20middle%20of%20a%20gale%20is%20not%20tradeable.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2255-bar%20regression%20slope%20estimates%20the%20drift%20and%20the%20ATR14%20the%20noise%20per%20bar%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22requiring%20the%20window%27s%20cumulative%20displacement%20to%20exceed%201%20ATR%20is%20a%20change%20of%20unit%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20a%20threshold%20fitted%20to%20data.%20It%20is%20the%20most%20literal%20formulation%20of%20%27trend%27%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20whole%20family%3A%20no%20crosses%2C%20no%20focal%20points%20and%20no%20memory%20of%20extremes.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20this%20to%20be%20the%20detector%20with%20the%20FEWEST%20trades%20and%2C%20above%20all%2C%20the%20most%20%22%0A%20%20%20%20%20%20%20%20%20%20%22stable%20one%20across%20timeframes%2C%20because%20the%20threshold%20is%20dimensionless.%20That%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsifiable%20test%3A%20if%20its%20edge%20does%20not%20survive%20a%20change%20of%20timeframe%20better%20than%20%22%0A%20%20%20%20%20%20%20%20%20%20%22trend.ema_cross_21_55%27s%20does%2C%20normalising%20by%20volatility%20adds%20nothing.%20We%20expect%20it%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22fail%20exactly%20at%20volatility%20jumps%2C%20because%20the%20ATR%20reacts%20late%20and%20the%20threshold%20%22%0A%20%20%20%20%20%20%20%20%20%20%22loosens%20precisely%20when%20it%20should%20be%20tightening.%22%2C%0A%20%20%20%20fn%3D_linreg_slope_55_atr14%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%2055%2C%20%22atr%22%3A%2014%2C%20%22threshold_in_atr%22%3A%201.0%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2010.%20Ichimoku%3A%20the%20only%20popular%20construction%20with%20THICKNESS%20of%20equilibrium%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_ichimoku_kumo%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20tenkan%20%3D%20%28talib.MAX%28h%2C%209%29%20%2B%20talib.MIN%28l%2C%209%29%29%20%2F%202.0%0A%20%20%20%20kijun%20%3D%20%28talib.MAX%28h%2C%2026%29%20%2B%20talib.MIN%28l%2C%2026%29%29%20%2F%202.0%0A%20%20%20%20%23%20%2B26%20displacement%3A%20TODAY%27s%20level%20comes%20out%20of%20data%20from%2026%20bars%20ago.%20Past%2C%20not%20future.%0A%20%20%20%20span_a%20%3D%20_lag%28%28tenkan%20%2B%20kijun%29%20%2F%202.0%2C%2026%29%0A%20%20%20%20span_b%20%3D%20_lag%28%28talib.MAX%28h%2C%2052%29%20%2B%20talib.MIN%28l%2C%2052%29%29%20%2F%202.0%2C%2026%29%0A%20%20%20%20ok%20%3D%20_ok%28tenkan%2C%20kijun%2C%20span_a%2C%20span_b%2C%20c%29%0A%20%20%20%20cloud_top%20%3D%20np.maximum%28span_a%2C%20span_b%29%0A%20%20%20%20cloud_bottom%20%3D%20np.minimum%28span_a%2C%20span_b%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20cloud_top%29%20%26%20%28tenkan%20%3E%20kijun%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20cloud_bottom%29%20%26%20%28tenkan%20%3C%20kijun%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.ichimoku_kumo%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Above%20the%20Ichimoku%20cloud%2C%20flat%20inside%20it%22%2C%0A%20%20%20%20rationale%3D%22The%20cloud%20is%20the%20only%20popular%20construction%20that%20declares%20the%20equilibrium%20zone%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22THICKNESS%3A%20between%20Senkou%20A%20and%20B%20there%20is%20no%20signal%2C%20and%20the%20thickness%20grows%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exactly%20when%20the%20recent%20extremes%20disagree%20with%20each%20other.%20It%20encodes%20the%20memory%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%209-%2C%2026-%20and%2052-bar%20ranges%2C%20the%20review%20horizons%20of%20a%20Japanese%20desk%2C%20and%20its%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value%20%E2%80%94%20if%20it%20has%20any%20%E2%80%94%20is%20reflexive%2C%20given%20how%20enormously%20the%20system%20is%20adopted%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Asia.%20The%20%2B26%20displacement%20is%20what%20makes%20it%20interesting%20and%20also%20what%20makes%20it%20easy%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20implement%20wrong%3A%20it%20is%20information%20from%2026%20bars%20ago%20drawn%20forward%2C%20never%20future%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22information.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20an%20edge%20similar%20to%20the%20moving-average%20cross%20but%20with%20considerably%20MORE%20time%20%22%0A%20%20%20%20%20%20%20%20%20%20%22out%20of%20the%20market%2C%20because%20the%20cloud%20declares%20equilibrium%20explicitly.%20Falsifiable%3A%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22time%20out%20of%20the%20market%20does%20not%20increase%20clearly%20relative%20to%20trend.ema_cross_21_55%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22cloud%20filters%20nothing%20and%20is%20a%20slow%20moving%20average%20with%20two%20coats%20of%20paint.%20We%20expect%20%22%0A%20%20%20%20%20%20%20%20%20%20%22it%20to%20fail%20on%20trends%20that%20start%20from%20compression%2C%20where%20the%20cloud%20is%20thin%20and%20stops%20%22%0A%20%20%20%20%20%20%20%20%20%20%22nothing.%22%2C%0A%20%20%20%20fn%3D_ichimoku_kumo%2C%0A%20%20%20%20params%3D%7B%22tenkan%22%3A%209%2C%20%22kijun%22%3A%2026%2C%20%22senkou_b%22%3A%2052%2C%20%22displacement%22%3A%2026%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2011.%20Aroon%3A%20the%20trend%20as%20a%20renewal%20process%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_aroon_25%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%0A%20%20%20%20out%20%3D%20np.zeros%28h.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20down%2C%20up%20%3D%20talib.AROON%28h%2C%20l%2C%2025%29%0A%20%20%20%20ok%20%3D%20_ok%28up%2C%20down%29%0A%20%20%20%20out%5Bok%20%26%20%28up%20%3E%2070.0%29%20%26%20%28down%20%3C%2030.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28down%20%3E%2070.0%29%20%26%20%28up%20%3C%2030.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.aroon_25%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Time%20since%20the%20last%20high%2C%20not%20price%22%2C%0A%20%20%20%20rationale%3D%22Aroon%20measures%20not%20price%20but%20TIME%20since%20the%20last%20extreme%2C%20and%20that%20is%20a%20different%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22variable%20from%20everything%20else%20in%20this%20family.%20The%20thesis%20is%20that%20a%20trend%20is%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22renewal%20process%3A%20as%20long%20as%20new%20highs%20keep%20appearing%20frequently%2C%20there%20are%20buyers%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22willing%20to%20pay%20prices%20that%20have%20never%20been%20paid%2C%20which%20only%20happens%20if%20information%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20still%20being%20incorporated.%20When%20the%20rate%20of%20new%20extremes%20falls%2C%20the%20flow%20has%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exhausted%20itself%20even%20if%20price%20has%20not%20turned%20yet.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20it%20to%20exit%20BEFORE%20the%20moving%20averages%20at%20tops%20%E2%80%94%20giving%20back%20less%20profit%20on%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20turn%20%E2%80%94%20and%20to%20pay%20for%20that%20insurance%20with%20clearly%20worse%20entries.%20Falsifiable%3A%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22its%20pattern%20of%20results%20is%20indistinguishable%20from%20trend.ema_cross_21_55%27s%20across%20every%20%22%0A%20%20%20%20%20%20%20%20%20%20%22regime%2C%20the%20time%20information%20is%20redundant%20with%20the%20price%20information%20and%20the%20hypothesis%20%22%0A%20%20%20%20%20%20%20%20%20%20%22adds%20nothing%20new%20to%20the%20family.%20We%20expect%20a%20nil%20or%20negative%20edge%20in%20a%20range%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%22alternating%20extremes%2C%20where%20both%20arms%20stay%20high%20and%20the%20signal%20switches%20off.%22%2C%0A%20%20%20%20fn%3D_aroon_25%2C%0A%20%20%20%20params%3D%7B%22period%22%3A%2025%2C%20%22high_threshold%22%3A%2070%2C%20%22low_threshold%22%3A%2030%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D250%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2012.%20twelve-month%20time-series%20momentum%3A%20the%20allocation%20horizon%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_tsmom_365d%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20a_year_ago%20%3D%20_lag%28c%2C%20365%29%0A%20%20%20%20ok%20%3D%20_ok%28c%2C%20a_year_ago%29%20%26%20%28a_year_ago%20%3E%200.0%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20a_year_ago%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20a_year_ago%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22trend.tsmom_365d%22%2C%0A%20%20%20%20family%3D%22trend%22%2C%0A%20%20%20%20title%3D%22Above%20where%20it%20traded%20a%20year%20ago%22%2C%0A%20%20%20%20rationale%3D%22This%20is%20the%20trend%20hypothesis%20with%20the%20broadest%20cross-asset%20academic%20support%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%28Moskowitz%2C%20Ooi%20and%20Pedersen%29%3A%20the%20sign%20of%20the%20last%20twelve%20months%27%20return%20predicts%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20sign%20of%20the%20following%20period%20in%20almost%20every%20asset%20class%20and%20across%20more%20than%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22century%20of%20data.%20The%20proposed%20mechanism%20is%20initial%20underreaction%20through%20anchoring%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20slow%20diffusion%2C%20followed%20by%20overreaction%20driven%20by%20trend-follower%20flow.%20In%20BTC%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20allocation%20cycle%20adds%20to%20it%3A%20a%20committee%20approves%20mandates%20quarters%20after%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22decision%20that%20motivated%20them%2C%20and%20that%20lag%20is%20exactly%20the%20persistence.%20It%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22registered%20on%201d%20only%20because%20%27twelve%20months%27%20is%20a%20scale%20of%20the%20allocation%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22calendar%2C%20not%20a%20number%20of%20bars%3A%20over%20365%201h%20candles%20the%20declared%20mechanism%20does%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22exist.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20smallest%20edge%20PER%20BAR%20in%20the%20whole%20family%20and%2C%20at%20the%20same%20time%2C%20the%20most%20%22%0A%20%20%20%20%20%20%20%20%20%20%22stable%20one%2C%20positive%20in%20the%20out-of-sample%20years%20as%20well.%20Falsifiable%20test%20against%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22sibling%3A%20if%20the%20365-day%20sign%20adds%20nothing%20on%20top%20of%20what%20trend.linreg_slope_55_atr14%20%22%0A%20%20%20%20%20%20%20%20%20%20%22already%20gives%2C%20the%20allocation-horizon%20argument%20is%20false%20and%20all%20we%20are%20measuring%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22drift%20at%20any%20scale%20whatsoever.%20We%20expect%20a%20very%20large%20drawdown%20at%20every%20cycle%20turn%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22because%20it%20takes%20months%20to%20change%20sign.%22%2C%0A%20%20%20%20fn%3D_tsmom_365d%2C%0A%20%20%20%20params%3D%7B%22lag_days%22%3A%20365%7D%2C%0A%20%20%20%20timeframes%3D%28%221d%22%2C%29%2C%0A%20%20%20%20min_warmup%3D420%2C%0A%29%29%0A\nsource_sha256=fb2b51bc9226d2a28a03d7ff3fd6aad57ccfb4198a75a12857bca38244db821f\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":17,"row_hash":"a5e1787803da420226fe22d0a72957b4b88a361126783fde347e097b5d083fca","body":"wavelab-journal-chain\nv=3\nseq=17\nprev=d86e72c940afdc9008588968fa0b004101c063ff315c41e1a18720b90771f5f0\nkind=sealed_source\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\npath=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nprereg_seq=2\nsource_text=%22%22%22%60volatility%60%20family%3A%20compression%20and%20expansion%20of%20the%20range.%20PRE-REGISTRATION.%0A%0AWritten%20before%20running%20a%20single%20backtest.%20No%20parameter%20in%20this%20file%20was%20chosen%20by%20looking%20at%0Aresults%3A%20each%20one%20is%20the%20conventional%20value%20from%20the%20literature%20that%20defined%20it%20%28Bollinger%2020%2F2%2C%0AKeltner%20EMA-20%20%C2%B1%202%C2%B7ATR-10%2C%20TTM%20Squeeze%2020%2F20%2F1.5%2C%20ATR-14%2C%20NATR-14%2C%20Chandelier%2022%2F3%2C%20NR7%2C%20252%20as%20the%0Aconventional%20annual%20window%29.%20That%20ATR-20%2C%20ATR-14%2C%20ATR-10%20and%20ATR-22%20appear%20in%20different%20hypotheses%0Ais%20NOT%20a%20sweep%20over%20the%20ATR%20period%3A%20each%20one%20is%20fixed%20by%20the%20composite%20indicator%20that%20contains%20it%2C%0Aand%20none%20of%20them%20moves.%0A%0AThe%20family%27s%20shared%20mechanism%0A-----------------------------%0AVolatility%20clustering%20%28Mandelbrot%201963%2C%20Engle%201982%29%3A%20variance%20is%20autocorrelated%20even%20when%20the%0Areturn%20is%20not.%20In%20a%2024%2F7%20market%20with%20leveraged%20market%20makers%2C%20a%20quiet%20period%20compresses%20the%0Ainventory%20of%20liquidity%3A%20MMs%20narrow%20their%20spreads%2C%20volatility%20sellers%20load%20up%20on%20short%20gamma%20and%0Aeverybody%27s%20stop%20orders%20pile%20up%20just%20outside%20an%20ever-narrower%20range.%20When%20the%20range%20breaks%2C%20the%0Ahedging%20of%20that%20short%20gamma%20and%20the%20stop%20cascade%20push%20in%20the%20same%20direction%3A%20the%20big%20move%20is%20born%0Ain%20the%20quiet%20period%2C%20not%20in%20the%20noisy%20one.%0A%0ARealised%20volatility%20estimator%0A-----------------------------%0ARogers-Satchell%3A%20RS_t%20%3D%20ln%28H%2FC%29%C2%B7ln%28H%2FO%29%20%2B%20ln%28L%2FC%29%C2%B7ln%28L%2FO%29.%20Chosen%20over%20Garman-Klass%20because%20it%20is%0Aunbiased%20under%20non-zero%20drift%20%28BTC%20has%20strong%20drift%20and%20GK%20books%20it%20as%20variance%29%2C%20and%20over%0AYang-Zhang%20because%20YZ%20devotes%20a%20term%20to%20the%20opening%20jump%2C%20which%20in%20a%2024%2F7%20asset%20with%20no%20session%0Adoes%20not%20exist%3A%20that%20term%20would%20be%20microstructure%20noise%20from%20the%20arbitrary%20candle%20boundary.%0A%0ADeliberate%20contrasts%20%28this%20is%20NOT%20a%20grid%20search%29%0A-------------------------------------------------------%0AThree%20pairs%20registered%20on%20purpose%2C%20with%20the%20prediction%20of%20which%20one%20wins%20written%20in%20advance%3A%0A%0A%20%201.%20%60rs_vol_pct_low_carry%60%20vs%20%60bbw_pct_low_carry%60%3A%20SAME%20direction%20rule%2C%20different%20compression%0A%20%20%20%20%20estimator%20%28RS%20over%20OHLC%20vs%20Bollinger%20width%2C%20which%20is%20the%20standard%20deviation%20of%20closes%29.%20If%20the%0A%20%20%20%20%20%22quiet%20precedes%20big%22%20mechanism%20is%20real%2C%20the%20two%20should%20point%20the%20same%20way.%20If%20only%20one%20of%20them%0A%20%20%20%20%20works%2C%20what%20is%20being%20measured%20is%20the%20estimator%2C%20not%20the%20mechanism.%0A%20%202.%20%60rs_vol_pct_high_fade%60%20vs%20%60rs_vol_pct_high_carry%60%3A%20exact%20complements.%20At%20most%20one%20of%20them%20can%0A%20%20%20%20%20have%20an%20edge.%20Registering%20them%20together%20makes%20it%20impossible%20to%20choose%20the%20sign%20after%20looking.%0A%20%203.%20%60natr_low_regime_trend%60%20vs%20%60natr_high_regime_trend%60%3A%20a%20median%20split%20of%20the%20SAME%20trend%20signal.%0A%20%20%20%20%20Together%20they%20reconstruct%20the%20unfiltered%20signal%2C%20so%20the%20comparison%20isolates%20the%20effect%20of%20the%0A%20%20%20%20%20volatility%20regime%20and%20not%20that%20of%20the%20trend.%0A%0ACausality%0A---------%0AEvery%20indicator%20here%20uses%20only%20data%20up%20to%20and%20including%20i.%20Rolling%20windows%20are%20aligned%20with%0A%60sliding_window_view%28x%2C%20n%29%5Bj%5D%20%3D%3D%20x%5Bj%20%3A%20j%2Bn%5D%60%2C%20whose%20result%20is%20written%20at%20index%20%60j%2Bn-1%60.%20There%20is%20no%0Anegative%20shift%2C%20no%20%60find_peaks%60%2C%20and%20no%20statistic%20defined%20against%20the%20whole%20array.%20The%20stateful%0Aconstructions%20%28%60squeeze%60%2C%20Keltner%2C%20Chandelier%29%20are%20computed%20in%20forward%20loops%2C%20which%20are%20causal%20by%0Aconstruction.%0A%22%22%22%0A%0Afrom%20__future__%20import%20annotations%0A%0Aimport%20numpy%20as%20np%0Aimport%20talib%0Afrom%20numpy.lib.stride_tricks%20import%20sliding_window_view%0A%0Afrom%20wavelab.hypotheses.base%20import%20Hypothesis%2C%20Series%2C%20register%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%20Utilities.%20None%20of%20them%20looks%20ahead.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_ohlc%28s%3A%20Series%29%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%2C%20np.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20%22%22%22talib%20requires%20contiguous%20float64.%22%22%22%0A%20%20%20%20f%20%3D%20lambda%20a%3A%20np.ascontiguousarray%28a%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20return%20f%28s.open%29%2C%20f%28s.high%29%2C%20f%28s.low%29%2C%20f%28s.close%29%0A%0A%0Adef%20_roll_mean%28x%3A%20np.ndarray%2C%20n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Mean%20of%20the%20last%20n%20observations%2C%20i%27s%20included.%20NaN%20if%20the%20window%20touches%20a%20NaN.%22%22%22%0A%20%20%20%20out%20%3D%20np.full%28x.size%2C%20np.nan%29%0A%20%20%20%20if%20x.size%20%3E%3D%20n%3A%0A%20%20%20%20%20%20%20%20out%5Bn%20-%201%3A%5D%20%3D%20sliding_window_view%28x%2C%20n%29.mean%28axis%3D1%29%0A%20%20%20%20return%20out%0A%0A%0Adef%20_rolling_rank%28x%3A%20np.ndarray%2C%20n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Percentile%20of%20x%5Bi%5D%20within%20the%20window%20x%5Bi-n%2B1%20%3A%20i%2B1%5D.%20Returns%20NaN%20during%20warm-up.%0A%0A%20%20%20%20The%20window%20ENDS%20at%20i%2C%20it%20never%20straddles%20it.%20A%20percentile%20computed%20against%20the%20whole%20array%0A%20%20%20%20would%20be%20pure%20lookahead%20%28it%20would%20know%20today%20what%20the%20maximum%20volatility%20of%202031%20was%29%2C%20and%20that%0A%20%20%20%20is%20exactly%20the%20mistake%20this%20project%20hunts.%0A%20%20%20%20%22%22%22%0A%20%20%20%20out%20%3D%20np.full%28x.size%2C%20np.nan%29%0A%20%20%20%20if%20x.size%20%3C%20n%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20win%20%3D%20sliding_window_view%28x%2C%20n%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20win%5Bj%5D%20%3D%3D%20x%5Bj%20%3A%20j%2Bn%5D%20%20-%3E%20%20index%20j%2Bn-1%0A%20%20%20%20%23%20NaN%20count%20per%20window%20without%20propagating%20NaN%20%28cumsum%20over%20integers%29.%0A%20%20%20%20cs%20%3D%20np.concatenate%28%28%5B0%5D%2C%20np.cumsum%28np.isnan%28x%29.astype%28np.int64%29%29%29%29%0A%20%20%20%20valid%20%3D%20%28cs%5Bn%3A%5D%20-%20cs%5B%3A-n%5D%29%20%3D%3D%200%0A%20%20%20%20last%20%3D%20win%5B%3A%2C%20-1%5D%0A%20%20%20%20cnt%20%3D%20%28win%20%3C%20last%5B%3A%2C%20None%5D%29.sum%28axis%3D1%29%20%20%20%20%20%20%20%20%20%20%23%20comparing%20with%20NaN%20gives%20False%3B%20dropped%20below%0A%20%20%20%20out%5Bn%20-%201%3A%5D%20%3D%20np.where%28valid%2C%20cnt%20%2F%20%28n%20-%201%29%2C%20np.nan%29%0A%20%20%20%20return%20out%0A%0A%0Adef%20_shift%28x%3A%20np.ndarray%2C%20k%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Value%20from%20k%20candles%20ago.%20k%20%3E%200%20ALWAYS%3A%20a%20negative%20k%20would%20be%20looking%20into%20the%20future.%22%22%22%0A%20%20%20%20if%20k%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20raise%20ValueError%28%22_shift%20only%20looks%20backwards%22%29%0A%20%20%20%20out%20%3D%20np.full%28x.size%2C%20np.nan%29%0A%20%20%20%20if%20k%20%3C%20x.size%3A%0A%20%20%20%20%20%20%20%20out%5Bk%3A%5D%20%3D%20x%5B%3A%20x.size%20-%20k%5D%0A%20%20%20%20return%20out%0A%0A%0Adef%20_rs_vol%28s%3A%20Series%2C%20n%3A%20int%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Rogers-Satchell%20realised%20volatility%20over%20the%20last%20n%20candles%2C%20i%27s%20included.%22%22%22%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20term%20%3D%20np.full%28c.size%2C%20np.nan%29%0A%20%20%20%20pos%20%3D%20%28o%20%3E%200%29%20%26%20%28h%20%3E%200%29%20%26%20%28l%20%3E%200%29%20%26%20%28c%20%3E%200%29%0A%20%20%20%20if%20pos.any%28%29%3A%0A%20%20%20%20%20%20%20%20oo%2C%20hh%2C%20ll%2C%20cc%20%3D%20o%5Bpos%5D%2C%20h%5Bpos%5D%2C%20l%5Bpos%5D%2C%20c%5Bpos%5D%0A%20%20%20%20%20%20%20%20term%5Bpos%5D%20%3D%20np.log%28hh%20%2F%20cc%29%20%2A%20np.log%28hh%20%2F%20oo%29%20%2B%20np.log%28ll%20%2F%20cc%29%20%2A%20np.log%28ll%20%2F%20oo%29%0A%20%20%20%20%23%20RS%20is%20non-negative%20by%20construction%20%28H%20%3E%3D%20max%28O%2CC%29%20and%20L%20%3C%3D%20min%28O%2CC%29%29%3B%20the%20clip%20only%20guards%0A%20%20%20%20%23%20against%20numerical%20noise.%20np.maximum%20propagates%20NaN%2C%20so%20the%20warm-up%20is%20preserved%20as%20NaN.%0A%20%20%20%20return%20np.sqrt%28_roll_mean%28np.maximum%28term%2C%200.0%29%2C%20n%29%29%0A%0A%0Adef%20_hold%28entry%3A%20np.ndarray%2C%20flat%3A%20np.ndarray%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Holds%20the%20last%20entry%20until%20%60flat%60%20closes%20it.%20Forward%20loop%3A%20causal.%22%22%22%0A%20%20%20%20out%20%3D%20np.zeros%28entry.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20cur%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28entry.size%29%3A%0A%20%20%20%20%20%20%20%20if%20flat%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%200%0A%20%20%20%20%20%20%20%20e%20%3D%20int%28entry%5Bi%5D%29%0A%20%20%20%20%20%20%20%20if%20e%20%21%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%20e%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20cur%0A%20%20%20%20return%20out%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%201.%20Bollinger%20squeeze%20inside%20Keltner%20%28TTM%20Squeeze%29%2C%20traded%20on%20the%20release.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_squeeze_release%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20up%2C%20mid%2C%20lo%20%3D%20talib.BBANDS%28c%2C%2020%2C%202.0%2C%202.0%2C%200%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2020%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28up%29%20%7C%20np.isnan%28lo%29%20%7C%20np.isnan%28mid%29%20%7C%20np.isnan%28ema%29%20%7C%20np.isnan%28atr%29%29%0A%0A%20%20%20%20sq%20%3D%20np.zeros%28c.size%2C%20dtype%3Dbool%29%0A%20%20%20%20kc_up%20%3D%20ema%20%2B%201.5%20%2A%20atr%0A%20%20%20%20kc_lo%20%3D%20ema%20-%201.5%20%2A%20atr%0A%20%20%20%20sq%5Bok%5D%20%3D%20%28up%5Bok%5D%20%3C%20kc_up%5Bok%5D%29%20%26%20%28lo%5Bok%5D%20%3E%20kc_lo%5Bok%5D%29%0A%0A%20%20%20%20prev_sq%20%3D%20np.zeros%28c.size%2C%20dtype%3Dbool%29%0A%20%20%20%20prev_sq%5B1%3A%5D%20%3D%20sq%5B%3A-1%5D%0A%20%20%20%20release%20%3D%20prev_sq%20%26%20~sq%20%26%20ok%0A%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20entry%5Brelease%20%26%20%28c%20%3E%20mid%29%5D%20%3D%201%0A%20%20%20%20entry%5Brelease%20%26%20%28c%20%3C%20mid%29%5D%20%3D%20-1%0A%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20cur%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28c.size%29%3A%0A%20%20%20%20%20%20%20%20if%20cur%20%3D%3D%201%20and%20%28sq%5Bi%5D%20or%20%28ok%5Bi%5D%20and%20c%5Bi%5D%20%3C%20mid%5Bi%5D%29%29%20or%20cur%20%3D%3D%20-1%20and%20%28sq%5Bi%5D%20or%20%28ok%5Bi%5D%20and%20c%5Bi%5D%20%3E%20mid%5Bi%5D%29%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%200%0A%20%20%20%20%20%20%20%20e%20%3D%20int%28entry%5Bi%5D%29%0A%20%20%20%20%20%20%20%20if%20e%20%21%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%20e%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20cur%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.squeeze_bb_kc_release%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Bollinger%20inside%20the%20Keltner%2C%20trade%20the%20release%22%2C%0A%20%20%20%20rationale%3D%22When%20the%20Bollinger%20bands%20%2820%2C%202%CF%83%29%20fit%20inside%20the%20Keltner%20channel%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%28EMA-20%20%C2%B1%201.5%C2%B7ATR-20%29%2C%20the%20dispersion%20of%20closes%20has%20sunk%20below%20the%20true%20range%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22market%20is%20trading%20in%20a%20handkerchief%20while%20there%20is%20still%20intra-candle%20travel.%20That%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22state%20is%20manufactured%20by%20market%20makers%20and%20volatility%20sellers%20who%20narrow%20spreads%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20accumulate%20short%20gamma%2C%20and%20by%20range%20traders%20who%20place%20stops%20just%20outside%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22handkerchief.%20When%20price%20leaves%2C%20those%20same%20participants%20have%20to%20hedge%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22direction%20of%20the%20move%20and%20the%20stops%20execute%20at%20market%2C%20so%20the%20flow%20that%20follows%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22break%20is%20forced%2C%20not%20discretionary.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%20break%20relative%20to%20the%2020-period%20%22%0A%20%20%20%20%20%20%20%20%20%20%22moving%20average%2C%20concentrated%20in%20the%20first%20candles%20after%20the%20release.%20We%20expect%20it%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22FAIL%2C%20with%20a%20negative%20edge%2C%20when%20the%20compression%20happens%20inside%20a%20wide%20higher-order%20%22%0A%20%20%20%20%20%20%20%20%20%20%22range%20%28a%20false%20break%20that%20reverts%20to%20the%20middle%29%20and%20on%2015m%2C%20where%20the%20%27squeeze%27%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22often%20an%20overnight%20liquidity%20hole%20rather%20than%20an%20accumulation%20of%20positioning.%20If%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22edge%20turned%20out%20to%20be%20indistinguishable%20from%20zero%20on%20all%20three%20timeframes%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22short-gamma%20mechanism%20is%20not%20operating%20in%20BTC%20at%20candle%20resolution.%22%2C%0A%20%20%20%20fn%3D_squeeze_release%2C%0A%20%20%20%20params%3D%7B%22bb_period%22%3A%2020%2C%20%22bb_sigma%22%3A%202.0%2C%20%22kc_period%22%3A%2020%2C%20%22kc_atr%22%3A%2020%2C%20%22kc_mult%22%3A%201.5%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%202%20and%203.%20Compression%20measured%20two%20different%20ways%2C%20SAME%20direction%20rule.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_rs_vol_pct_low_carry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28_rs_vol%28s%2C%2024%29%2C%20252%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20quiet%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28ema%29%20%26%20%28rank%20%3C%200.20%29%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.rs_vol_pct_low_carry%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Quiet%20RS%20volatility%2C%20follow%20the%20EMA-55%22%2C%0A%20%20%20%20rationale%3D%22Rogers-Satchell%20realised%20volatility%20over%2024%20candles%2C%20placed%20in%20its%20252-period%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rolling%20percentile%2C%20measures%20whether%20the%20market%20is%20quiet%20RELATIVE%20TO%20ITSELF%20rather%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22than%20relative%20to%20an%20absolute%20threshold%20that%20BTC%27s%20price%20inflation%20would%20render%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22obsolete.%20With%20volatility%20in%20the%20bottom%20quintile%2C%20whoever%20is%20positioned%20is%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22being%20shaken%20out%20by%20noise%3A%20the%20cost%20of%20holding%20a%20trend%20position%20falls%2C%20forced%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22liquidations%20stop%20and%20the%20drift%20accumulates%20without%20interruption.%20We%20give%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22direction%20with%20price%20against%20the%20EMA-55%2C%20deliberately%20trivial%2C%20because%20what%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22being%20tested%20here%20is%20the%20volatility%20GATE%2C%20not%20the%20trend%20detector.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20while%20volatility%20is%20in%20the%20low%20quintile%2C%20and%20for%20that%20edge%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22be%20GREATER%20than%20that%20of%20the%20same%20direction%20rule%20unfiltered.%20We%20expect%20it%20to%20fail%20in%20two%20%22%0A%20%20%20%20%20%20%20%20%20%20%22specific%20places%3A%20%28a%29%20after%20a%20structural%20fall%20in%20the%20level%20of%20volatility%20%28a%20prolonged%20%22%0A%20%20%20%20%20%20%20%20%20%20%22range%29%2C%20where%20the%20percentile%20stays%20pinned%20at%20the%20bottom%20and%20the%20signal%20trades%20a%20range%20%22%0A%20%20%20%20%20%20%20%20%20%20%22with%20no%20trend%3B%20%28b%29%20on%201d%2C%20where%20252%20candles%20are%20a%20whole%20year%20and%20the%20percentile%20drags%20%22%0A%20%20%20%20%20%20%20%20%20%20%22an%20old%20regime%20along%20with%20it.%20If%20the%20edge%20were%20equal%20to%20or%20smaller%20than%20that%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22unfiltered%20EMA-55%2C%20the%20volatility%20gate%20adds%20nothing.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22that%20unfiltered%20arm%20was%20not%20registered%2C%20so%20neither%20this%20hypothesis%27s%20falsification%20%22%0A%20%20%20%20%20%20%20%20%20%20%22criterion%20nor%20%60bbw_pct_low_carry%60%27s%20could%20be%20run%3B%20it%20has%20been%20registered%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60volatility.ema55_side_unfiltered%60%20and%20that%20is%20what%20both%20must%20be%20measured%20against.%22%2C%0A%20%20%20%20fn%3D_rs_vol_pct_low_carry%2C%0A%20%20%20%20params%3D%7B%22rs_window%22%3A%2024%2C%20%22percentile_window%22%3A%20252%2C%20%22threshold%22%3A%200.20%2C%20%22ema_direction%22%3A%2055%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0Adef%20_bbw_pct_low_carry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20up%2C%20mid%2C%20lo%20%3D%20talib.BBANDS%28c%2C%2020%2C%202.0%2C%202.0%2C%200%29%0A%20%20%20%20bw%20%3D%20np.full%28c.size%2C%20np.nan%29%0A%20%20%20%20good%20%3D%20~%28np.isnan%28up%29%20%7C%20np.isnan%28lo%29%20%7C%20np.isnan%28mid%29%29%20%26%20%28mid%20%21%3D%200%29%0A%20%20%20%20bw%5Bgood%5D%20%3D%20%28up%5Bgood%5D%20-%20lo%5Bgood%5D%29%20%2F%20mid%5Bgood%5D%0A%20%20%20%20rank%20%3D%20_rolling_rank%28bw%2C%20252%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20quiet%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28ema%29%20%26%20%28rank%20%3C%200.20%29%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.bbw_pct_low_carry%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Narrow%20Bollinger%20width%2C%20follow%20the%20EMA-55%22%2C%0A%20%20%20%20rationale%3D%22A%20controlled%20contrast%20to%20the%20previous%20one%3A%20identical%20direction%20rule%20%28price%20against%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20EMA-55%29%2C%20identical%20percentile%20window%20%28252%29%2C%20identical%20threshold%20%28bottom%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22quintile%29%2C%20and%20the%20ONLY%20thing%20that%20changes%20is%20the%20compression%20estimator%3A%20Bollinger%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22width%2C%20which%20is%20the%20standard%20deviation%20of%20CLOSES%2C%20against%20Rogers-Satchell%2C%20which%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22uses%20the%20full%20OHLC%20range.%20The%20two%20can%20diverge%20a%20great%20deal%3A%20a%20candle%20with%20a%20long%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22wick%20and%20a%20flat%20close%20%28an%20absorbed%20liquidation%29%20is%20quiet%20for%20Bollinger%20and%20noisy%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22for%20RS.%20If%20the%20clustering%20mechanism%20is%20real%2C%20it%20should%20show%20up%20with%20both%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22estimators.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20the%20SAME%20sign%20as%20%60rs_vol_pct_low_carry%60%20and%20a%20somewhat%20smaller%20magnitude%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22because%20the%20close-based%20estimator%20throws%20away%20the%20information%20in%20the%20wicks.%20The%20strong%20%22%0A%20%20%20%20%20%20%20%20%20%20%22falsifiable%20prediction%20is%20the%20joint%20one%3A%20if%20one%20of%20the%20two%20gives%20a%20clear%20edge%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22other%20gives%20zero%20or%20the%20opposite%20sign%2C%20the%20correct%20conclusion%20is%20NOT%20%27compression%20%22%0A%20%20%20%20%20%20%20%20%20%20%22works%27%20but%20that%20we%20are%20measuring%20a%20quirk%20of%20the%20estimator%2C%20and%20neither%20of%20the%20two%20%22%0A%20%20%20%20%20%20%20%20%20%20%22should%20survive%20the%20multiple-comparisons%20correction%20as%20evidence%20for%20the%20mechanism.%22%2C%0A%20%20%20%20fn%3D_bbw_pct_low_carry%2C%0A%20%20%20%20params%3D%7B%22bb_period%22%3A%2020%2C%20%22bb_sigma%22%3A%202.0%2C%20%22percentile_window%22%3A%20252%2C%20%22threshold%22%3A%200.20%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22ema_direction%22%3A%2055%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%204%20and%205.%20High%20volatility%3A%20exact%20complements.%20At%20most%20one%20of%20them%20can%20have%20an%20edge.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_rs_vol_pct_high_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28_rs_vol%28s%2C%2024%29%2C%20252%29%0A%20%20%20%20prev%20%3D%20_shift%28c%2C%203%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20hot%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28prev%29%20%26%20%28rank%20%3E%200.90%29%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3E%20prev%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3C%20prev%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.rs_vol_pct_high_fade%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Fade%20the%203-candle%20push%20in%20extreme%20volatility%22%2C%0A%20%20%20%20rationale%3D%22In%20the%20top%20decile%20of%20realised%20volatility%2C%20the%20move%20of%20the%20last%203%20candles%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22dominated%20by%20forced%20liquidations%3A%20the%20exchange%27s%20risk%20engine%20sells%20%28or%20buys%29%20at%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22market%20without%20looking%20at%20the%20price%2C%20and%20whoever%20provides%20liquidity%20against%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cascade%20demands%20a%20premium.%20If%20that%20premium%20is%20the%20large%20part%20of%20the%20displacement%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22price%20comes%20back%20once%20the%20cascade%20exhausts%20the%20available%20collateral%2C%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22liquidity%20provider%20pockets%20the%20retracement.%20This%20hypothesis%20bets%20that%20the%20excess%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%20liquidity%20premium%2C%20not%20information.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20from%20fading%20the%203-candle%20move.%20We%20expect%20it%20to%20FAIL%2C%20with%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22clearly%20negative%20edge%2C%20if%20high%20volatility%20in%20BTC%20is%20informative%20rather%20than%20mechanical%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20March%202020%20or%20in%20the%20May%202021%20deleveraging%20the%20cascade%20ran%20for%20days.%20Since%20it%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22registered%20alongside%20its%20exact%20complement%20%60rs_vol_pct_high_carry%60%2C%20they%20cannot%20both%20%22%0A%20%20%20%20%20%20%20%20%20%20%22win%3B%20if%20both%20come%20out%20indistinguishable%20from%20zero%2C%20the%20top%20volatility%20decile%20simply%20%22%0A%20%20%20%20%20%20%20%20%20%20%22contains%20no%20directional%20signal%20and%20both%20must%20be%20published%20as%20failures.%22%2C%0A%20%20%20%20fn%3D_rs_vol_pct_high_fade%2C%0A%20%20%20%20params%3D%7B%22rs_window%22%3A%2024%2C%20%22percentile_window%22%3A%20252%2C%20%22threshold%22%3A%200.90%2C%20%22impulse_bars%22%3A%203%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0Adef%20_rs_vol_pct_high_carry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28_rs_vol%28s%2C%2024%29%2C%20252%29%0A%20%20%20%20prev%20%3D%20_shift%28c%2C%203%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20hot%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28prev%29%20%26%20%28rank%20%3E%200.90%29%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3E%20prev%29%5D%20%3D%201%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3C%20prev%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.rs_vol_pct_high_carry%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Follow%20the%203-candle%20push%20in%20extreme%20volatility%22%2C%0A%20%20%20%20rationale%3D%22The%20opposite%20reading%20of%20the%20same%20state%3A%20in%20the%20top%20decile%20of%20realised%20volatility%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22forced%20liquidation%20is%20reflexive.%20Each%20liquidation%20moves%20price%20towards%20the%20next%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22cluster%20of%20collateral%2C%20which%20liquidates%20in%20turn%3B%20the%20book%20empties%20out%20in%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22direction%20of%20the%20move%20and%20market%20makers%20pull%20their%20quotes%20instead%20of%20absorbing.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Under%20that%20mechanism%2C%20the%20excess%20volatility%20is%20itself%20the%20signal%20that%20the%20cascade%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%20still%20alive%2C%20and%20continuation%20dominates%20the%20retracement%20over%20a%20horizon%20of%20a%20few%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candles.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%203-candle%20move%2C%20but%20a%20SMALL%20one%20in%20net%20%22%0A%20%20%20%20%20%20%20%20%20%20%22terms%2C%20because%20it%20trades%20exactly%20when%20spread%20and%20slippage%20%22%0A%20%20%20%20%20%20%20%20%20%20%22are%20at%20their%20worst%3A%20it%20is%20a%20prediction%20that%20can%20be%20right%20in%20sign%20and%20still%20not%20survive%20%22%0A%20%20%20%20%20%20%20%20%20%20%22costs%2C%20and%20that%20is%20how%20it%20must%20be%20evaluated.%20We%20expect%20it%20to%20fail%20at%20capitulation%20%22%0A%20%20%20%20%20%20%20%20%20%20%22highs%2C%20where%20the%20last%20candle%20of%20the%20top%20decile%20is%20precisely%20the%20turn.%20It%20is%20the%20exact%20%22%0A%20%20%20%20%20%20%20%20%20%20%22complement%20of%20%60rs_vol_pct_high_fade%60%3A%20registering%20them%20together%20makes%20it%20impossible%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22choose%20the%20sign%20after%20looking.%22%2C%0A%20%20%20%20fn%3D_rs_vol_pct_high_carry%2C%0A%20%20%20%20params%3D%7B%22rs_window%22%3A%2024%2C%20%22percentile_window%22%3A%20252%2C%20%22threshold%22%3A%200.90%2C%20%22impulse_bars%22%3A%203%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%206%2C%207%2C%208.%20Range%20contraction%20and%20expansion%2C%20at%20the%20candle%20level.%20Horizon%20of%20ONE%20candle%3A%20we%20do%20not%0A%23%20introduce%20a%20position-duration%20parameter%20that%20would%20then%20have%20to%20be%20justified.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_nr7_breakout%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20min7%20%3D%20talib.MIN%28tr%2C%207%29%0A%20%20%20%20is_nr7%20%3D%20np.where%28np.isnan%28tr%29%20%7C%20np.isnan%28min7%29%2C%20np.nan%2C%20%28tr%20%3C%3D%20min7%29.astype%28float%29%29%0A%20%20%20%20nr7_prev%20%3D%20_shift%28is_nr7%2C%201%29%0A%20%20%20%20hi_prev%2C%20lo_prev%20%3D%20_shift%28h%2C%201%29%2C%20_shift%28l%2C%201%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28nr7_prev%29%20%7C%20np.isnan%28hi_prev%29%20%7C%20np.isnan%28lo_prev%29%29%20%26%20%28nr7_prev%20%3D%3D%201.0%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20hi_prev%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20lo_prev%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.nr7_breakout%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Break%20the%20narrowest%20range%20of%20seven%20candles%22%2C%0A%20%20%20%20rationale%3D%22Toby%20Crabel%27s%20NR7%3A%20the%20previous%20candle%20had%20the%20narrowest%20true%20range%20of%20the%20last%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22seven.%20A%20local%20range%20minimum%20means%20buyers%20and%20sellers%20agreed%20on%20the%20price%20for%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whole%20period%2C%20which%20concentrates%20the%20resting%20orders%20%28stops%20and%20limits%29%20into%20a%20very%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22thin%20band.%20The%20next%20candle%20closing%20outside%20that%20band%20consumes%20those%20orders%20in%20one%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22go%2C%20and%20the%20resulting%20imbalance%20is%20mechanical.%20It%20is%20the%20minimal%20version%20of%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22family%27s%20mechanism%3A%20contraction%20measured%20with%20no%20estimators%20and%20no%20long%20windows%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22only%20the%20range%20over%20seven%20candles.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%20break%2C%20with%20a%20horizon%20of%20a%20single%20%22%0A%20%20%20%20%20%20%20%20%20%20%22candle.%20We%20expect%20it%20to%20be%20LARGER%20on%2015m%20and%201h%2C%20where%20the%20book%20of%20resting%20orders%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%22significant%20relative%20to%20typical%20size%2C%20and%20to%20degrade%20or%20disappear%20on%204h%2C%20where%20a%20candle%20%22%0A%20%20%20%20%20%20%20%20%20%20%22aggregates%20too%20many%20hands%20for%20any%20exploitable%20imbalance%20to%20be%20left.%20If%20the%20edge%20grew%20%22%0A%20%20%20%20%20%20%20%20%20%20%22with%20the%20timeframe%20we%20would%20be%20measuring%20trend%2C%20not%20range%20contraction%2C%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hypothesis%20would%20be%20refuted%20even%20if%20the%20number%20were%20good.%22%2C%0A%20%20%20%20fn%3D_nr7_breakout%2C%0A%20%20%20%20params%3D%7B%22nr_window%22%3A%207%2C%20%22horizon_bars%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0Adef%20_inside_bar_breakout%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20h1%2C%20l1%20%3D%20_shift%28h%2C%201%29%2C%20_shift%28l%2C%201%29%0A%20%20%20%20h2%2C%20l2%20%3D%20_shift%28h%2C%202%29%2C%20_shift%28l%2C%202%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28h1%29%20%7C%20np.isnan%28l1%29%20%7C%20np.isnan%28h2%29%20%7C%20np.isnan%28l2%29%29%0A%20%20%20%20inside%20%3D%20ok%20%26%20%28h1%20%3C%20h2%29%20%26%20%28l1%20%3E%20l2%29%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3E%20h1%29%5D%20%3D%201%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3C%20l1%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.inside_bar_breakout%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Break%20the%20inside%20bar%27s%20own%20extremes%22%2C%0A%20%20%20%20rationale%3D%22Inside%20bar%3A%20the%20range%20of%20the%20previous%20candle%20is%20STRICTLY%20contained%20within%20that%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20one%20before%20it.%20It%20is%20not%20the%20same%20thing%20as%20NR7%2C%20and%20that%20is%20why%20it%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22registered%20separately%3A%20NR7%20is%20narrowness%20relative%20to%20a%20sample%20of%20seven%2C%20the%20inside%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%20is%20a%20condition%20of%20absolute%20containment%20relative%20to%20ONE%20specific%20candle%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mother.%20Containment%20means%20no%20participant%20managed%20to%20impose%20a%20price%20outside%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22range%20that%20had%20already%20been%20explored%20and%20rejected%3A%20equilibrium%20has%20reasserted%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22itself%20within%20a%20known%20range%2C%20with%20the%20orders%20anchored%20to%20the%20extremes%20of%20the%20inside%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22candle.%20Breaking%20them%20on%20a%20close%20invalidates%20that%20reassertion.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%2C%20of%20the%20same%20sign%20as%20%60nr7_breakout%60%20and%20of%20similar%20magnitude.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22The%20comparison%20between%20the%20two%20is%20informative%20in%20itself%3A%20if%20absolute%20containment%20works%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20relative%20narrowness%20does%20not%20%28or%20the%20other%20way%20round%29%2C%20what%20we%20have%20is%20a%20quirk%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20criterion%20and%20not%20the%20contraction%20mechanism.%20We%20expect%20it%20to%20fail%20in%20markets%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%22strong%20sustained%20drift%2C%20where%20the%20inside%20bar%20is%20only%20a%20continuation%20pause%20and%20the%20break%20%22%0A%20%20%20%20%20%20%20%20%20%20%22already%20arrives%20late%2C%20and%20on%2015m%20during%20the%20lowest-volume%20hours%2C%20where%20the%20containment%20%22%0A%20%20%20%20%20%20%20%20%20%20%22reflects%20an%20absence%20of%20participants%20rather%20than%20agreement%20among%20them.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22AUDIT%20NOTE%20%282026-09-08%29%3A%20%60candles.inside_bar_break%60%20registers%20the%20same%20two-candle%20%22%0A%20%20%20%20%20%20%20%20%20%20%22pattern%20but%20breaking%20the%20extremes%20of%20the%20MOTHER%20candle.%20Since%20the%20inside%20candle%27s%20high%20%22%0A%20%20%20%20%20%20%20%20%20%20%22is%20lower%20than%20the%20mother%27s%2C%20every%20event%20of%20the%20former%20is%20also%20an%20event%20of%20the%20latter%3A%20%22%0A%20%20%20%20%20%20%20%20%20%20%22they%20are%20the%20same%20pattern%20with%20two%20different%20thresholds.%20Both%20are%20kept%20because%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22level%20is%20the%20claim%20and%20these%20are%20different%20levels%2C%20but%20they%20are%20DEPENDENT%20trials%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%22must%20be%20counted%20as%20such.%20%28A%20third%20registration%20of%20the%20same%20pattern%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60structure.inside_bar_break%60%2C%20was%20an%20exact%20duplicate%20of%20the%20%60candles%60%20one%20and%20has%20been%20%22%0A%20%20%20%20%20%20%20%20%20%20%22removed%20in%20the%20audit.%29%22%2C%0A%20%20%20%20fn%3D_inside_bar_breakout%2C%0A%20%20%20%20params%3D%7B%22horizon_bars%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0Adef%20_wide_range_thrust%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20atr_prev%20%3D%20_shift%28atr%2C%201%29%0A%20%20%20%20rank_prev%20%3D%20_shift%28_rolling_rank%28atr%2C%20100%29%2C%201%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28tr%29%20%7C%20np.isnan%28atr_prev%29%20%7C%20np.isnan%28rank_prev%29%29%0A%20%20%20%20thrust%20%3D%20ok%20%26%20%28rank_prev%20%3C%200.50%29%20%26%20%28tr%20%3E%202.0%20%2A%20atr_prev%29%0A%20%20%20%20out%5Bthrust%20%26%20%28c%20%3E%20o%29%5D%20%3D%201%0A%20%20%20%20out%5Bthrust%20%26%20%28c%20%3C%20o%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.wide_range_thrust%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Wide%20candle%20out%20of%20a%20quiet%20base%22%2C%0A%20%20%20%20rationale%3D%22Range%20expansion%20AFTER%20contraction%2C%20which%20is%20the%20direct%20formulation%20of%20%27big%20moves%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22are%20born%20in%20quiet%20periods%27%3A%20we%20require%20the%20previous%20candle%27s%20ATR-14%20to%20have%20been%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22below%20its%20100-candle%20median%20%28contraction%29%20and%20the%20current%20true%20range%20to%20exceed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22twice%20that%20ATR%20%28expansion%29.%20A%20candle%20like%20that%2C%20coming%20out%20of%20a%20quiet%20base%2C%20is%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22produced%20by%20dispersed%20retail%20flow%3A%20it%20is%20produced%20by%20a%20large%20participant%20who%20needs%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22to%20execute%20and%20accepts%20paying%20the%20range%2C%20or%20by%20a%20cluster%20of%20stops%20being%20triggered.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20direction%20is%20given%20by%20the%20candle%27s%20body%2C%20close%20against%20open%2C%20because%20that%20is%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22what%20reveals%20who%20won%20the%20exchange.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%20body%2C%20with%20a%20horizon%20of%20one%20candle.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22We%20expect%20it%20to%20FAIL%20clearly%20when%20the%20thrust%20is%20a%20reaction%20to%20a%20one-off%20news%20item%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%22is%20entirely%20retraced%20over%20the%20following%20candles%20%28a%20typical%20pattern%20in%20BTC%20with%20%22%0A%20%20%20%20%20%20%20%20%20%20%22regulatory%20announcements%29%2C%20and%20on%201d%2C%20where%20an%20expansion%20candle%20is%20usually%20already%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22end%20of%20the%20move%20and%20not%20its%20beginning.%20If%20the%20edge%20were%20consistently%20negative%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22correct%20mechanism%20would%20be%20exhaustion%20and%20not%20the%20start%20of%20an%20expansion.%22%2C%0A%20%20%20%20fn%3D_wide_range_thrust%2C%0A%20%20%20%20params%3D%7B%22atr_period%22%3A%2014%2C%20%22expansion_mult%22%3A%202.0%2C%20%22median_window%22%3A%20100%2C%20%22horizon_bars%22%3A%201%7D%2C%0A%20%20%20%20timeframes%3D%28%2215m%22%2C%20%221h%22%2C%20%224h%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%209%20and%2010.%20Volatility-scaled%20structures%3A%20the%20threshold%20moves%20with%20the%20ATR%2C%20not%20with%20the%20price.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_keltner_breakout%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2010%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28ema%29%20%7C%20np.isnan%28atr%29%29%0A%20%20%20%20up%2C%20lo%20%3D%20ema%20%2B%202.0%20%2A%20atr%2C%20ema%20-%202.0%20%2A%20atr%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20entry%5Bok%20%26%20%28c%20%3E%20up%29%5D%20%3D%201%0A%20%20%20%20entry%5Bok%20%26%20%28c%20%3C%20lo%29%5D%20%3D%20-1%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20cur%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28c.size%29%3A%0A%20%20%20%20%20%20%20%20if%20cur%20%3D%3D%201%20and%20ok%5Bi%5D%20and%20c%5Bi%5D%20%3C%20ema%5Bi%5D%20or%20cur%20%3D%3D%20-1%20and%20ok%5Bi%5D%20and%20c%5Bi%5D%20%3E%20ema%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%200%0A%20%20%20%20%20%20%20%20e%20%3D%20int%28entry%5Bi%5D%29%0A%20%20%20%20%20%20%20%20if%20e%20%21%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%20e%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20cur%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.keltner_breakout%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Close%20two%20ATR%20beyond%20the%20EMA-20%22%2C%0A%20%20%20%20rationale%3D%22A%20volatility-normalised%20breakout%20with%20no%20compression%20component%3A%20a%20close%20above%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22EMA-20%20%2B%202%C2%B7ATR-10%2C%20or%20below%20EMA-20%20%E2%88%92%202%C2%B7ATR-10.%20Under%20a%20random%20walk%20with%20the%20CURRENT%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22volatility%2C%20getting%20two%20ATR%20away%20from%20the%20mean%20is%20rare%3B%20that%20it%20happens%20is%20evidence%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22that%20flow%20has%20arrived%20which%20the%20prevailing%20volatility%20level%20does%20not%20explain%20%E2%80%94%20that%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22is%2C%20evidence%20of%20a%20change%20in%20the%20drift%20and%20not%20of%20a%20fluctuation.%20The%20threshold%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rescales%20itself%2C%20so%20the%20same%20rule%20is%20equally%20demanding%20at%2020%2C000%20as%20at%20100%2C000%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22dollars.%20It%20is%20held%20until%20the%20close%20crosses%20back%20over%20the%20EMA-20%2C%20which%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22minimal%20definition%20of%20%27the%20flow%20is%20over%27.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20and%2C%20above%20all%2C%20an%20ASYMMETRY%20with%20respect%20to%20the%20squeeze%3A%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%22%60squeeze_bb_kc_release%60%20beats%20this%20hypothesis%2C%20the%20prior%20compression%20adds%20information%20%22%0A%20%20%20%20%20%20%20%20%20%20%22over%20and%20above%20the%20break%20alone%2C%20which%20is%20the%20family%27s%20central%20claim.%20If%20this%20one%20wins%20%22%0A%20%20%20%20%20%20%20%20%20%20%22instead%2C%20the%20compression%20is%20decorative%20and%20the%20only%20thing%20that%20works%20is%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22volatility-normalised%20break.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22We%20expect%20it%20to%20fail%20in%20a%20mid-volatility%20range%2C%20where%20price%20crosses%20the%20two%20ATR%20in%20both%20%22%0A%20%20%20%20%20%20%20%20%20%20%22directions%20repeatedly%20and%20each%20crossing%20costs%20a%20spread.%22%2C%0A%20%20%20%20fn%3D_keltner_breakout%2C%0A%20%20%20%20params%3D%7B%22ema_period%22%3A%2020%2C%20%22atr_period%22%3A%2010%2C%20%22mult%22%3A%202.0%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0Adef%20_chandelier_trail%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2022%29%0A%20%20%20%20hh%20%3D%20talib.MAX%28h%2C%2022%29%0A%20%20%20%20ll%20%3D%20talib.MIN%28l%2C%2022%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28atr%29%20%7C%20np.isnan%28hh%29%20%7C%20np.isnan%28ll%29%29%0A%20%20%20%20long_stop%20%3D%20hh%20-%203.0%20%2A%20atr%0A%20%20%20%20short_stop%20%3D%20ll%20%2B%203.0%20%2A%20atr%0A%0A%20%20%20%20%23%20FIXED%20IN%20THE%20AUDIT%20%282026-09-08%29.%20This%20used%20to%20be%3A%0A%20%20%20%20%23%20%20%20%20%20entry%5Bok%20%26%20%28c%20%3E%20short_stop%29%5D%20%3D%201%0A%20%20%20%20%23%20%20%20%20%20entry%5Bok%20%26%20%28c%20%3C%20long_stop%29%5D%20%3D%20-1%0A%20%20%20%20%23%20and%20the%20two%20assignments%20trampled%20each%20other.%20When%20the%2022-candle%20range%20is%20wide%20%28hh%20-%20ll%20%3E%0A%20%20%20%20%23%206%C2%B7ATR%29%20the%20long%20threshold%20ends%20up%20ABOVE%20the%20short%20one%2C%20so%20a%20close%20in%20the%20zone%20between%20them%0A%20%20%20%20%23%20satisfied%20BOTH%20conditions%20at%20once%3B%20since%20the%20-1%20was%20written%20second%2C%20the%20short%20always%20won.%0A%20%20%20%20%23%20Measured%20over%20a%20series%20containing%20all%20three%20regimes%2C%20that%20affected%202.7%25%20of%20candles%20and%20forced%0A%20%20%20%20%23%20every%20one%20of%20them%20short.%0A%20%20%20%20%23%0A%20%20%20%20%23%20Why%20it%20mattered%2C%20and%20why%20it%20is%20not%20a%20detail.%20The%20comment%20on%20this%20very%20function%20declared%20the%0A%20%20%20%20%23%20opposite%20of%20what%20the%20code%20did%20%28%22when%20the%20close%20falls%20between%20the%20two%20thresholds%20there%20is%20no%0A%20%20%20%20%23%20new%20information%3A%20the%20state%20is%20held%22%29%2C%20and%20the%20bias%20was%20not%20random%3A%20the%20ambiguous%20zone%20appears%0A%20%20%20%20%23%20precisely%20in%20wide%20ranges%2C%20that%20is%2C%20in%20the%20regime%20where%20this%20hypothesis%27s%20prior%20predicts%0A%20%20%20%20%23%20LOSSES.%20An%20arbitrary%20tie-break%20that%20systematically%20goes%20short%20exactly%20in%20the%20regime%20you%20are%0A%20%20%20%20%23%20trying%20to%20measure%20contaminates%20the%20sign%20of%20the%20result%20and%20makes%20it%20uninterpretable%3A%20you%20could%0A%20%20%20%20%23%20not%20tell%20whether%20what%20was%20measured%20was%20the%20ATR%20scaling%20or%20the%20tie-break.%20The%20ambiguous%20zone%0A%20%20%20%20%23%20now%20emits%200%20%E2%80%94no%20new%20entry%E2%80%94%20and%20%60_hold%60%20carries%20the%20previous%20state%20forward%2C%20which%20is%20the%0A%20%20%20%20%23%20Chandelier%20rule%20as%20declared%20in%20the%20%60rationale%60%20and%20what%20%60_events%60%20does%20in%20the%20%60structure%60%0A%20%20%20%20%23%20family.%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20long_side%20%3D%20ok%20%26%20%28c%20%3E%20short_stop%29%0A%20%20%20%20short_side%20%3D%20ok%20%26%20%28c%20%3C%20long_stop%29%0A%20%20%20%20ambiguous%20%3D%20long_side%20%26%20short_side%0A%20%20%20%20entry%5Blong_side%20%26%20~ambiguous%5D%20%3D%201%0A%20%20%20%20entry%5Bshort_side%20%26%20~ambiguous%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28entry%2C%20np.zeros%28c.size%2C%20dtype%3Dbool%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.chandelier_atr_trail%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Trail%20three%20ATR%20from%20the%2022-candle%20extreme%22%2C%0A%20%20%20%20rationale%3D%22The%20Chandelier%20exit%20%28Chuck%20LeBeau%2C%2022%2F3%29%3A%20long%20while%20the%20close%20is%20above%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2222-candle%20low%20plus%203%C2%B7ATR-22%2C%20short%20while%20it%20is%20below%20the%2022-candle%20high%20minus%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%223%C2%B7ATR-22.%20The%20volatility%20content%20lies%20in%20the%20invalidation%20distance%20being%20scaled%20by%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20ATR%3A%20the%20position%20survives%20exactly%20the%20noise%20the%20current%20regime%20produces%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20a%20bit%20more.%20It%20is%20the%20operational%20translation%20of%20volatility%20clustering%3A%20if%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22variance%20is%20autocorrelated%2C%20tomorrow%27s%20noise%20is%20well%20estimated%20by%20today%27s%2C%20and%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22threshold%20fixed%20as%20a%20percentage%20would%20be%20too%20close%20in%20an%20agitated%20regime%20and%20too%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22far%20in%20a%20quiet%20one.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20in%20a%20trending%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20range%3A%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22signal%20is%20always%20in%20the%20market%2C%20so%20in%20a%20range%20it%20pays%20for%20every%20turn.%20The%20falsifiable%20%22%0A%20%20%20%20%20%20%20%20%20%20%22claim%20specific%20to%20this%20family%20is%20not%20%27trend%20following%20works%27%20%E2%80%94that%20is%20what%20the%20trend%20%22%0A%20%20%20%20%20%20%20%20%20%20%22family%20tests%E2%80%94%20but%20that%20SCALING%20the%20threshold%20by%20the%20ATR%20beats%20the%20same%20structure%20with%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%22fixed%20threshold%20%E2%80%94%20an%20arm%20that%20was%20NOT%20registered%20and%20that%20the%202026-09-08%20audit%20has%20%22%0A%20%20%20%20%20%20%20%20%20%20%22added%20as%20%60volatility.chandelier_fixed_pct%60%2C%20without%20which%20this%20criterion%20could%20not%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%22run.%20If%20the%20net%20result%20across%20the%20whole%20history%20were%20indistinguishable%20from%20zero%2C%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22correct%20conclusion%20is%20that%20in%20BTC%20the%20gain%20from%20the%20trends%20exactly%20offsets%20the%20cost%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22the%20ranges%2C%20and%20there%20is%20no%20edge%20attributable%20to%20volatility%20scaling.%22%2C%0A%20%20%20%20fn%3D_chandelier_trail%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%2022%2C%20%22atr_period%22%3A%2022%2C%20%22mult%22%3A%203.0%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2011%20and%2012.%20Median%20split%20on%20NATR%20over%20the%20SAME%20trend%20signal.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_natr_regime_trend%28s%3A%20Series%2C%20high_vol%3A%20bool%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20natr%20%3D%20talib.NATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28natr%2C%20252%29%0A%20%20%20%20e21%2C%20e55%20%3D%20talib.EMA%28c%2C%2021%29%2C%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28rank%29%20%7C%20np.isnan%28e21%29%20%7C%20np.isnan%28e55%29%29%0A%20%20%20%20gate%20%3D%20ok%20%26%20%28%28rank%20%3E%3D%200.50%29%20if%20high_vol%20else%20%28rank%20%3C%200.50%29%29%0A%20%20%20%20out%5Bgate%20%26%20%28e21%20%3E%20e55%29%5D%20%3D%201%0A%20%20%20%20out%5Bgate%20%26%20%28e21%20%3C%20e55%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Adef%20_natr_low_regime_trend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20return%20_natr_regime_trend%28s%2C%20high_vol%3DFalse%29%0A%0A%0Adef%20_natr_high_regime_trend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20return%20_natr_regime_trend%28s%2C%20high_vol%3DTrue%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.natr_low_regime_trend%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22EMA-21%2F55%20cross%20with%20NATR%20below%20median%22%2C%0A%20%20%20%20rationale%3D%22The%20normalised%20ATR%20%28NATR-14%2C%20the%20ATR%20as%20a%20percentage%20of%20price%29%20placed%20in%20its%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22252-period%20rolling%20percentile%20classifies%20the%20regime%20without%20depending%20on%20the%20price%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22level.%20Below%20its%20median%2C%20the%20typical%20travel%20per%20period%20is%20small%20relative%20to%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%20size%20anyone%20can%20hold%3A%20there%20are%20no%20stop%20sweeps%20and%20no%20liquidation%20chains%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22so%20whoever%20is%20on%20the%20right%20side%20of%20the%20EMA-21%2FEMA-55%20is%20not%20shaken%20out%20before%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22drift%20materialises.%20The%20trend%20signal%20is%20a%20fixed%20instrument%20here%3B%20what%20is%20being%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22tested%20is%20the%20regime.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%2C%20and%20a%20greater%20one%20than%20that%20of%20the%20same%20unfiltered%20%22%0A%20%20%20%20%20%20%20%20%20%20%22EMA-21%2F55%20signal.%20We%20expect%20it%20to%20fail%20if%20low%20volatility%20in%20BTC%20corresponds%20mainly%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22long%20accumulation%20ranges%20rather%20than%20to%20smooth%20trends%3A%20in%20that%20case%20the%20moving-average%20%22%0A%20%20%20%20%20%20%20%20%20%20%22cross%20will%20give%20strings%20of%20false%20signals%20and%20the%20edge%20will%20be%20negative.%20It%20is%20the%20low%20%22%0A%20%20%20%20%20%20%20%20%20%20%22half%20of%20the%20median%20split%3A%20together%20with%20%60natr_high_regime_trend%60%20it%20reconstructs%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22unfiltered%20signal%2C%20so%20the%20two%20cannot%20both%20be%20better%20than%20it.%22%2C%0A%20%20%20%20fn%3D_natr_low_regime_trend%2C%0A%20%20%20%20params%3D%7B%22natr_period%22%3A%2014%2C%20%22percentile_window%22%3A%20252%2C%20%22cutoff%22%3A%200.50%2C%20%22ema_fast%22%3A%2021%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22ema_slow%22%3A%2055%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.natr_high_regime_trend%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22EMA-21%2F55%20cross%20with%20NATR%20above%20median%22%2C%0A%20%20%20%20rationale%3D%22The%20complementary%20half%2C%20registered%20so%20that%20the%20previous%20claim%20is%20falsifiable%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22not%20a%20selection%20made%20after%20the%20fact.%20Above%20the%20NATR-14%20median%2C%20the%20same%20trend%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22signal%20trades%20when%20the%20typical%20travel%20is%20large%3A%20a%20single%20candle%20can%20cover%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22distance%20between%20the%20two%20averages%20several%20times%20over%2C%20so%20the%20cross%20happens%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22unwinds%20through%20amplitude%20noise%2C%20and%20on%20top%20of%20that%20spread%20and%20slippage%20are%20at%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22their%20worst%20precisely%20there.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20NIL%20OR%20NEGATIVE%20edge%20here%2C%20and%20a%20positive%20one%20in%20%60natr_low_regime_trend%60.%20%22%0A%20%20%20%20%20%20%20%20%20%20%22That%20is%20the%20contrast%2C%20and%20we%20are%20committed%20to%20that%20sign%20in%20advance.%20If%20it%20came%20out%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22other%20way%20round%20%E2%80%94trend%20paying%20in%20high%20volatility%20and%20not%20in%20low%E2%80%94%20the%20mechanism%20we%20have%20%22%0A%20%20%20%20%20%20%20%20%20%20%22described%20for%20this%20entire%20family%20would%20be%20wrong%3A%20it%20would%20mean%20that%20in%20BTC%20high%20%22%0A%20%20%20%20%20%20%20%20%20%20%22volatility%20accompanies%20directional%20trend%20instead%20of%20destroying%20it%2C%20and%20the%20compression%20%22%0A%20%20%20%20%20%20%20%20%20%20%22hypotheses%20in%20this%20file%20would%20have%20to%20be%20read%20with%20far%20more%20suspicion%20even%20if%20one%20of%20%22%0A%20%20%20%20%20%20%20%20%20%20%22them%20gave%20a%20favourable%20number.%22%2C%0A%20%20%20%20fn%3D_natr_high_regime_trend%2C%0A%20%20%20%20params%3D%7B%22natr_period%22%3A%2014%2C%20%22percentile_window%22%3A%20252%2C%20%22cutoff%22%3A%200.50%2C%20%22ema_fast%22%3A%2021%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22ema_slow%22%3A%2055%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0A%23%20--------------------------------------------------------------------------------------------%0A%23%2013%20and%2014.%20CONTROLS%20ADDED%20IN%20THE%20AUDIT%20%282026-09-08%29.%0A%23%0A%23%20What%20was%20wrong.%20Three%20hypotheses%20in%20this%20file%20declared%20their%20falsification%20criterion%20against%20a%0A%23%20control%20that%20was%20NOT%20registered%20anywhere%20in%20the%20pre-registration%3A%0A%23%0A%23%20%20%20-%20%60rs_vol_pct_low_carry%60%20and%20%60bbw_pct_low_carry%60%20say%20their%20edge%20must%20be%20%22GREATER%20than%20that%20of%0A%23%20%20%20%20%20the%20same%20direction%20rule%20unfiltered%22%20and%20that%20%22if%20the%20edge%20were%20equal%20to%20or%20smaller%20than%20that%0A%23%20%20%20%20%20of%20the%20unfiltered%20EMA-55%2C%20the%20volatility%20gate%20adds%20nothing%22.%20Price%20against%20the%20EMA-55%20with%20no%0A%23%20%20%20%20%20filter%20did%20not%20exist%20as%20a%20registered%20hypothesis.%0A%23%20%20%20-%20%60chandelier_atr_trail%60%20says%20explicitly%20that%20%22the%20falsifiable%20claim%20specific%20to%20this%20family%0A%23%20%20%20%20%20%5B...%5D%20is%20that%20SCALING%20the%20threshold%20by%20the%20ATR%20beats%20the%20same%20structure%20with%20a%20fixed%0A%23%20%20%20%20%20threshold%22.%20The%20structure%20with%20a%20fixed%20threshold%20did%20not%20exist.%0A%23%0A%23%20Why%20it%20mattered.%20A%20prior%20whose%20failure%20criterion%20names%20an%20object%20that%20does%20not%20exist%20cannot%20be%0A%23%20run%2C%20and%20what%20cannot%20be%20run%20cannot%20fail%3A%20in%20practice%20those%20three%20hypotheses%20could%20only%20be%20judged%0A%23%20on%20their%20absolute%20profitability%2C%20which%20is%20exactly%20the%20judgement%20the%20pre-registration%20exists%20to%0A%23%20forbid%20%28in%20an%20asset%20that%20went%20up%20twentyfold%2C%20any%20predominantly%20long%20rule%20%22wins%22%29.%20The%20two%20missing%0A%23%20controls%20are%20registered%20here%2C%20with%20their%20own%20priors%20and%20counting%20as%20two%20more%20trials%20in%20the%0A%23%20multiple-comparisons%20correction.%20Widening%20the%20number%20of%20trials%20%E2%80%94which%20is%20the%20conservative%0A%23%20direction%E2%80%94%20is%20preferred%20to%20watering%20down%20falsification%20criteria%20that%20were%20already%20written%2C%20which%0A%23%20would%20amount%20to%20rewriting%20the%20registry%20after%20closing%20it.%0A%23%20--------------------------------------------------------------------------------------------%0A%0A%0Adef%20_ema55_side_unfiltered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~np.isnan%28ema%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.ema55_side_unfiltered%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22The%20EMA-55%20side%20with%20no%20volatility%20gate%22%2C%0A%20%20%20%20rationale%3D%22Unconditional%20control%20for%20%60rs_vol_pct_low_carry%60%20and%20%60bbw_pct_low_carry%60%3A%20exactly%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22their%20same%20direction%20rule%20%E2%80%94close%20above%20or%20below%20the%20EMA-55%E2%80%94%20with%20no%20volatility%20gate%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22at%20all.%20It%20claims%20no%20mechanism%20of%20its%20own%2C%20and%20that%20is%20the%20point%3A%20the%20two%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22compression%20hypotheses%20do%20not%20bet%20that%20following%20the%20EMA-55%20wins%2C%20but%20that%20it%20wins%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22MORE%20when%20realised%20volatility%20is%20in%20the%20bottom%20quintile.%20That%20is%20a%20claim%20about%20a%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22difference%2C%20and%20a%20difference%20cannot%20be%20measured%20with%20a%20single%20arm.%20It%20is%20registered%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20%60volatility%60%20and%20not%20in%20%60trend%60%20because%20its%20only%20reason%20to%20exist%20is%20to%20serve%20as%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22the%20denominator%20for%20this%20family%27s%20volatility%20gate.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20small%20positive%20edge%2C%20dominated%20by%20BTC%27s%20secular%20drift%2C%20and%20we%20expect%20it%20to%20%22%0A%20%20%20%20%20%20%20%20%20%20%22be%20SMALLER%20than%20%60rs_vol_pct_low_carry%60%27s.%20That%20comparison%20is%20the%20whole%20content%3A%20if%20this%20%22%0A%20%20%20%20%20%20%20%20%20%20%22control%20matches%20or%20beats%20the%20two%20filtered%20versions%2C%20the%20volatility%20gate%20adds%20nothing%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20both%20are%20refuted%20even%20if%20their%20absolute%20number%20is%20good%3B%20if%20the%20two%20filtered%20ones%20%22%0A%20%20%20%20%20%20%20%20%20%20%22beat%20it%2C%20the%20volatility-clustering%20claim%20holds.%20On%20its%20own%2C%20a%20positive%20result%20for%20this%20%22%0A%20%20%20%20%20%20%20%20%20%20%22control%20is%20NOT%20a%20finding%3A%20it%20is%20the%20asset%27s%20drift%20split%20by%20which%20side%20of%20a%20moving%20%22%0A%20%20%20%20%20%20%20%20%20%20%22average%20you%20are%20on%2C%20and%20it%20must%20be%20published%20as%20such.%22%2C%0A%20%20%20%20fn%3D_ema55_side_unfiltered%2C%0A%20%20%20%20params%3D%7B%22ema_direction%22%3A%2055%2C%20%22volatility_gate%22%3A%20%22none%22%7D%2C%0A%20%20%20%20timeframes%3D%28%221h%22%2C%20%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D300%2C%0A%29%29%0A%0A%0Adef%20_chandelier_fixed_pct%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Identical%20to%20%60_chandelier_trail%60%20except%20that%20the%20buffer%20is%20a%20fixed%206%25%20of%20the%20level%20instead%0A%20%20%20%20of%203%C2%B7ATR-22.%20The%206%25%20was%20not%20searched%20for%3A%20it%20is%20the%20value%20that%20matches%203%C2%B7ATR-22%20in%20a%20typical%0A%20%20%20%20BTC%20volatility%20regime%20on%204h%2C%20chosen%20in%20advance%20so%20that%20the%20control%20differs%20from%20the%20hypothesis%0A%20%20%20%20in%20the%20SCALING%20and%20not%20in%20the%20average%20aggressiveness%20of%20the%20threshold.%22%22%22%0A%20%20%20%20_%2C%20h%2C%20low%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20hh%20%3D%20talib.MAX%28h%2C%2022%29%0A%20%20%20%20ll%20%3D%20talib.MIN%28low%2C%2022%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28hh%29%20%7C%20np.isnan%28ll%29%29%0A%20%20%20%20long_stop%20%3D%20hh%20%2A%20%281.0%20-%200.06%29%0A%20%20%20%20short_stop%20%3D%20ll%20%2A%20%281.0%20%2B%200.06%29%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20long_side%20%3D%20ok%20%26%20%28c%20%3E%20short_stop%29%0A%20%20%20%20short_side%20%3D%20ok%20%26%20%28c%20%3C%20long_stop%29%0A%20%20%20%20ambiguous%20%3D%20long_side%20%26%20short_side%20%20%20%20%23%20same%20tie-break%20rule%20as%20the%20hypothesis%20it%20controls%0A%20%20%20%20entry%5Blong_side%20%26%20~ambiguous%5D%20%3D%201%0A%20%20%20%20entry%5Bshort_side%20%26%20~ambiguous%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28entry%2C%20np.zeros%28c.size%2C%20dtype%3Dbool%29%29%0A%0A%0Aregister%28Hypothesis%28%0A%20%20%20%20name%3D%22volatility.chandelier_fixed_pct%22%2C%0A%20%20%20%20family%3D%22volatility%22%2C%0A%20%20%20%20title%3D%22Trail%20a%20fixed%206%25%20instead%20of%20ATR%22%2C%0A%20%20%20%20rationale%3D%22Control%20for%20%60chandelier_atr_trail%60.%20Exactly%20the%20same%20structure%20%E2%80%94long%20while%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22close%20is%20above%20the%2022-candle%20low%20plus%20a%20buffer%2C%20short%20while%20it%20is%20below%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2222-candle%20high%20minus%20that%20buffer%E2%80%94%20with%20a%20single%20difference%3A%20the%20buffer%20is%20a%20FIXED%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22percentage%20of%20the%20level%20instead%20of%203%C2%B7ATR-22.%20It%20is%20the%20arm%20that%20makes%20the%20family%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22central%20claim%20testable%2C%20which%20is%20not%20%27trend%20following%20works%27%20but%20that%20measuring%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22invalidation%20distance%20in%20units%20of%20the%20PREVAILING%20volatility%20beats%20measuring%20it%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22units%20of%20price.%20If%20volatility%20clustering%20is%20real%2C%20the%20scaled%20threshold%20should%20be%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22too%20close%20in%20an%20agitated%20regime%20and%20too%20far%20in%20a%20quiet%20one%20exactly%20when%20the%20fixed%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22one%20gets%20it%20wrong%2C%20and%20not%20before.%22%2C%0A%20%20%20%20prior%3D%22We%20expect%20a%20positive%20edge%20and%20a%20SMALLER%20one%20than%20%60chandelier_atr_trail%60%27s%2C%20with%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%22difference%20concentrated%20in%20the%20volatility%20regime%20changes%20%E2%80%94the%20months%20after%20March%202020%20%22%0A%20%20%20%20%20%20%20%20%20%20%22and%20May%202021%E2%80%94%20and%20practically%20nil%20over%20the%20rest%20of%20the%20sample.%20If%20the%20two%20turn%20out%20%22%0A%20%20%20%20%20%20%20%20%20%20%22indistinguishable%2C%20the%20ATR%20scaling%20buys%20nothing%20and%20%60chandelier_atr_trail%60%20is%20refuted%20%22%0A%20%20%20%20%20%20%20%20%20%20%22in%20its%20own%20claim%20even%20if%20it%20makes%20money%3B%20if%20this%20control%20turns%20out%20BETTER%2C%20volatility%20%22%0A%20%20%20%20%20%20%20%20%20%20%22clustering%20operates%20in%20the%20opposite%20direction%20to%20the%20one%20described%20in%20this%20family%27s%20%22%0A%20%20%20%20%20%20%20%20%20%20%22header%20and%20every%20compression%20hypothesis%20in%20this%20file%20must%20be%20reread%20with%20suspicion.%20The%20%22%0A%20%20%20%20%20%20%20%20%20%20%226%25%20is%20frozen%3A%20if%20it%20fails%2C%20no%20other%20value%20is%20tried.%22%2C%0A%20%20%20%20fn%3D_chandelier_fixed_pct%2C%0A%20%20%20%20params%3D%7B%22window%22%3A%2022%2C%20%22buffer_pct%22%3A%200.06%2C%20%22scaling%22%3A%20%22none%22%7D%2C%0A%20%20%20%20timeframes%3D%28%224h%22%2C%20%221d%22%29%2C%0A%20%20%20%20min_warmup%3D200%2C%0A%29%29%0A\nsource_sha256=0fed340bbbe5d675bf174dc81780b307a22a0100265ca9155fdf20eb75aad296\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\n"} {"seq":18,"row_hash":"ccdf7fe47a9dafb55834cb6fbbbe24af846274baa677dbae97becba0fbed89a1","body":"wavelab-journal-chain\nv=3\nseq=18\nprev=a5e1787803da420226fe22d0a72957b4b88a361126783fde347e097b5d083fca\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.body_flow_20\nprereg_seq=2\nfamily=candles\ntitle=Range%20turned%20into%20progress%20over%2020%20candles\nrationale=Aggregates%20candle%20shape%20instead%20of%20hunting%20for%20a%20pattern%3A%20it%20measures%20what%20proportion%20of%20all%20the%20range%20traded%20over%2020%20candles%20has%20turned%20into%20net%20open-to-close%20progress.%20When%20that%20proportion%20is%20high%2C%20the%20same%20side%20is%20systematically%20winning%20the%20sessions%20and%20the%20range%20is%20being%20travelled%2C%20not%20round-tripped%3A%20there%20are%20directional%20participants%20dominating%20the%20market%20makers.%20When%20it%20is%20low%2C%20price%20moves%20but%20is%20handed%20back%20within%20each%20candle%2C%20which%20is%20the%20signature%20of%20market-maker%20inventory.%20It%20is%20not%20a%20moving%20average%3A%20it%20ignores%20the%20jumps%20between%20candles%20and%20weights%20by%20the%20range%20traded%2C%20so%20two%20series%20with%20identical%20price%20travel%20can%20give%20opposite%20values.\nprior=We%20expect%20a%20positive%20edge%20in%20a%20trending%20regime%20and%20none%20or%20a%20negative%20one%20in%20a%20range%2C%20and%20we%20expect%20the%20two%20together%20to%20come%20out%20barely%20above%20zero.%20The%20strong%2C%20falsifiable%20claim%20is%20one%20of%20incremental%20value%3A%20if%20candle%20shape%20adds%20nothing%20over%20the%20plain%20direction%20of%20price%2C%20this%20hypothesis%20should%20be%20indistinguishable%20from%20an%20ordinary%20trend%20filter%20over%20the%20same%20candles%3B%20that%20it%20contributes%20something%20above%20that%20is%20what%20would%20make%20it%20interesting%2C%20and%20we%20do%20not%20take%20it%20for%20granted.\nparams_json=%7B%22threshold%22%3A%220.30000000%22%2C%22window%22%3A%2220%22%7D\nparams_sha256=6ecc632816b9578c57f7d1a043a6c5c5e509a7d1573988a3f9e6c419ea24a58d\ncode_text=def%20_body_flow%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20body_sum%20%3D%20talib.SUM%28c%20-%20o%2C%2020%29%0A%20%20%20%20range_sum%20%3D%20talib.SUM%28h%20-%20l%2C%2020%29%0A%20%20%20%20ok%20%3D%20_no_nan%28body_sum%2C%20range_sum%29%20%26%20%28range_sum%20%3E%200.0%29%0A%20%20%20%20flow%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20np.divide%28body_sum%2C%20range_sum%2C%20out%3Dflow%2C%20where%3Dok%29%0A%20%20%20%20out%5Bok%20%26%20%28flow%20%3E%3D%200.30%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28flow%20%3C%3D%20-0.30%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=cb3ee092f6e845782f9d419de0021b9c8ecb22e8f41ad6374cf9e91db098e025\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":19,"row_hash":"9f73b6b0bfddcb9a6cad82c73f1d9dea7aa7ec5b95a871ed8e770f0ab8b2fa97","body":"wavelab-journal-chain\nv=3\nseq=19\nprev=ccdf7fe47a9dafb55834cb6fbbbe24af846274baa677dbae97becba0fbed89a1\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.close_in_range\nprereg_seq=2\nfamily=candles\ntitle=Close%20pinned%20to%20the%20range%20extreme\nrationale=The%20close%20is%20the%20only%20price%20both%20sides%20agreed%20to%20carry%20a%20position%20at%20from%20one%20candle%20into%20the%20next%3B%20the%20rest%20of%20the%20range%20is%20prices%20somebody%20rejected.%20A%20close%20pinned%20to%20the%20extreme%20of%20the%20range%20means%20the%20winning%20side%20still%20had%20unfilled%20demand%20when%20the%20candle%20ended%3A%20that%20order%20does%20not%20vanish%20at%20the%20candle%20boundary%2C%20it%20keeps%20executing.%20It%20is%20the%20most%20stripped-down%20reading%20of%20candle%20shape%20there%20is%20%E2%80%94it%20needs%20no%20pattern%20name%20and%20no%20context%E2%80%94%20and%20that%20is%20why%20it%20serves%20as%20the%20minimum%20benchmark%20against%20which%20to%20judge%20the%20named%20patterns%20of%20this%20same%20family.\nprior=We%20expect%20continuation%3A%20a%20small%20positive%20edge%20on%201h%20and%204h.%20We%20expect%20it%20to%20cancel%20out%20or%20flip%20sign%20on%201d%2C%20where%20the%20horizon%20gives%20reversion%20time%20to%20take%20over%2C%20and%20on%2015m%20to%20be%20positive%20gross%20but%20negative%20net%2C%20because%20the%20signal%20fires%20on%20almost%20one%20candle%20in%20three%20and%20the%20cost%20per%20turnover%20eats%20it.%20Falsified%20if%20the%20sign%20is%20negative%20on%201h%20and%204h%2C%20which%20would%20be%20evidence%20that%20a%20close%20at%20the%20extreme%20marks%20exhaustion%20and%20not%20residual%20demand.\nparams_json=%7B%22lower_threshold%22%3A%220.20000000%22%2C%22upper_threshold%22%3A%220.80000000%22%7D\nparams_sha256=257554e139104dd5fe9b454da33c1fa1d0bade67a3c46834da17e92f3cff6d6a\ncode_text=def%20_close_in_range%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rng%20%3D%20h%20-%20l%0A%20%20%20%20ok%20%3D%20_no_nan%28h%2C%20l%2C%20c%29%20%26%20%28rng%20%3E%200.0%29%0A%20%20%20%20pos%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20np.divide%28c%20-%20l%2C%20rng%2C%20out%3Dpos%2C%20where%3Dok%29%0A%20%20%20%20out%5Bok%20%26%20%28pos%20%3E%3D%200.80%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28pos%20%3C%3D%200.20%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=9b777dbc510f0dfeb518e35f4f14ddcd175a1484c444e5820ca0ceafbd6a8987\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":20,"row_hash":"c9e4c687fcbf8b3ddca24206d7ba90201a6a97732b29c36acf216559edc55f90","body":"wavelab-journal-chain\nv=3\nseq=20\nprev=9f73b6b0bfddcb9a6cad82c73f1d9dea7aa7ec5b95a871ed8e770f0ab8b2fa97\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.doji_after_thrust\nprereg_seq=2\nfamily=candles\ntitle=Fade%20the%20doji%20inside%20a%20strong%20trend\nrationale=A%20doji%20is%20the%20first%20candle%20of%20a%20leg%20in%20which%20the%20dominant%20side%20finds%20enough%20counterparty%20to%20end%20up%20where%20it%20started%3B%20inside%20a%20mature%20directional%20move%20it%20would%20mark%20the%20point%20at%20which%20the%20marginal%20buyer%20%28or%20seller%29%20runs%20out%2C%20and%20that%20is%20why%20the%20canon%20reads%20it%20as%20a%20warning%20of%20a%20turn.%20The%20direction%20of%20the%20thrust%20is%20taken%20from%20Wilder%27s%20directional%20system%20with%20its%20conventional%20parameter%2C%20so%20as%20not%20to%20introduce%20a%20window%20of%20our%20own.%20We%20register%20it%20because%20it%20is%20the%20most-cited%20candle%20hypothesis%20we%20are%20able%20to%20state%20with%20an%20explicit%20mechanism%2C%20not%20because%20we%20believe%20in%20it.\nprior=We%20predict%20ZERO.%20In%20a%2024%2F7%20market%20there%20is%20no%20session%20open%20and%20no%20session%20close%2C%20so%20a%20doji%20is%20not%20a%20collective%20verdict%20but%20simply%20a%20small-bodied%20candle%2C%20and%20they%20turn%20up%20in%20handfuls%20during%20the%20low-volume%20hours%3B%20the%20semantics%20of%20%27indecision%27%20imports%20a%20session%20structure%20that%20does%20not%20exist%20here.%20A%20prior%20of%20zero%20is%20falsifiable%20by%20any%20significant%20effect%20in%20either%20direction%3A%20if%20fading%20the%20thrust%20gives%20a%20positive%20edge%2C%20our%20objection%20about%20the%2024%2F7%20market%20is%20wrong%3B%20if%20it%20gives%20a%20negative%20one%2C%20the%20doji%20is%20continuation%20and%20the%20canon%20has%20it%20inverted.\nparams_json=%7B%22adx%22%3A%2214%22%2C%22adx_threshold%22%3A%2225%22%2C%22hold%22%3A%221%22%2C%22pattern%22%3A%22CDLDOJI%22%7D\nparams_sha256=ab6714b1cfdf219bffec8c1fbd506253e479cf05becaf79c26f97b88e43b95c1\ncode_text=def%20_doji_after_thrust%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLDOJI%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20adx%20%3D%20talib.ADX%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20di_plus%20%3D%20talib.PLUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20di_minus%20%3D%20talib.MINUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20adx%2C%20di_plus%2C%20di_minus%29%0A%20%20%20%20thrust%20%3D%20ok%20%26%20%28p%20%21%3D%200.0%29%20%26%20%28adx%20%3E%2025.0%29%0A%20%20%20%20out%5Bthrust%20%26%20%28di_plus%20%3E%20di_minus%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bthrust%20%26%20%28di_minus%20%3E%20di_plus%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=4f63fcb08a15eba2468b3fde4449ba49acb9fce9fb321517fa7ca0cccda759ca\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":21,"row_hash":"b57ed751894daf810dc7b8e4c502b0b347664070357b689e75f08aff42747a61","body":"wavelab-journal-chain\nv=3\nseq=21\nprev=c9e4c687fcbf8b3ddca24206d7ba90201a6a97732b29c36acf216559edc55f90\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.engulfing_raw\nprereg_seq=2\nfamily=candles\ntitle=Every%20engulfing%20candle%2C%20no%20trend%20filter\nrationale=An%20engulfing%20candle%20means%20that%20the%20entire%20price%20range%20the%20previous%20candle%20considered%20acceptable%20has%20been%20travelled%20end%20to%20end%20and%20the%20close%20has%20ended%20up%20on%20the%20other%20side%20of%20its%20open%3A%20whoever%20took%20a%20position%20during%20the%20engulfed%20candle%20is%20underwater%20as%20a%20block%2C%20and%20their%20stops%20sit%20just%20beyond%20the%20far%20extreme%20of%20the%20engulfing%20candle%2C%20which%20supplies%20forced%20flow%20in%20the%20same%20direction.%20That%20is%20the%20mechanism%20attributed%20to%20it%2C%20and%20it%20is%20registered%20with%20no%20filter%20at%20all%2C%20exactly%20as%20the%20canon%20states%20it%2C%20so%20that%20the%20conditioned%20version%20%28candles.engulfing_trend%29%20has%20something%20to%20be%20measured%20against.\nprior=We%20predict%20NO%20edge%3A%20we%20expect%20an%20expectancy%20indistinguishable%20from%20zero%20gross%20and%20negative%20once%20fees%20are%20deducted%2C%20because%20without%20context%20an%20engulfing%20candle%20is%20mechanically%20%27a%20big%20candle%20that%20closed%20strong%27%2C%20which%20in%20BTC%20turns%20up%20more%20often%20at%20the%20end%20of%20a%20liquidation%20cascade%20than%20at%20the%20start%20of%20a%20move.%20It%20is%20falsified%20if%20the%20net%20delta%20against%20the%20null%20arm%20is%20clearly%20positive%20on%20any%20of%20the%20three%20timeframes%3B%20it%20is%20falsified%20too%2C%20in%20the%20other%20direction%2C%20if%20it%20is%20clearly%20negative%2C%20which%20would%20mean%20the%20pattern%20works%20inverted.\nparams_json=%7B%22hold%22%3A%221%22%2C%22pattern%22%3A%22CDLENGULFING%22%7D\nparams_sha256=c2eece81a3266f833179288b72c5036a72316c0dc536392a43d50e34e14317de\ncode_text=def%20_engulfing_raw%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLENGULFING%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=e906890029b86b34700b4bb04f06992b94ca37e168bf27bc781f356c608526de\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":22,"row_hash":"e0f07e981b5d2d688dfea97fd1b087b0fddad214ef4dcd886d7ee0c57d166e40","body":"wavelab-journal-chain\nv=3\nseq=22\nprev=b57ed751894daf810dc7b8e4c502b0b347664070357b689e75f08aff42747a61\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.engulfing_trend\nprereg_seq=2\nfamily=candles\ntitle=Engulfing%20that%20agrees%20with%20the%20EMA%20200\nrationale=The%20same%20engulfing%20candle%2C%20but%20only%20when%20it%20points%20in%20the%20direction%20of%20the%20underlying%20trend.%20The%20stop%20mechanism%20can%20only%20work%20if%20there%20is%20one%20side%20trapped%20and%20another%20with%20the%20capacity%20to%20push%3A%20in%20a%20rising%20market%20a%20bullish%20engulfing%20marks%20the%20sellers%20of%20the%20pullback%20as%20the%20trapped%20block%2C%20whereas%20a%20bullish%20engulfing%20inside%20a%20decline%20marks%20buyers%20who%20will%20keep%20running%20into%20supply%20above.%20This%20is%20not%20a%20parameter%20variant%20of%20the%20previous%20hypothesis%3A%20the%20previous%20one%20is%20the%20canon%27s%20unconditional%20claim%20and%20this%20one%20is%20the%20claim%20that%20the%20effect%20is%20CONDITIONAL%20on%20the%20regime%3B%20the%20contrast%20between%20the%20two%20is%20the%20informative%20quantity%2C%20and%20the%20EMA%20200%20is%20fixed%20at%20its%20conventional%20value%20and%20not%20searched%20over.\nprior=We%20expect%20a%20positive%20edge%2C%20larger%20than%20candles.engulfing_raw%27s%2C%20and%20we%20expect%20the%20difference%20between%20the%20two%20to%20be%20larger%20than%20the%20absolute%20edge%20of%20either.%20It%20fails%20if%20the%20filter%20improves%20nothing%20%28the%20pattern%20is%20not%20context-sensitive%20and%20its%20declared%20mechanism%20is%20false%29%20and%20it%20fails%20just%20the%20same%20if%20it%20improves%20but%20with%20a%20negative%20net%20expectancy%2C%20which%20would%20be%20nothing%20but%20BTC%27s%20structural%20bullish%20bias%2C%20filtered%20%E2%80%94%20not%20the%20pattern.\nparams_json=%7B%22ema%22%3A%22200%22%2C%22hold%22%3A%221%22%2C%22pattern%22%3A%22CDLENGULFING%22%7D\nparams_sha256=7134cf5e79c9d807d15edca800ab98bfd1ace58819285e60b5e8a81ec71fd899\ncode_text=def%20_engulfing_with_trend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLENGULFING%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%20200%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20ema%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=980e9e6a72d20758a38b1d5b2b5eaad966aa1d86878918f99cbe19044e5619a3\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":23,"row_hash":"177d7f84c938ff0313025857271ae440fd4ce3099e0520bc9e59e9883ab51fe7","body":"wavelab-journal-chain\nv=3\nseq=23\nprev=e0f07e981b5d2d688dfea97fd1b087b0fddad214ef4dcd886d7ee0c57d166e40\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.hammer_oversold\nprereg_seq=2\nfamily=candles\ntitle=Hammer%20after%20an%20oversold%20fall\nrationale=A%20hammer%20is%20a%20candle%20whose%20price%20fell%20a%20long%20way%20and%20came%20back%3A%20the%20lower%20wick%20is%20the%20visible%20footprint%20of%20passive%20demand%20that%20absorbed%20all%20the%20aggressive%20selling%20and%20handed%20the%20price%20back.%20That%20only%20says%20something%20after%20a%20fall%2C%20when%20the%20aggressive%20selling%20is%20forced%20liquidation%20and%20not%20orderly%20placement%3A%20the%20forced%20seller%20is%20spent%20within%20hours%2C%20the%20buyer%20who%20absorbed%20is%20still%20there%2C%20and%20the%20imbalance%20resolves%20upwards.%20Without%20the%20fall%20beforehand%2C%20the%20same%20shape%20is%20just%20another%20candle%20inside%20a%20range%2C%20which%20is%20why%20the%20oversold%20condition%20is%20part%20of%20the%20hypothesis%20and%20not%20an%20add-on.\nprior=We%20expect%20a%20small%20positive%20edge%20and%20only%20on%20the%20long%20side.%20We%20expect%20it%20to%20fail%20exactly%20where%20the%20selling%20is%20not%20forced%20but%20informed%3A%20in%20sustained%20downtrends%20every%20absorption%20gets%20retested%20and%20the%20hammer%20turns%20into%20a%20falling%20knife%2C%20so%20we%20anticipate%20a%20fat%20left%20tail%20and%20a%20high%20hit%20rate%20with%20mediocre%20expectancy.%20Falsified%20if%20the%20sign%20is%20negative%2C%20or%20if%20the%20net%20delta%20against%20the%20null%20arm%20cannot%20be%20told%20apart%20from%20zero.\nparams_json=%7B%22hold%22%3A%221%22%2C%22pattern%22%3A%22CDLHAMMER%22%2C%22rsi%22%3A%2214%22%2C%22rsi_threshold%22%3A%2230%22%7D\nparams_sha256=de30cb37bac8dcfe408849f97f93a4ad60214073f3dd6b55007d1e782975ed2e\ncode_text=def%20_hammer_oversold%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLHAMMER%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20rsi%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%20%26%20%28rsi%20%3C%2030.0%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=5100ce0b332c33d94f8b46e6109dbf254120ea796729c68feb11993470fcf7e7\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":24,"row_hash":"aa6fa737ad21027ffb26a2a726b9b1954966908e7ee0c2d5be0703ec4902c67f","body":"wavelab-journal-chain\nv=3\nseq=24\nprev=177d7f84c938ff0313025857271ae440fd4ce3099e0520bc9e59e9883ab51fe7\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.inside_bar_break\nprereg_seq=2\nfamily=candles\ntitle=Inside%20candle%2C%20then%20close%20beyond%20the%20mother\nrationale=A%20candle%20contained%20within%20the%20range%20of%20the%20previous%20one%20is%20a%20contraction%20of%20the%20traded%20range%3A%20both%20sides%20accept%20the%20same%20price%20interval%20and%20uncertainty%20drops.%20Protective%20orders%20pile%20up%20there%20on%20both%20sides%20of%20the%20mother%20candle%27s%20extremes.%20The%20next%20candle%20closing%20outside%20that%20range%20means%20the%20passive%20liquidity%20on%20one%20side%20has%20been%20consumed%2C%20and%20the%20path%20of%20least%20resistance%20becomes%20the%20cluster%20of%20stops%20on%20the%20other.%20The%20break%20is%20judged%20with%20the%20CLOSE%20of%20the%20candle%20in%20progress%20against%20extremes%20of%20candles%20already%20closed%2C%20never%20with%20the%20intrabar%20high%2C%20so%20that%20the%20decision%20belongs%20to%20candle%20i%20and%20not%20to%20data%20that%20is%20only%20known%20afterwards.\nprior=We%20expect%20continuation%20with%20a%20small%20positive%20edge%20on%204h%20and%201d.%20With%20low%20confidence%3A%20there%20is%20an%20equally%20plausible%20opposing%20mechanism%20in%20BTC%2C%20namely%20that%20the%20stop%20cluster%20is%20the%20TARGET%20of%20the%20aggressive%20flow%20and%20not%20its%20fuel%2C%20in%20which%20case%20the%20break%20is%20false%20by%20construction%20and%20the%20sign%20comes%20out%20negative.%20We%20also%20expect%20it%20to%20get%20worse%20as%20the%20timeframe%20drops%2C%20because%20range%20contraction%20on%201h%20is%20mostly%20low-volume%20hours%20and%20not%20agreement%20between%20participants.%20Falsified%20by%20a%20stable%20negative%20sign.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20this%20hypothesis%20was%20registered%20TWICE.%20%60structure.inside_bar_break%60%20was%20the%20same%20rule%20%E2%80%94same%20containment%2C%20same%20mother-candle%20extremes%20as%20the%20level%2C%20same%20confirmation%20by%20close%E2%80%94%20and%20its%20244%20events%20were%20a%20strict%20subset%20of%20this%20one%27s%20293%3B%20it%20has%20been%20removed%20there%20and%20this%20is%20the%20surviving%20registration.%20It%20is%20further%20declared%20that%20%60volatility.inside_bar_breakout%60%20operates%20on%20the%20SAME%20two-candle%20pattern%20but%20breaking%20the%20extremes%20of%20the%20INSIDE%20candle%20rather%20than%20those%20of%20the%20mother%3A%20since%20the%20inside%20candle%27s%20high%20is%20the%20lower%20of%20the%20two%2C%20every%20event%20of%20this%20hypothesis%20is%20also%20an%20event%20of%20that%20one.%20They%20are%20different%20levels%20and%20different%20mechanical%20claims%2C%20so%20that%20one%20is%20kept%2C%20but%20the%20two%20are%20DEPENDENT%20trials%20and%20the%20multiple-comparisons%20correction%20must%20treat%20them%20as%20such.\nparams_json=%7B%22confirmation%22%3A%22close%22%2C%22mother_bars%22%3A%221%22%7D\nparams_sha256=b66e11a96d0cff22f8c4891c508d51da08db391375f9ff2d861615735a8beeaf\ncode_text=def%20_inside_bar_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20h1%2C%20l1%20%3D%20_lag%28h%2C%201%29%2C%20_lag%28l%2C%201%29%0A%20%20%20%20h2%2C%20l2%20%3D%20_lag%28h%2C%202%29%2C%20_lag%28l%2C%202%29%0A%20%20%20%20ok%20%3D%20_no_nan%28c%2C%20h1%2C%20l1%2C%20h2%2C%20l2%29%0A%20%20%20%20inside%20%3D%20ok%20%26%20%28h1%20%3C%3D%20h2%29%20%26%20%28l1%20%3E%3D%20l2%29%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3E%20h2%29%5D%20%3D%201%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3C%20l2%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=c02248d6ab376f9950e74d0bd010a286116c26b26c67c5bc5cde3266b456440d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":25,"row_hash":"2e2e71dfb93cd33a7c873244ff7aab6a0fc171a5eeeb877d03853e7be882b7b5","body":"wavelab-journal-chain\nv=3\nseq=25\nprev=aa6fa737ad21027ffb26a2a726b9b1954966908e7ee0c2d5be0703ec4902c67f\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.marubozu_continuation\nprereg_seq=2\nfamily=candles\ntitle=Big%20body%2C%20no%20wick%20at%20the%20close\nrationale=A%20closing%20marubozu%20is%20a%20large%20body%20with%20no%20wick%20on%20the%20close%20side%3A%20throughout%20the%20whole%20candle%20there%20was%20not%20one%20moment%20in%20which%20the%20losing%20side%20managed%20to%20hand%20the%20price%20back%2C%20not%20even%20at%20the%20end.%20It%20is%20the%20signature%20of%20a%20flow%20imbalance%20that%20met%20no%20passive%20opposition%2C%20and%20an%20imbalance%20like%20that%20does%20not%20expire%20exactly%20at%20the%20arbitrary%20boundary%20of%20the%20candle.%20The%20closing%20variant%20is%20used%20and%20not%20the%20strict%20marubozu%20because%20the%20informative%20extreme%20is%20the%20close%3B%20also%20demanding%20no%20wick%20at%20the%20open%20only%20adds%20rarity%20without%20adding%20mechanism.\nprior=We%20expect%20continuation%20in%20the%20direction%20of%20the%20body%2C%20with%20a%20small%20positive%20edge.%20We%20expect%20it%20to%20fail%20at%20range%20extremes%20and%20at%20the%20end%20of%20long%20runs%2C%20where%20the%20same%20candle%20is%20capitulation%20and%20not%20impulse%3B%20as%20we%20do%20not%20tell%20the%20two%20cases%20apart%20ex%20ante%2C%20the%20average%20of%20both%20should%20come%20out%20weak.%20Falsified%20if%20the%20net%20sign%20is%20negative%2C%20which%20would%20support%20the%20exhaustion%20reading%20over%20the%20continuation%20one.\nparams_json=%7B%22hold%22%3A%221%22%2C%22pattern%22%3A%22CDLCLOSINGMARUBOZU%22%7D\nparams_sha256=419928e5f439112fe23eadd17ba4e0e8b52ef4e81bb0af2ca8140d249293c1cf\ncode_text=def%20_marubozu_continuation%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLCLOSINGMARUBOZU%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=f210d64c453d58d92a442a124225d74e40ccbae290baad556f656f098efc455e\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":26,"row_hash":"6ff029a428d986802def23f3caa5ce206a91ef9978aa96ac79cdf9f8f9d19a68","body":"wavelab-journal-chain\nv=3\nseq=26\nprev=2e2e71dfb93cd33a7c873244ff7aab6a0fc171a5eeeb877d03853e7be882b7b5\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.outsized_wick\nprereg_seq=2\nfamily=candles\ntitle=Fade%20the%20long%20wick%2C%20no%20context%20required\nrationale=A%20long%20wick%20is%20the%20footprint%20of%20a%20level%20the%20price%20reached%20and%20came%20back%20from%3A%20proof%20that%20there%20really%20was%20passive%20liquidity%20there%2C%20which%20absorbed%20the%20aggressive%20flow%20and%20was%20left%20partly%20unfilled.%20Whoever%20has%20a%20large%20order%20at%20that%20price%20puts%20it%20back%2C%20so%20the%20level%20acts%20as%20a%20soft%20floor%20or%20ceiling%20over%20the%20following%20candles.%20It%20is%20defined%20by%20geometry%20alone%20%E2%80%94wick%20greater%20than%20twice%20the%20body%20and%20more%20than%2060%25%20of%20the%20range%2C%20symmetric%20above%20and%20below%E2%80%94%20and%20without%20requiring%20a%20prior%20trend%20or%20a%20body%20position%2C%20precisely%20in%20order%20to%20separate%20the%20absorption%20effect%20from%20the%20vocabulary%20of%20hammer%20and%20shooting%20star%2C%20which%20add%20context%20conditions.\nprior=We%20expect%20a%20small%20positive%20edge%20in%20the%20direction%20opposite%20to%20the%20wick%2C%20larger%20on%204h%20than%20on%2015m.%20We%20expect%20it%20to%20fail%20in%20strong%20trends%2C%20where%20a%20long%20lower%20wick%20inside%20a%20fall%20is%20not%20absorption%20but%20a%20partial%20retracement%20before%20continuing%2C%20and%20we%20expect%20that%20on%2015m%20the%20gross%20edge%20will%20exist%20but%20will%20disappear%20once%20fees%20are%20deducted.%20Falsified%20if%20the%20sign%20is%20negative%2C%20or%20if%20it%20beats%20the%20null%20arm%20on%20no%20timeframe.\nparams_json=%7B%22wick_vs_body%22%3A%222.00000000%22%2C%22wick_vs_range%22%3A%220.60000000%22%7D\nparams_sha256=5a9cfee6400ec7c261526b85571578cb307b1e9796c979d889b8e8c380289fd4\ncode_text=def%20_outsized_wick%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20ok%20%3D%20_no_nan%28o%2C%20h%2C%20l%2C%20c%29%0A%20%20%20%20rng%20%3D%20h%20-%20l%0A%20%20%20%20ok%20%26%3D%20rng%20%3E%200.0%0A%20%20%20%20body%20%3D%20np.abs%28c%20-%20o%29%0A%20%20%20%20lower_wick%20%3D%20np.minimum%28o%2C%20c%29%20-%20l%0A%20%20%20%20upper_wick%20%3D%20h%20-%20np.maximum%28o%2C%20c%29%0A%20%20%20%20long_side%20%3D%20ok%20%26%20%28lower_wick%20%3E%3D%202.0%20%2A%20body%29%20%26%20%28lower_wick%20%3E%3D%200.60%20%2A%20rng%29%0A%20%20%20%20short_side%20%3D%20ok%20%26%20%28upper_wick%20%3E%3D%202.0%20%2A%20body%29%20%26%20%28upper_wick%20%3E%3D%200.60%20%2A%20rng%29%0A%20%20%20%20out%5Blong_side%5D%20%3D%201%0A%20%20%20%20out%5Bshort_side%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=c5c7c3ee94b94b7264cae516fcad65c31f521801b5f32a5e7bc254e44958d89a\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":27,"row_hash":"5350b117fc8a963533a50306d6e759b113e3bbf65d5bf01d7156486ff91ff652","body":"wavelab-journal-chain\nv=3\nseq=27\nprev=6ff029a428d986802def23f3caa5ce206a91ef9978aa96ac79cdf9f8f9d19a68\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.range_expansion\nprereg_seq=2\nfamily=candles\ntitle=Ride%20a%20candle%20that%20doubles%20the%20ATR\nrationale=A%20candle%20whose%20true%20range%20doubles%20the%20ATR%20of%20the%20previous%2014%20is%20not%20noise%3A%20it%20is%20a%20repricing%20in%20which%20the%20book%20was%20traded%20straight%20through.%20Our%20mechanism%20is%20informational%3A%20new%20information%20has%20come%20in%2C%20volatility%20clusters%2C%20and%20whoever%20has%20to%20reposition%20a%20large%20portfolio%20does%20not%20do%20it%20inside%20a%20single%20candle%2C%20so%20the%20drift%20carries%20on%20in%20the%20direction%20the%20body%20closed.%20The%20ATR%20is%20compared%20lagged%20by%20one%20candle%20so%20that%20the%20reference%20is%20the%20norm%20BEFORE%20the%20shock%20and%20not%20a%20norm%20already%20contaminated%20by%20it.%20The%20signal%20is%20held%20for%20three%20candles%20because%20the%20declared%20mechanism%20%E2%80%94sliced%20repositioning%E2%80%94%20lasts%20more%20than%20one%2C%20not%20because%20three%20works%20better.\nprior=We%20expect%20continuation%3A%20a%20positive%20edge%20in%20the%20direction%20of%20the%20shock%20candle%27s%20body.%20There%20is%20an%20explicit%20and%20credible%20rival%20mechanism%20%E2%80%94that%20the%20large%20range%20is%20a%20liquidation%20cascade%2C%20that%20is%2C%20forced%20flow%20carrying%20no%20information%2C%20which%20market%20makers%20revert%20as%20they%20requote%E2%80%94%20and%20that%20mechanism%20predicts%20the%20OPPOSITE%20sign.%20That%20is%20why%20the%20sign%20of%20the%20result%20is%20informative%20whatever%20happens%3A%20positive%20supports%20the%20informational%20reading%2C%20negative%20supports%20the%20forced-flow%20one%2C%20and%20zero%20says%20the%20two%20cancel%20out%20because%20we%20do%20not%20tell%20the%20two%20cases%20apart%20ex%20ante%2C%20which%20is%20what%20we%20consider%20most%20likely%20on%2015m.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20%60volatility.wide_range_thrust%60%20applies%20this%20very%20same%20rule%20%28true%20range%20greater%20than%20twice%20the%20previous%20ATR%2C%20direction%20given%20by%20the%20body%29%20with%20one%20added%20condition%20%E2%80%94that%20the%20previous%20candle%27s%20ATR%20was%20below%20its%20100-bar%20median%E2%80%94%20and%20without%20holding%20the%20signal%20for%20three%20candles.%20Measured%20on%20data%2C%20its%20events%20are%20an%20almost%20exact%20SUBSET%20of%20this%20hypothesis%27s%20%28263%20of%20267%20match%20candle%20for%20candle%29.%20Neither%20is%20removed%2C%20because%20the%20unfiltered%20%2F%20filtered%20pair%20is%20informative%20and%20that%20contrast%20was%20declared%20in%20neither%20of%20the%20two%20files%2C%20but%20let%20it%20be%20said%20now%3A%20they%20are%20not%20two%20independent%20trials%20and%20they%20must%20not%20be%20read%20as%20cross-family%20confirmation%20if%20both%20come%20out%20positive.%20The%20contrast%20that%20matters%20is%20whether%20the%20compression%20gate%20improves%20on%20this%20one.\nparams_json=%7B%22atr%22%3A%2214%22%2C%22hold%22%3A%223%22%2C%22multiple%22%3A%222.00000000%22%7D\nparams_sha256=684d179941b6f75760b3e4f62f94d10645145e74d4472db0bd35c55278906048\ncode_text=def%20_range_expansion%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20atr_prev%20%3D%20_lag%28talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%2C%201%29%0A%20%20%20%20ok%20%3D%20_no_nan%28tr%2C%20atr_prev%2C%20o%2C%20c%29%20%26%20%28atr_prev%20%3E%200.0%29%0A%20%20%20%20shock%20%3D%20ok%20%26%20%28tr%20%3E%3D%202.0%20%2A%20atr_prev%29%0A%20%20%20%20pulse%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20pulse%5Bshock%20%26%20%28c%20%3E%20o%29%5D%20%3D%201%0A%20%20%20%20pulse%5Bshock%20%26%20%28c%20%3C%20o%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28pulse%2C%203%29%0A\ncode_sha256=605be144adcad379079a68f107f47490fcbf1bfb608f1a3613691adf4d3a94c5\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":28,"row_hash":"dcd083629d3238a658ee8f4d17589e14b5a7d9a9007172b682edde421f1eec9b","body":"wavelab-journal-chain\nv=3\nseq=28\nprev=5350b117fc8a963533a50306d6e759b113e3bbf65d5bf01d7156486ff91ff652\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.range_gap\nprereg_seq=2\nfamily=candles\ntitle=Fade%20the%20gap%2C%20expect%20it%20to%20fill\nrationale=BTC%20trades%20without%20interruption%2C%20so%20a%20gap%20cannot%20be%20the%20result%20of%20information%20piling%20up%20while%20the%20market%20was%20closed%3A%20if%20a%20candle%27s%20entire%20range%20sits%20above%20the%20previous%20candle%27s%20high%2C%20the%20book%20has%20been%20emptied%20and%20the%20price%20has%20travelled%20with%20no%20trading%20in%20between.%20That%20is%20forced%20flow%20%E2%80%94chained%20liquidations%2C%20or%20a%20stretch%20of%20very%20thin%20liquidity%E2%80%94%20and%20not%20a%20consented%20repricing%3A%20as%20soon%20as%20the%20market%20makers%20quote%20again%2C%20the%20gap%20fills.%20Warning%20registered%20in%20advance%3A%20a%20hole%20in%20the%20provider%27s%20data%20produces%20exactly%20this%20same%20shape%2C%20so%20a%20positive%20result%20obliges%20us%20to%20check%20the%20continuity%20of%20the%20timestamps%20before%20believing%20it.\nprior=We%20expect%20reversion%3A%20a%20positive%20edge%20trading%20AGAINST%20the%20gap%2C%20larger%20on%2015m%20than%20on%204h.%20We%20expect%20it%20to%20fail%20when%20the%20gap%20answers%20to%20real%20news%20%28a%20legitimate%20repricing%20that%20does%20not%20fill%29%2C%20a%20case%20we%20cannot%20tell%20apart%20ex%20ante%2C%20and%20we%20expect%20very%20few%20signals%20on%204h%2C%20where%20a%20full-range%20gap%20implies%20a%20change%20of%20regime%20and%20ought%20to%20continue%20rather%20than%20revert.%20Falsified%20if%20the%20sign%20is%20one%20of%20continuation%20on%2015m%20and%201h.\nparams_json=%7B%22type%22%3A%22full_range_gap%22%7D\nparams_sha256=e193faee4721d7aa5297d3aa1cd50642c57b71441d6ad3b92fa0a43cf8a4102d\ncode_text=def%20_range_gap%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20_c%20%3D%20_ohlc%28s%29%0A%20%20%20%20h1%2C%20l1%20%3D%20_lag%28h%2C%201%29%2C%20_lag%28l%2C%201%29%0A%20%20%20%20ok%20%3D%20_no_nan%28h%2C%20l%2C%20h1%2C%20l1%29%0A%20%20%20%20out%5Bok%20%26%20%28l%20%3E%20h1%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bok%20%26%20%28h%20%3C%20l1%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=d267a414a80f11e3d341660e49e6a19ec985fa4c805b59df31c7b30b9c5b3e66\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":29,"row_hash":"839cefd0664f8e34bc1b1c5460ebdaf9453af80bb8214e3fe0aef22a4170412e","body":"wavelab-journal-chain\nv=3\nseq=29\nprev=dcd083629d3238a658ee8f4d17589e14b5a7d9a9007172b682edde421f1eec9b\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.shooting_star_overbought\nprereg_seq=2\nfamily=candles\ntitle=Shooting%20star%20after%20an%20overbought%20rise\nrationale=Exact%20mirror%20of%20the%20hammer%3A%20a%20long%20upper%20wick%20after%20a%20rise%2C%20that%20is%2C%20passive%20supply%20that%20absorbed%20all%20the%20aggressive%20buying%20and%20handed%20the%20price%20back.%20It%20is%20registered%20separately%20rather%20than%20as%20the%20short%20side%20of%20the%20same%20hypothesis%20because%20the%20mechanism%20is%20NOT%20symmetric%3A%20aggressive%20buying%20at%20highs%20is%20discretionary%20and%20can%20walk%20away%20at%20no%20cost%2C%20whereas%20aggressive%20selling%20at%20lows%20is%20usually%20forced%20liquidation%20on%20a%20deadline.%20If%20the%20canon%27s%20symmetry%20held%2C%20both%20hypotheses%20ought%20to%20give%20a%20similar%20edge%3B%20the%20comparison%20between%20the%20two%20is%20the%20content%20of%20this%20pair.\nprior=We%20expect%20an%20effect%20clearly%20SMALLER%20than%20the%20hammer%27s%20and%20we%20accept%20a%20negative%20expectancy%20as%20a%20likely%20outcome%3A%20shorting%20into%20strength%20in%20BTC%20fights%20both%20the%20asset%27s%20positive%20drift%20and%20the%20market%27s%20long%20bias%20at%20once%2C%20and%20the%20funding%20cost%20of%20the%20short%20is%20not%20recovered%20within%20one%20candle.%20Falsified%20if%20its%20edge%20matches%20or%20beats%20the%20hammer%27s%2C%20which%20would%20mean%20absorption%20is%20symmetric%20and%20our%20forced-flow%20explanation%20is%20superfluous.\nparams_json=%7B%22hold%22%3A%221%22%2C%22pattern%22%3A%22CDLSHOOTINGSTAR%22%2C%22rsi%22%3A%2214%22%2C%22rsi_threshold%22%3A%2270%22%7D\nparams_sha256=4b5f859fb1f0e19a92feeda4baa273364453cc4068cd94a2eeafebe0c9b5029a\ncode_text=def%20_shooting_star_overbought%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20len%28s%29%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20p%20%3D%20np.asarray%28talib.CDLSHOOTINGSTAR%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_no_nan%28p%2C%20rsi%29%0A%20%20%20%20out%5Bok%20%26%20%28p%20%3C%200%29%20%26%20%28rsi%20%3E%2070.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=05948fa80919341e60b29adec263d2854fb2a3bbdf9d7b215776a81f91d948e1\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":30,"row_hash":"aa21ade935f1830177b00f0c1107ecc19c2b0b953e561ddcabaaf30a48daeb2d","body":"wavelab-journal-chain\nv=3\nseq=30\nprev=839cefd0664f8e34bc1b1c5460ebdaf9453af80bb8214e3fe0aef22a4170412e\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=candles.three_directional_bars\nprereg_seq=2\nfamily=candles\ntitle=Three%20soldiers%20or%20crows%2C%20a%20sliced%20order\nrationale=Three%20candles%20in%20a%20row%20with%20wide%20bodies%2C%20each%20closing%20near%20its%20high%20and%20above%20the%20previous%20one%2C%20is%20not%20an%20impulse%3A%20it%20is%20the%20footprint%20of%20a%20large%20order%20being%20executed%20in%20slices%20over%20time.%20A%20speculative%20impulse%20burns%20out%20in%20one%20candle%3B%20an%20execution%20programme%20follows%20a%20schedule%20and%20that%20is%20why%20it%20leaves%20three%20identical%20candles.%20If%20the%20reading%20is%20right%2C%20the%20unexecuted%20part%20of%20the%20programme%20goes%20on%20buying%20after%20the%20third%20candle%2C%20and%20that%20is%20why%20the%20signal%20is%20held%20for%20three%20candles%3A%20it%20is%20the%20horizon%20of%20the%20declared%20mechanism%2C%20not%20a%20value%20chosen%20for%20performance.\nprior=We%20expect%20weak%20continuation.%20Weak%20because%20the%20entry%20is%20late%20by%20construction%3A%20by%20the%20time%20the%20pattern%20completes%2C%20three%20candles%20of%20the%20move%20have%20already%20happened%20and%20we%20are%20buying%20against%20the%20executor%20itself.%20We%20register%20in%20advance%20that%20both%20patterns%20are%20rare%20and%20that%20the%20number%20of%20signals%20will%20be%20small%2C%20so%20the%20interval%20will%20be%20wide%20and%20the%20multiple-comparisons%20correction%20must%20be%20applied%20all%20the%20same%3A%20a%20spectacular%20result%20with%20a%20small%20n%20counts%20as%20inconclusive%2C%20not%20as%20a%20finding.%20Falsified%20by%20a%20negative%20sign%2C%20which%20would%20support%20the%20exhaustion%20reading.\nparams_json=%7B%22hold%22%3A%223%22%2C%22patterns%22%3A%22CDL3WHITESOLDIERS%2FCDL3BLACKCROWS%22%7D\nparams_sha256=afb6c3e55b7005260f6160d744484ab93944eb249443a7c98531b9f088780e2c\ncode_text=def%20_three_directional_bars%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20soldiers%20%3D%20np.asarray%28talib.CDL3WHITESOLDIERS%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20crows%20%3D%20np.asarray%28talib.CDL3BLACKCROWS%28o%2C%20h%2C%20l%2C%20c%29%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ok%20%3D%20_no_nan%28soldiers%2C%20crows%29%0A%20%20%20%20pulse%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20pulse%5Bok%20%26%20%28soldiers%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20pulse%5Bok%20%26%20%28crows%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28pulse%2C%203%29%0A\ncode_sha256=ed00741f435f1845bbf778a5417eba3bb23e40990ec22b4c35a4420b4c2b94c3\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fcandles.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":31,"row_hash":"026c57c9e931eb8100fb59b0d838ef3e8dd14c33a66903cea7d7d21038fdf1b7","body":"wavelab-journal-chain\nv=3\nseq=31\nprev=aa21ade935f1830177b00f0c1107ecc19c2b0b953e561ddcabaaf30a48daeb2d\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.absorption_narrow_range\nprereg_seq=2\nfamily=flow\ntitle=Double%20volume%20that%20fails%20to%20move%20price\nrationale=It%20is%20the%20complementary%2C%20disjoint%20cell%20to%20%60volume_thrust%60%20in%20Wyckoff%27s%20effort%2Fresult%20table%3A%20the%20same%20double%20volume%2C%20but%20a%20range%20SMALLER%20than%20the%20ATR.%20Twice%20the%20usual%20number%20of%20contracts%20changing%20hands%20while%20the%20price%20does%20not%20move%20has%20only%20one%20mechanical%20explanation%3A%20there%20is%20a%20large%20passive%20order%20on%20one%20side%20of%20the%20book%20replenishing%20itself%20as%20fast%20as%20it%20is%20eaten.%20Whoever%20has%20the%20size%20to%20do%20that%20knows%20their%20target%20price%20and%20is%20not%20finished%3B%20when%20the%20aggressor%20tires%2C%20the%20price%20moves%20towards%20the%20absorber%27s%20side%2C%20which%20is%20the%20side%20the%20candle%20closed%20on.%20The%20direction%20is%20given%20by%20the%20sign%20of%20the%20close%20within%20the%20range%2C%20with%20no%20free%20threshold.\nprior=We%20expect%20a%20small%20positive%20edge%20over%205%20candles%2C%20and%20a%20lower%20frequency%20than%20the%20thrust.%20We%20expect%20it%20to%20fail%20in%20areas%20of%20accepted%20value%20%E2%80%94the%20middle%20of%20a%20long%20range%E2%80%94%20where%20high%20volume%20and%20a%20narrow%20range%20is%20simply%20the%20market%27s%20normal%20equilibrium%20and%20there%20is%20no%20absorber%20at%20all.%20Being%20disjoint%20from%20%60volume_thrust%60%20by%20construction%2C%20the%20comparison%20between%20the%20two%20is%20clean%3A%20if%20both%20come%20out%20positive%2C%20high%20relative%20volume%20is%20worth%20something%20on%20its%20own%20and%20the%20range%20adds%20nothing%3B%20if%20only%20one%20does%2C%20the%20effort%2Fresult%20axis%20is%20real.\nparams_json=%7B%22atr%22%3A%2214%22%2C%22hold_bars%22%3A%225%22%2C%22relative_volume%22%3A%222.00000000%22%2C%22volume_mean%22%3A%2220%22%7D\nparams_sha256=a204dd7aa5aa0236acb1beaf24217af0dc3cf7ef13f27912ff2d25f6b1986075\ncode_text=def%20_absorption%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20h%2C%20l%2C%20c%2C%20v%20%3D%20_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20v_mean%20%3D%20talib.SMA%28v%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20clv%20%3D%20_clv%28s%29%0A%20%20%20%20rel%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28v%2C%20v_mean%2C%20out%3Drel%2C%20where%3D~np.isnan%28v_mean%29%20%26%20%28v_mean%20%3E%200.0%29%29%0A%20%20%20%20ok%20%3D%20_finite%28rel%2C%20atr%2C%20tr%29%20%26%20%28atr%20%3E%200.0%29%0A%20%20%20%20absorbing%20%3D%20ok%20%26%20%28rel%20%3E%202.0%29%20%26%20%28tr%20%3C%20atr%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Babsorbing%20%26%20%28clv%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20ev%5Babsorbing%20%26%20%28clv%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A\ncode_sha256=ab057861d0d5229a63896da74871c47e8ed8b1e9d3ddd46d074d8cf2054066ab\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":32,"row_hash":"f0ed2c80d5eec8e1ac1ee0011d41128060fdd18168ecd06d346a19742c5f63c2","body":"wavelab-journal-chain\nv=3\nseq=32\nprev=026c57c9e931eb8100fb59b0d838ef3e8dd14c33a66903cea7d7d21038fdf1b7\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.chaikin_osc_3_10\nprereg_seq=2\nfamily=flow\ntitle=Side%20with%20accelerating%20Chaikin%20accumulation\nrationale=The%20Accumulation%2FDistribution%20line%20is%20the%20cumulative%20volume%20delta%20that%20can%20be%20approximated%20without%20aggressor%20data%3A%20it%20splits%20each%20candle%27s%20volume%20between%20buying%20and%20selling%20according%20to%20where%20it%20closes%20inside%20the%20range%2C%20which%20is%20exactly%20what%20%60taker_buy_base%60%20would%20measure%20if%20%60Series%60%20exposed%20it.%20The%20Chaikin%20oscillator%20is%20its%20momentum%20%28EMA%203%20minus%20EMA%2010%29%2C%20that%20is%2C%20whether%20the%20cumulative%20delta%20is%20accelerating.%20An%20accelerating%20delta%20means%20the%20imbalance%20between%20buy-side%20and%20sell-side%20aggression%20is%20growing%2C%20and%20that%20imbalance%20is%20what%20moves%20the%20price%20in%20the%20short%20run.\nprior=We%20expect%20a%20small%20positive%20edge%2C%20smaller%20than%20%60obv_ema21%60%27s%2C%20because%20splitting%20by%20the%20position%20of%20the%20close%20penalises%20exactly%20the%20candles%20with%20wicks%2C%20which%20in%20BTC%20are%20the%20informative%20ones.%20We%20expect%20it%20to%20fail%20systematically%20on%20candles%20with%20long%20wicks%20caused%20by%20stop%20runs%2C%20where%20the%20close%20comes%20back%20to%20the%20middle%20of%20the%20range%20and%20the%20indicator%20records%20%27indecision%27%20at%20the%20very%20moment%20of%20maximum%20directional%20flow.%20If%20it%20came%20out%20better%20than%20OBV%2C%20the%20CLV%20aggression%20proxy%20would%20be%20more%20informative%20than%20we%20think%20and%20the%20whole%20family%20would%20need%20revisiting.\nparams_json=%7B%22fast%22%3A%223%22%2C%22slow%22%3A%2210%22%7D\nparams_sha256=4cad4d3a20251f8b2779195c229e626ab068187cd1c0a566e1c77ba825b62cbf\ncode_text=def%20_chaikin%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20osc%20%3D%20talib.ADOSC%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fastperiod%3D3%2C%20slowperiod%3D10%29%0A%20%20%20%20ok%20%3D%20_finite%28osc%29%0A%20%20%20%20out%5Bok%20%26%20%28osc%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28osc%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=3f1856c01f3a7aebe004d70fb8b245ce3570af03c132510b6b16e9cb0234ade7\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":33,"row_hash":"605855370462993a1ec06e7f3b1cc574f713b6a227af9bc01fc2096f3d1dd69c","body":"wavelab-journal-chain\nv=3\nseq=33\nprev=f0ed2c80d5eec8e1ac1ee0011d41128060fdd18168ecd06d346a19742c5f63c2\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.mfi14_extremes\nprereg_seq=2\nfamily=flow\ntitle=Fade%20MFI%20at%2020%20and%2080\nrationale=The%20MFI%20is%20an%20RSI%20in%20which%20each%20candle%20is%20weighted%20by%20its%20volume%20in%20money%20terms%2C%20so%20it%20only%20reaches%2080%20when%20the%20rise%20has%20been%20made%20on%20growing%20volume.%20That%20state%20is%20one%20in%20which%20almost%20everybody%20who%20wanted%20to%20buy%20has%20already%20bought%2C%20and%20has%20done%20so%20with%20size%20on%20top%20of%20that%3A%20the%20incoming%20flow%20runs%20out%20for%20want%20of%20new%20participants%2C%20and%20the%20marginal%20position%20is%20leveraged%20and%20recent%2C%20which%20is%20to%20say%20fragile.%20Below%2020%20the%20symmetric%20thing%20happens%20with%20forced%20selling.\nprior=We%20expect%20a%20positive%20edge%20in%20a%20ranging%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20strong%20trend%2C%20because%20buying%20below%2020%20during%20a%20cascading%20fall%20is%20buying%20in%20front%20of%20a%20train.%20As%20the%20signal%20is%20a%20state%20and%20not%20an%20event%2C%20we%20also%20expect%20long%20runs%20of%20consecutive%20losses%20in%20the%20capitulations%20of%20March%202020%20or%20May%202021.%20If%20the%20overall%20edge%20came%20out%20positive%20but%20only%20thanks%20to%20a%20handful%20of%20enormous%20bounces%2C%20we%20will%20count%20it%20as%20inconclusive%20and%20not%20as%20a%20success.\nparams_json=%7B%22overbought%22%3A%2280%22%2C%22oversold%22%3A%2220%22%2C%22period%22%3A%2214%22%7D\nparams_sha256=b39452fb457e96963cfc6b1caa9446500d4cb292b121ff49ad08b56aca214a49\ncode_text=def%20_mfi14%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20mfi%20%3D%20talib.MFI%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%2C%2014%29%0A%20%20%20%20ok%20%3D%20_finite%28mfi%29%0A%20%20%20%20out%5Bok%20%26%20%28mfi%20%3C%2020.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28mfi%20%3E%2080.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=130d5717f76aee79d5723d0ce08d717d367696ab27d179bf734898678d1fcddd\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":34,"row_hash":"0e9fa5903a94b2244a6f709fc4d2d323700c603fe60609ebc5f5a8f22577269e","body":"wavelab-journal-chain\nv=3\nseq=34\nprev=605855370462993a1ec06e7f3b1cc574f713b6a227af9bc01fc2096f3d1dd69c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.move_without_volume\nprereg_seq=2\nfamily=flow\ntitle=Fade%20a%20move%20made%20on%20thinning%20volume\nrationale=The%20exact%20reverse%20of%20%60trend_with_participation%60%2C%20and%20that%20is%20why%20it%20is%20registered%3A%20a%20five-candle%20move%20made%20on%20volume%20below%20its%20own%2020-period%20average%20has%20transferred%20no%20inventory%2C%20it%20has%20only%20walked%20the%20price%20through%20an%20empty%20book.%20Nobody%20has%20had%20to%20accept%20a%20large%20position%20on%20the%20wrong%20side%2C%20so%20there%20is%20no%20participant%20obliged%20to%20defend%20the%20new%20level%2C%20and%20the%20first%20order%20of%20size%20that%20turns%20up%20will%20put%20it%20back%20where%20it%20was.%20The%20threshold%20is%20%27below%20the%20average%27%2C%20with%20no%20free%20constant%20to%20tune.\nprior=We%20expect%20a%20small%20positive%20edge%20on%2015m%2F1h%2C%20above%20all%20at%20weekends%20and%20during%20the%20Asian%20hours%2C%20when%20BTC%27s%20book%20is%20thinnest.%20We%20expect%20it%20to%20fail%20during%20the%20slow%20starts%20of%20a%20trend%2C%20in%20which%20the%20price%20rises%20for%20weeks%20on%20decreasing%20volume%20and%20fading%20loses%20continuously%3B%20that%20is%20the%20failure%20mode%20that%20worries%20us%20most%20because%20it%20is%20persistent%20and%20not%20noisy.%20If%20this%20hypothesis%20and%20%60trend_with_participation%60%20both%20came%20out%20positive%20in%20the%20same%20regime%2C%20we%20would%20conclude%20that%20the%20volume%20filter%20separates%20nothing%20and%20that%20they%20win%20on%20the%20sign%20of%20the%20momentum%2C%20not%20on%20the%20flow.\nparams_json=%7B%22roc%22%3A%225%22%2C%22volume_long%22%3A%2220%22%2C%22volume_short%22%3A%225%22%7D\nparams_sha256=e718fef84c9f7823041d1bab0f2d56489f1e784d968083abead8224ebb1a30c1\ncode_text=def%20_move_without_volume%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20v5%2C%20v20%20%3D%20talib.SMA%28v%2C%205%29%2C%20talib.SMA%28v%2C%2020%29%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%205%29%0A%20%20%20%20ok%20%3D%20_finite%28v5%2C%20v20%2C%20roc%29%20%26%20%28v20%20%3E%200.0%29%0A%20%20%20%20dry%20%3D%20ok%20%26%20%28v5%20%3C%20v20%29%0A%20%20%20%20out%5Bdry%20%26%20%28roc%20%3E%200.0%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bdry%20%26%20%28roc%20%3C%200.0%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=0fa500c666abb3ca1c71eee399fa16955a1624aaaea583a2608885b026db8c5c\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":35,"row_hash":"7f4370badc77392a275e47c3ab77108437122024d305457aab30e0abd5eca733","body":"wavelab-journal-chain\nv=3\nseq=35\nprev=0e9fa5903a94b2244a6f709fc4d2d323700c603fe60609ebc5f5a8f22577269e\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.obv_divergence20\nprereg_seq=2\nfamily=flow\ntitle=Fade%20the%20extreme%20OBV%20does%20not%20confirm\nrationale=A%20price%20high%20NOT%20accompanied%20by%20an%20OBV%20high%20means%20the%20last%20leg%20was%20signed%20by%20fewer%20contracts%20than%20the%20one%20before%3A%20price%20rises%20because%20supply%20has%20withdrawn%2C%20not%20because%20new%20demand%20has%20come%20in.%20A%20book%20that%20rises%20through%20the%20absence%20of%20sellers%20is%20thin%2C%20and%20one%20order%20of%20size%20is%20enough%20to%20go%20through%20it%20the%20other%20way.%20The%20symmetric%20reading%20holds%20at%20lows%3A%20a%20lower%20price%20with%20an%20OBV%20that%20no%20longer%20follows%20it%20indicates%20that%20the%20selling%20has%20run%20out%20of%20ammunition.\nprior=We%20expect%20a%20positive%20edge%20at%20a%20short%20horizon%20%28the%20event%20is%20held%20for%205%20candles%29%20and%20that%20it%20concentrates%20at%20range%20extremes%2C%20not%20in%20established%20trends.%20We%20expect%20it%20to%20FAIL%2C%20and%20to%20lose%20money%2C%20in%20strong%20and%20persistent%20trends%3A%20there%20the%20divergence%20shows%20up%20dozens%20of%20times%20in%20a%20row%20while%20price%20goes%20on%20rising%2C%20and%20this%20is%20precisely%20the%20indicator%20that%20ruins%20whoever%20tries%20to%20call%20tops.%20If%20the%20edge%20turned%20out%20to%20be%20as%20good%20in%20a%20trend%20as%20in%20a%20range%2C%20we%20would%20suspect%20the%20proxy%20before%20we%20suspected%20the%20market.\nparams_json=%7B%22hold_bars%22%3A%225%22%2C%22window%22%3A%2220%22%7D\nparams_sha256=41f876e214b0e9e3dbdbe2666089f804dc6c5183b3966b18e3c125c1c64ab724\ncode_text=def%20_obv_divergence%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20obv%20%3D%20talib.OBV%28c%2C%20_f%28s.volume%29%29%0A%20%20%20%20max_c%2C%20min_c%20%3D%20talib.MAX%28c%2C%2020%29%2C%20talib.MIN%28c%2C%2020%29%0A%20%20%20%20max_o%2C%20min_o%20%3D%20talib.MAX%28obv%2C%2020%29%2C%20talib.MIN%28obv%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28c%2C%20obv%2C%20max_c%2C%20min_c%2C%20max_o%2C%20min_o%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20%23%20talib%27s%20MAX%2FMIN%20include%20the%20current%20candle%3A%20%60c%20%3E%3D%20max_c%60%20is%20exactly%20%22new%2020-bar%20high%22.%0A%20%20%20%20ev%5Bok%20%26%20%28c%20%3E%3D%20max_c%29%20%26%20%28obv%20%3C%20max_o%29%5D%20%3D%20-1%0A%20%20%20%20ev%5Bok%20%26%20%28c%20%3C%3D%20min_c%29%20%26%20%28obv%20%3E%20min_o%29%5D%20%3D%201%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A\ncode_sha256=7cc5041912d4cd8b0054b2f1ce743148be82d0e9466e71bfaec59b7945ad3e81\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":36,"row_hash":"8e03f8e90faa558d95ff0b21d19c8f6448dfb8c29f2369fe740518c4f23d127b","body":"wavelab-journal-chain\nv=3\nseq=36\nprev=7f4370badc77392a275e47c3ab77108437122024d305457aab30e0abd5eca733\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.obv_ema21\nprereg_seq=2\nfamily=flow\ntitle=Long%20while%20OBV%20holds%20above%20its%20average\nrationale=OBV%20adds%20up%20each%20candle%27s%20entire%20volume%20with%20the%20sign%20of%20its%20close%2C%20so%20its%20slope%20measures%20whether%20the%20recent%20contracts%20have%20moved%20more%20on%20up%20candles%20or%20on%20down%20ones.%20The%20concrete%20mechanism%3A%20whoever%20buys%20into%20the%20rise%20ends%20up%20with%20inventory%20that%20can%20only%20be%20unwound%20by%20selling%2C%20and%20until%20it%20is%20unwound%20they%20hold%20up%20the%20bid%3B%20whoever%20sold%20has%20to%20buy%20back.%20When%20the%20cumulative%20line%20rises%20above%20its%20own%2021-period%20average%20there%20is%20more%20new%20inventory%20in%20long%20hands%20than%20has%20been%20let%20go%2C%20and%20that%20imbalance%20in%20positioning%20should%20push%20the%20price%20before%20it%20resolves.\nprior=We%20expect%20a%20small%20positive%20edge%20in%20a%20trending%20regime%20%284h%2F1d%29%20and%20no%20edge%20or%20a%20negative%20one%20in%20a%20range%2C%20where%20OBV%20crosses%20its%20average%20constantly%20without%20any%20real%20movement%20of%20inventory.%20Strong%20falsification%3A%20if%20the%20edge%20is%20the%20SAME%20in%20a%20trend%20and%20in%20a%20range%2C%20the%20declared%20mechanism%20is%20false%20and%20this%20is%20nothing%20more%20than%20a%20slow%20trend%20follower%20dressed%20up%20as%20volume.%20We%20also%20expect%20it%20to%20fail%20in%20periods%20dominated%20by%20liquidation%20cascades%2C%20where%20OBV%20attributes%20accumulation%20to%20what%20was%20forced%20liquidation.\nparams_json=%7B%22ema%22%3A%2221%22%7D\nparams_sha256=7b6f889f2026c1f748c0b5852dd4785e025aa756e7f30c3597b5bf1877f24132\ncode_text=def%20_obv_ema21%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20obv%20%3D%20talib.OBV%28_f%28s.close%29%2C%20_f%28s.volume%29%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28obv%2C%2021%29%0A%20%20%20%20ok%20%3D%20_finite%28obv%2C%20ema%29%0A%20%20%20%20out%5Bok%20%26%20%28obv%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28obv%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=010c9a84c127ef17612e99137c35c004a131f972079cbb67fad8e94ae5b0a9d5\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":37,"row_hash":"ed02c9da50ef9a4c1f6ed1b9ee0513c7c6433f17847fd370b37b80b01c1a29ec","body":"wavelab-journal-chain\nv=3\nseq=37\nprev=8e03f8e90faa558d95ff0b21d19c8f6448dfb8c29f2369fe740518c4f23d127b\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.obv_leads20\nprereg_seq=2\nfamily=flow\ntitle=Follow%20the%20extreme%20OBV%20reaches%20first\nrationale=It%20is%20the%20opposite%20cell%20of%20the%20same%202x2%20table%20as%20%60obv_divergence20%60%2C%20and%20it%20is%20registered%20separately%20because%20it%20asserts%20a%20different%20mechanism%20and%20trades%20in%20the%20opposite%20direction%3A%20here%20the%20cumulative%20volume%20marks%20a%20new%20high%20while%20price%20has%20not%20yet.%20That%20is%20the%20signature%20of%20a%20large%20buyer%20slicing%20their%20order%20against%20the%20available%20supply%3A%20they%20absorb%20everything%20that%20comes%20out%20without%20letting%20the%20price%20rise%2C%20because%20pushing%20it%20up%20would%20make%20their%20own%20execution%20more%20expensive.%20When%20they%20exhaust%20that%20supply%2C%20the%20price%20jumps%20with%20no%20resistance.%20Registering%20the%20two%20cells%20separately%20is%20what%20allows%20one%20to%20work%20and%20the%20other%20not%3B%20merging%20them%20into%20a%20single%20hypothesis%20would%20hide%20that%20result.\nprior=We%20expect%20a%20small%20positive%20edge%2C%20less%20frequent%20than%20the%20classic%20divergence.%20We%20expect%20it%20to%20fail%20in%20markets%20where%20volume%20is%20dominated%20by%20market%20makers%20recycling%20inventory%20in%20seconds%3A%20there%20the%20OBV%20shoots%20up%20without%20any%20directional%20accumulator%20existing%20at%20all.%20If%20%60obv_leads20%60%20and%20%60obv_divergence20%60%20both%20came%20out%20positive%20with%20a%20similar%20magnitude%2C%20we%20would%20read%20that%20not%20as%20two%20findings%20but%20as%20evidence%20that%20what%20wins%20is%20the%20plain%20%2720-candle%20extreme%27%20event%20and%20not%20the%20volume.\nparams_json=%7B%22hold_bars%22%3A%225%22%2C%22window%22%3A%2220%22%7D\nparams_sha256=41f876e214b0e9e3dbdbe2666089f804dc6c5183b3966b18e3c125c1c64ab724\ncode_text=def%20_obv_leads%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20obv%20%3D%20talib.OBV%28c%2C%20_f%28s.volume%29%29%0A%20%20%20%20max_c%2C%20min_c%20%3D%20talib.MAX%28c%2C%2020%29%2C%20talib.MIN%28c%2C%2020%29%0A%20%20%20%20max_o%2C%20min_o%20%3D%20talib.MAX%28obv%2C%2020%29%2C%20talib.MIN%28obv%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28c%2C%20obv%2C%20max_c%2C%20min_c%2C%20max_o%2C%20min_o%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bok%20%26%20%28obv%20%3E%3D%20max_o%29%20%26%20%28c%20%3C%20max_c%29%5D%20%3D%201%0A%20%20%20%20ev%5Bok%20%26%20%28obv%20%3C%3D%20min_o%29%20%26%20%28c%20%3E%20min_c%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A\ncode_sha256=1338b945cb6c770b5122c9bd400e0d410443fc041dd97bade0268c4d96baa118\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":38,"row_hash":"23f474c29eeaf253bbe2db2a1525c4df583cf8cfcdffb0b826700a93f2181834","body":"wavelab-journal-chain\nv=3\nseq=38\nprev=ed02c9da50ef9a4c1f6ed1b9ee0513c7c6433f17847fd370b37b80b01c1a29ec\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.roc20_unfiltered\nprereg_seq=2\nfamily=flow\ntitle=Plain%2020-bar%20momentum%2C%20no%20volume%20filter\nrationale=Unconditional%20control%20for%20%60trend_with_participation%60%20and%20for%20%60momentum.momentum_with_volume%60%3A%20the%20sign%20of%20the%2020-candle%20return%2C%20with%20no%20condition%20on%20volume%20whatsoever.%20It%20asserts%20no%20flow%20mechanism%20%E2%80%94it%20cannot%2C%20because%20it%20does%20not%20look%20at%20volume%E2%80%94%20and%20that%20is%20exactly%20its%20role.%20The%20two%20hypotheses%20it%20controls%20do%20not%20bet%20that%2020-candle%20momentum%20wins%2C%20but%20that%20it%20wins%20MORE%20when%20participation%20expands%3B%20that%20is%20a%20claim%20about%20a%20difference%2C%20and%20a%20difference%20needs%20both%20arms.%20It%20is%20registered%20in%20%60flow%60%20because%20its%20only%20reason%20to%20exist%20is%20to%20serve%20as%20the%20denominator%20for%20this%20family%27s%20volume%20filter.\nprior=We%20expect%20a%20small%20positive%20edge%2C%20and%20we%20expect%20it%20to%20be%20SMALLER%20than%20%60trend_with_participation%60%27s%20on%204h%20and%201d.%20All%20the%20information%20is%20in%20the%20comparison%3A%20if%20this%20control%20matches%20or%20beats%20the%20filtered%20versions%2C%20volume%20gives%20no%20permission%2C%20the%20two%20filtered%20hypotheses%20are%20refuted%20even%20if%20they%20make%20money%2C%20and%20this%20family%27s%20thesis%20%E2%80%94that%20volume%20measures%20conviction%E2%80%94%20loses%20its%20main%20support.%20On%20its%20own%2C%20a%20positive%20result%20from%20this%20control%20is%20NOT%20a%20finding%3A%20it%20is%20BTC%27s%20secular%20drift%20read%20through%20the%20sign%20of%20a%20past%20return%2C%20and%20it%20must%20be%20published%20as%20such.\nparams_json=%7B%22roc%22%3A%2220%22%2C%22volume_filter%22%3A%22none%22%7D\nparams_sha256=bcb98621bba3e0faea80c7259ffce97c6f632c0370cca3927ea13635a6ee058e\ncode_text=def%20_roc20_unfiltered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2040%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20roc%20%3D%20talib.ROC%28_f%28s.close%29%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28roc%29%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=29b5aa6530e147c7cd03da2dc2da99c1d518d43f9d8736fe75867359ea5c1830\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":39,"row_hash":"8d829303c654fce035a7b6a1d62a219c16651eafffa46e932d316d7c37916b2c","body":"wavelab-journal-chain\nv=3\nseq=39\nprev=23f474c29eeaf253bbe2db2a1525c4df583cf8cfcdffb0b826700a93f2181834\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.trend_with_participation\nprereg_seq=2\nfamily=flow\ntitle=Ride%20the%20trend%20only%20while%20volume%20expands\nrationale=It%20asserts%20that%20volume%20does%20not%20give%20direction%20but%20does%20give%20permission.%20A%20sustained%20trend%20needs%20a%20continuous%20flow%20of%20new%20participants%20buying%20higher%20than%20the%20previous%20one%20did%3B%20if%20the%2020-period%20average%20volume%20falls%20below%20the%20100-period%20one%2C%20those%20still%20trading%20are%20the%20ones%20already%20inside%2C%20rotating%20among%20themselves%2C%20and%20there%20is%20nobody%20left%20to%20absorb%20the%20first%20wave%20of%20profit%20taking.%20The%20signal%20is%20the%20sign%20of%20the%2020-candle%20return%20conditioned%20on%20participation%20expanding%2C%20and%20zero%20when%20it%20does%20not.\nprior=We%20expect%20a%20positive%20edge%2C%20but%20the%20real%20test%20is%20NOT%20that%20it%20be%20positive%3A%20it%20is%20that%20it%20be%20LARGER%20than%20plain%2020-candle%20momentum%20with%20no%20filter.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20that%20control%20was%20not%20registered%20in%20any%20family%20%E2%80%94the%20%60trend%60%20family%20does%20not%20register%20a%2020-bar%20ROC%E2%80%94%20so%20this%20falsification%20criterion%20could%20not%20be%20executed%3B%20it%20has%20been%20registered%20as%20%60flow.roc20_unfiltered%60%20and%20that%20is%20what%20this%20must%20be%20measured%20against.%20If%20the%20volume%20filter%20adds%20nothing%20over%20that%20control%2C%20this%20hypothesis%20is%20refuted%20even%20if%20it%20makes%20money%2C%20because%20what%20it%20would%20be%20earning%20is%20the%20momentum%20and%20not%20the%20flow.%20We%20further%20expect%20the%20filter%20to%20hurt%20at%20bear-market%20bottoms%2C%20where%20volume%20dries%20up%20for%20months%20and%20the%20filter%20leaves%20out%20precisely%20the%20start%20of%20the%20next%20bull%20cycle.\nparams_json=%7B%22roc%22%3A%2220%22%2C%22volume_long%22%3A%22100%22%2C%22volume_short%22%3A%2220%22%7D\nparams_sha256=99f66e39511f00fd1ba624d3deeee1c7954e533b2fdc1a3852559768af007deb\ncode_text=def%20_trend_with_participation%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20140%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%2020%29%0A%20%20%20%20v20%2C%20v100%20%3D%20talib.SMA%28v%2C%2020%29%2C%20talib.SMA%28v%2C%20100%29%0A%20%20%20%20ok%20%3D%20_finite%28roc%2C%20v20%2C%20v100%29%0A%20%20%20%20expanding%20%3D%20ok%20%26%20%28v20%20%3E%20v100%29%0A%20%20%20%20out%5Bexpanding%20%26%20%28roc%20%3E%200.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bexpanding%20%26%20%28roc%20%3C%200.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=6bb76c95c11f3f9fa9b0f52ead1c7a47fd902de6bb870f1fedc82b7bea4d1e0d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":40,"row_hash":"8844492eadbea62ca459bffdc0220e6ca2707794695a25b43e724b44d9842ac8","body":"wavelab-journal-chain\nv=3\nseq=40\nprev=8d829303c654fce035a7b6a1d62a219c16651eafffa46e932d316d7c37916b2c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.volume_climax\nprereg_seq=2\nfamily=flow\ntitle=Fade%20a%20three-sigma%20volume%20spike%20at%20extremes\nrationale=Volume%20more%20than%20three%20sigma%20from%20its%20100-period%20moving%20average%2C%20happening%20right%20at%20a%2020-candle%20extreme%2C%20is%20not%20participation%3A%20it%20is%20transfer.%20In%20crypto%20that%20spike%20is%20almost%20always%20a%20liquidation%20cascade%2C%20in%20which%20the%20exchange%27s%20engine%20sends%20market%20orders%20that%20represent%20nobody%20who%20wants%20to%20trade%20at%20that%20price.%20When%20the%20liquidation%20queue%20empties%2C%20all%20that%20involuntary%20supply%20disappears%20at%20once%2C%20and%20the%20price%20goes%20back%20to%20the%20level%20where%20the%20real%20book%20was.%20The%20mean%20and%20the%20sigma%20are%20rolling%20over%20100%20candles%2C%20never%20over%20the%20full%20history.\nprior=We%20expect%20a%20positive%20edge%20over%205%20candles%2C%20concentrated%20in%20a%20very%20small%20number%20of%20events%20%28perhaps%2030-80%20across%20the%20whole%20history%20per%20timeframe%29%2C%20which%20caps%20the%20statistical%20power%20from%20the%20outset%3A%20if%20it%20comes%20out%20positive%20but%20with%20n%20%3C%2030%20we%20will%20declare%20it%20inconclusive.%20We%20expect%20it%20to%20fail%20when%20the%20volume%20spike%20is%20the%20START%20of%20a%20regime%20expansion%20and%20not%20its%20end%20%E2%80%94a%20range%20break%20with%20news%20behind%20it%E2%80%94%20where%20fading%20means%20stepping%20in%20front%20of%20the%20entire%20move.%20We%20also%20expect%20it%20to%20get%20worse%20from%202021%20onwards%2C%20as%20the%20exchanges%20have%20gradually%20introduced%20partial-liquidation%20engines%20that%20smooth%20the%20cascades.\nparams_json=%7B%22extreme_window%22%3A%2220%22%2C%22hold_bars%22%3A%225%22%2C%22volume_z%22%3A%223.00000000%22%2C%22z_window%22%3A%22100%22%7D\nparams_sha256=bb8b0570834d8c81b3c603c2fab5a82a052b18664b10b75a6169468ad4b7a42a\ncode_text=def%20_volume_climax%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%20140%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20lv%20%3D%20np.log1p%28v%29%20%20%20%23%20log1p%20and%20not%20log%3A%20volume%20can%20be%20exactly%20zero%0A%20%20%20%20mean%20%3D%20talib.SMA%28lv%2C%20100%29%0A%20%20%20%20sigma%20%3D%20talib.STDDEV%28lv%2C%20100%29%0A%20%20%20%20z%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28lv%20-%20mean%2C%20sigma%2C%20out%3Dz%2C%20where%3D~np.isnan%28sigma%29%20%26%20%28sigma%20%3E%200.0%29%29%0A%20%20%20%20max_c%2C%20min_c%20%3D%20talib.MAX%28c%2C%2020%29%2C%20talib.MIN%28c%2C%2020%29%0A%20%20%20%20ok%20%3D%20_finite%28z%2C%20max_c%2C%20min_c%2C%20c%29%0A%20%20%20%20extreme%20%3D%20ok%20%26%20%28z%20%3E%203.0%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bextreme%20%26%20%28c%20%3E%3D%20max_c%29%5D%20%3D%20-1%0A%20%20%20%20ev%5Bextreme%20%26%20%28c%20%3C%3D%20min_c%29%5D%20%3D%201%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A\ncode_sha256=9d750043ce21b94944c8d599afe65732e03a841f21d5b4ea8ec6e015c717c89d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":41,"row_hash":"1cc7dd1426ab23c570ae53cd5bc5153c0e69745d20e2f91411d1d374a3e277ea","body":"wavelab-journal-chain\nv=3\nseq=41\nprev=8844492eadbea62ca459bffdc0220e6ca2707794695a25b43e724b44d9842ac8\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.volume_thrust\nprereg_seq=2\nfamily=flow\ntitle=Follow%20double%20volume%20on%20an%20expanding%20range\nrationale=A%20candle%20with%20twice%20the%20average%20volume%2C%20a%20range%20greater%20than%20the%20ATR%20and%20a%20close%20in%20the%20top%20quarter%20of%20that%20range%20only%20happens%20when%20somebody%20crosses%20the%20spread%20over%20and%20over%20and%20takes%20out%20several%20levels%20of%20the%20book.%20Whoever%20does%20that%20is%20paying%20for%20immediacy%2C%20which%20reveals%20that%20their%20information%20or%20their%20urgency%20is%20worth%20more%20than%20the%20cost%2C%20and%20on%20top%20of%20that%20it%20leaves%20the%20book%20emptied%20on%20that%20side%3A%20the%20next%20levels%20have%20to%20be%20replenished%20higher%20up.%20The%20stops%20of%20the%20shorts%20trapped%20along%20the%20way%20supply%20additional%20forced%20buying%20over%20the%20following%20candles.\nprior=We%20expect%20a%20positive%20edge%20over%205%20candles%20and%20expect%20it%20to%20be%20LARGER%20on%2015m%20than%20on%204h%2C%20because%20an%20emptied%20book%20is%20replenished%20in%20minutes%20or%20hours%2C%20not%20days.%20We%20expect%20it%20to%20fail%2C%20or%20to%20invert%2C%20when%20the%20thrust%20candle%20is%20the%20last%20of%20a%20long%20leg%20%28exhaustion%29%20and%20in%20the%20minutes%20after%20a%20macro%20release%2C%20where%20the%20expanded%20range%20is%20instantaneous%20repricing%20with%20no%20continuation.%20If%20the%20edge%20were%20the%20same%20on%204h%20and%20on%2015m%2C%20the%20book-replenishment%20mechanism%20we%20assert%20would%20be%20false.\nparams_json=%7B%22atr%22%3A%2214%22%2C%22clv%22%3A%220.50000000%22%2C%22hold_bars%22%3A%225%22%2C%22relative_volume%22%3A%222.00000000%22%2C%22volume_mean%22%3A%2220%22%7D\nparams_sha256=561b438e6bd430c40488d6842d3bf85bcaed5d204af926d830f180efc7aebe05\ncode_text=def%20_volume_thrust%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2060%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20h%2C%20l%2C%20c%2C%20v%20%3D%20_f%28s.high%29%2C%20_f%28s.low%29%2C%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20v_mean%20%3D%20talib.SMA%28v%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20clv%20%3D%20_clv%28s%29%0A%20%20%20%20rel%20%3D%20np.full%28n%2C%20np.nan%29%0A%20%20%20%20np.divide%28v%2C%20v_mean%2C%20out%3Drel%2C%20where%3D~np.isnan%28v_mean%29%20%26%20%28v_mean%20%3E%200.0%29%29%0A%20%20%20%20ok%20%3D%20_finite%28rel%2C%20atr%2C%20tr%29%20%26%20%28atr%20%3E%200.0%29%0A%20%20%20%20strong%20%3D%20ok%20%26%20%28rel%20%3E%202.0%29%20%26%20%28tr%20%3E%20atr%29%0A%20%20%20%20ev%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ev%5Bstrong%20%26%20%28clv%20%3E%200.5%29%5D%20%3D%201%0A%20%20%20%20ev%5Bstrong%20%26%20%28clv%20%3C%20-0.5%29%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28ev%2C%205%29%0A\ncode_sha256=9bbd14dce3003a1efab351ddcb93837cda70cdcc7e48d3ff2fcc8704c9eee8b3\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":42,"row_hash":"b79d9e0d9febab4edeb490526e70287c33d057c1002478ec1be3f88612e59244","body":"wavelab-journal-chain\nv=3\nseq=42\nprev=1cc7dd1426ab23c570ae53cd5bc5153c0e69745d20e2f91411d1d374a3e277ea\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=flow.vwap_session_side\nprereg_seq=2\nfamily=flow\ntitle=Long%20above%20the%20session%20VWAP%2C%20short%20below\nrationale=The%20session%20VWAP%20is%20not%20just%20one%20more%20indicator%3A%20it%20is%20the%20price%20against%20which%20institutional%20execution%20is%20measured%20and%20settled%2C%20so%20there%20are%20real%20orders%20conditioned%20on%20it.%20An%20execution%20algorithm%20with%20a%20buy%20order%20slows%20down%20if%20the%20price%20is%20above%20the%20VWAP%20and%20speeds%20up%20if%20it%20is%20below%2C%20and%20the%20desks%20judge%20the%20trader%20by%20that%20difference.%20The%20mechanical%20consequence%20is%20that%20the%20side%20of%20the%20VWAP%20separates%20two%20different%20regimes%20of%20supply%20and%20demand%20within%20the%20same%20day%2C%20not%20merely%20two%20price%20ranges.\nprior=We%20expect%20a%20small%20positive%20edge%20on%2015m%20and%201h%2C%20degrading%20as%20the%20timeframe%20rises%2C%20because%20the%20daily%20anchor%20stops%20meaning%20anything%20once%20each%20candle%20is%20a%20third%20of%20the%20session.%20We%20expect%20it%20to%20fail%20on%20days%20with%20no%20direction%2C%20where%20the%20price%20crosses%20the%20VWAP%20ten%20times%20and%20only%20generates%20cost.%20BTC-specific%20falsification%3A%20crypto%20trades%2024%2F7%20and%20has%20no%20real%20institutional%20session%2C%20so%20if%20the%20mechanism%20is%20true%20the%20edge%20ought%20to%20be%20SMALLER%20than%20the%20one%20this%20same%20indicator%20shows%20in%20equities%3B%20if%20it%20came%20out%20enormous%2C%20we%20would%20suspect%20we%20are%20only%20measuring%20intraday%20momentum.\nparams_json=%7B%22anchor%22%3A%22utc_day%22%7D\nparams_sha256=f0690286be1b29b3132c57d1bcb9507e871b1102f396abe61256b4346bb6be01\ncode_text=def%20_vwap_side%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20if%20n%20%3C%2010%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20vwap%2C%20_sd%2C%20_k%20%3D%20_session_vwap%28s%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ok%20%3D%20_finite%28vwap%2C%20c%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20vwap%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20vwap%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=ebdd02ca1d6bf413f2def0c0049406ec423260776d521eab049ae95b0a9a0fc8\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fflow.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":43,"row_hash":"c6f8dd0bc25f64f8b5c7c03c831b00c2028013db2eb74698716283351fd7fd64","body":"wavelab-journal-chain\nv=3\nseq=43\nprev=b79d9e0d9febab4edeb490526e70287c33d057c1002478ec1be3f88612e59244\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.bb20_2_fade\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20every%20close%20outside%20the%20Bollinger%20band\nrationale=Closing%20outside%20the%202-sigma%20band%20over%2020%20candles%20means%20the%20price%20has%20moved%20further%20than%20the%20asset%27s%20own%20recent%20dispersion%20considers%20normal.%20The%20behaviour%20that%20would%20produce%20the%20effect%20is%20that%20of%20the%20market%20maker%20and%20the%20range%20trader%3A%20they%20see%20a%20temporary%20imbalance%20of%20flow%20%E2%80%94an%20impatient%20order%20sweeping%20the%20book%E2%80%94%20and%20charge%20a%20premium%20for%20absorbing%20it%2C%20handing%20the%20price%20back%20towards%20the%20SMA20%20once%20that%20order%20runs%20out.%20It%20is%20the%20barest%20possible%20formulation%20of%20the%20family%20and%20it%20serves%20as%20the%20baseline%20against%20which%20the%20other%20eleven%20are%20measured.\nprior=We%20expect%20a%20positive%20but%20small%20edge%20in%20a%20ranging%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20trending%20regime%2C%20because%20in%20a%20trend%20the%20price%20%27walks%20the%20band%27%20for%20dozens%20of%20candles%20and%20this%20rule%20holds%20the%20wrong%20side%20that%20entire%20time.%20Net%20over%20the%20whole%20sample%20we%20expect%20something%20close%20to%20zero%2C%20or%20negative%20after%20costs.%20It%20is%20refuted%20if%20the%20edge%20is%20positive%20and%20stable%20in%20both%20regimes%3A%20that%20would%20mean%20we%20are%20not%20measuring%20liquidity%20provision%20but%20something%20else.\nparams_json=%7B%22deviations%22%3A%222.00000000%22%2C%22period%22%3A%2220%22%7D\nparams_sha256=3f63aab8f5e83fd62297b3d44414f41f31ed285a92481a3dee2f5aa277dbaf21\ncode_text=def%20_bb_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20upper%2C%20_mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%20%20%20%20ok%20%3D%20_finite%28upper%2C%20lower%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=7df021fb26fb1157a3e4ca5d77813ae92a5927c30ca6a05fff4b3edd6c1dc934\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":44,"row_hash":"90cdd779f904b5573d138f489e5a0c2240f2022df37d8105cb39ad06b8d6c4d9","body":"wavelab-journal-chain\nv=3\nseq=44\nprev=c6f8dd0bc25f64f8b5c7c03c831b00c2028013db2eb74698716283351fd7fd64\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.bb20_2_range_adx14\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20the%20Bollinger%20band%2C%20ADX%20under%2020\nrationale=Hypothesis%201%20with%20a%20single%20gate%3A%20trade%20only%20when%20the%20ADX14%20is%20below%2020%2C%20Wilder%27s%20threshold%20for%20%27no%20trend%27.%20The%20claim%20being%20tested%20is%20structural%2C%20not%20cosmetic%3A%20the%20reversion%20premium%20exists%20because%20somebody%20absorbs%20impatient%20flow%2C%20and%20absorbing%20is%20only%20profitable%20when%20that%20flow%20is%20NOT%20informed.%20When%20there%20is%20a%20trend%2C%20the%20order%20sweeping%20the%20book%20usually%20carries%20information%20%E2%80%94somebody%20is%20genuinely%20repositioning%E2%80%94%20and%20whoever%20absorbs%20it%20is%20adversely%20selected.%20A%20low%20ADX%20is%20the%20classic%20approximation%20to%20%27nobody%20here%20is%20repositioning%27.\nprior=We%20expect%20a%20CLEARLY%20larger%20edge%20than%20hypothesis%201%20over%20the%20same%20candles%2C%20and%20we%20expect%20the%20difference%20to%20come%20from%20removing%20losses%2C%20not%20from%20adding%20gains.%20We%20also%20expect%20fewer%20than%20half%20the%20trades.%20The%20hypothesis%20is%20refuted%20if%20the%20edge%20does%20not%20improve%20on%20%231%27s%3A%20that%20would%20mean%20the%20ADX%20finds%20out%20about%20the%20regime%20too%20late%20to%20work%20as%20a%20filter%2C%20and%20then%20the%20family%27s%20explanation%20by%20adverse%20selection%20is%20left%20without%20empirical%20support.\nparams_json=%7B%22adx_max%22%3A%2220.00000000%22%2C%22adx_period%22%3A%2214%22%2C%22deviations%22%3A%222.00000000%22%2C%22period%22%3A%2220%22%7D\nparams_sha256=7393ee8889d58e88b21b5a7132be416ace7d0a88318689e9b43a5d24e511344a\ncode_text=def%20_bb_range_adx%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20upper%2C%20_mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%20%20%20%20adx%20%3D%20talib.ADX%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28upper%2C%20lower%2C%20adx%29%0A%20%20%20%20quiet%20%3D%20ok%20%26%20%28adx%20%3C%2020.0%29%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=35848649016da9c53ec621db8bb2743532a4a30a2ae9c3c86f72692813ef422e\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":45,"row_hash":"cfe806a6ba80e9113f41ee0022c32fad8b0ceb6e3405c6ee30ad5e60983e2157","body":"wavelab-journal-chain\nv=3\nseq=45\nprev=90cdd779f904b5573d138f489e5a0c2240f2022df37d8105cb39ad06b8d6c4d9\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.bb20_2_reentry\nprereg_seq=2\nfamily=mean_reversion\ntitle=Wait%20for%20the%20return%20inside%20the%20band\nrationale=The%20same%20band%20as%20hypothesis%201%20and%20the%20same%2020%2F2%2C%20but%20the%20decision%20rule%20is%20the%20opposite%20one%20in%20time%3A%20you%20do%20not%20buy%20the%20fall%2C%20you%20buy%20the%20end%20of%20the%20fall.%20Requiring%20the%20previous%20candle%20to%20have%20closed%20outside%20and%20this%20one%20inside%20is%20asking%20for%20proof%20that%20the%20impatient%20flow%20has%20already%20run%20out%2C%20instead%20of%20assuming%20it.%20The%20concrete%20participant%20is%20the%20forced%20seller%3A%20while%20they%20are%20liquidating%2C%20the%20price%20stays%20outside%20the%20band%3B%20when%20they%20finish%2C%20the%20first%20candle%20that%20closes%20back%20inside%20marks%20that%20the%20imbalance%20has%20been%20consumed.%20It%20is%20registered%20alongside%20%231%20because%20the%20comparison%20between%20the%20two%20is%20what%20isolates%20the%20cost%20of%20anticipating%20against%20the%20cost%20of%20waiting.\nprior=We%20expect%20FEWER%20trades%20and%20a%20BETTER%20edge%20per%20trade%20than%20hypothesis%201%2C%20and%20above%20all%20a%20much%20shorter%20left%20tail%2C%20because%20we%20do%20not%20enter%20against%20a%20liquidation%20in%20progress.%20We%20expect%20it%20to%20lose%20in%20markets%20with%20very%20fast%20V-shaped%20reversals%2C%20where%20the%20re-entry%20candle%20arrives%20once%20the%20move%20back%20has%20already%20happened.%20It%20is%20refuted%20if%20its%20edge%20per%20trade%20does%20not%20beat%20hypothesis%201%27s%3A%20in%20that%20case%20the%20%27proof%20of%20exhaustion%27%20carries%20no%20information%20and%20merely%20arrives%20late.\nparams_json=%7B%22deviations%22%3A%222.00000000%22%2C%22exit%22%3A%22SMA20%22%2C%22period%22%3A%2220%22%7D\nparams_sha256=4b025f78e9d6dd181ac87010dd12a50d2a3715455ad3ff589701dd83c4b2f779\ncode_text=def%20_bb_reentry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20n%20%3D%20c.size%0A%20%20%20%20out%20%3D%20_sig%28n%29%0A%20%20%20%20upper%2C%20mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%281%2C%20n%29%3A%0A%20%20%20%20%20%20%20%20%23%20Only%20indices%20i%20and%20i-1%20are%20read.%20Never%20i%2B1.%0A%20%20%20%20%20%20%20%20if%20np.isnan%28upper%5Bi%5D%29%20or%20np.isnan%28lower%5Bi%5D%29%20or%20np.isnan%28mid%5Bi%5D%29%20%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20or%20np.isnan%28upper%5Bi%20-%201%5D%29%20or%20np.isnan%28lower%5Bi%20-%201%5D%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20%23%20Exit%20first%3A%20the%20target%20is%20the%20moving%20average%2C%20which%20is%20the%20hypothesis%27s%20anchor.%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%201%20and%20c%5Bi%5D%20%3E%3D%20mid%5Bi%5D%20or%20pos%20%3D%3D%20-1%20and%20c%5Bi%5D%20%3C%3D%20mid%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20%23%20Entry%20only%20if%20we%20are%20flat%20and%20the%20previous%20candle%20closed%20OUTSIDE%20and%20this%20one%20closes%20IN.%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%20-%201%5D%20%3C%20lower%5Bi%20-%201%5D%20and%20c%5Bi%5D%20%3E%3D%20lower%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20c%5Bi%20-%201%5D%20%3E%20upper%5Bi%20-%201%5D%20and%20c%5Bi%5D%20%3C%3D%20upper%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A\ncode_sha256=1c08a1df738a0be23063d3afd1b48e3b8cd243d3015dc52390c3d1acbd4e6e20\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":46,"row_hash":"bf8885199a6ebe247dbb9640958e1ee74a6d041d2fb8b0051f9187c2316cbe4d","body":"wavelab-journal-chain\nv=3\nseq=46\nprev=cfe806a6ba80e9113f41ee0022c32fad8b0ceb6e3405c6ee30ad5e60983e2157\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.bb20_2_volume_climax\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20the%20Bollinger%20band%20on%20double%20volume\nrationale=The%20same%20Bollinger%20extreme%20as%20hypothesis%201%2C%20with%20one%20added%20condition%3A%20the%20candle%27s%20volume%20must%20double%20its%2020-period%20average%2C%20the%20conventional%20threshold%20for%20climactic%20volume.%20Volume%20is%20what%20separates%20the%20two%20reasons%20the%20price%20can%20leave%20the%20band.%20If%20it%20leaves%20on%20low%20volume%2C%20the%20book%20is%20thin%20and%20there%20is%20no%20premium%20to%20charge%3A%20nobody%20is%20paying%20to%20get%20out.%20If%20it%20leaves%20on%20volume%20that%20doubles%20the%20average%2C%20somebody%20is%20closing%20under%20duress%20%E2%80%94cascading%20perpetual%20liquidations%2C%20margin%20calls%E2%80%94%20and%20that%20seller%20has%20neither%20an%20opinion%20about%20value%20nor%20the%20ability%20to%20wait.%20It%20is%20the%20only%20case%20in%20which%20the%20hypothesis%20asserts%20that%20a%20structurally%20willing%20counterparty%20exists.\nprior=We%20expect%20a%20LARGER%20edge%20per%20trade%20than%20hypothesis%201%20and%20far%20fewer%20trades.%20We%20expect%20the%20effect%20to%20be%20markedly%20asymmetric%3A%20much%20stronger%20on%20the%20long%20side%20%28buying%20capitulation%29%20than%20on%20the%20short%20one%2C%20because%20bearish%20liquidations%20in%20BTC%20are%20more%20violent%20and%20more%20concentrated%20in%20time%20than%20bullish%20ones.%20We%20expect%20it%20to%20fail%20on%20the%20first%20day%20of%20a%20genuine%20macro%20shock%2C%20where%20high%20volume%20does%20carry%20information.%20It%20is%20refuted%20if%20the%20volume%20filter%20does%20not%20improve%20hypothesis%201%27s%20edge%3A%20that%20would%20say%20that%20volume%20does%20not%20distinguish%20forced%20flow%20from%20informed%20flow%20in%20this%20market.\nparams_json=%7B%22deviations%22%3A%222.00000000%22%2C%22period%22%3A%2220%22%2C%22vol_multiple%22%3A%222.00000000%22%2C%22vol_period%22%3A%2220%22%7D\nparams_sha256=9ebec0ba5e583927f6e850c3605335a568ebbf4a3b8cc2f87abeff6294eedcba\ncode_text=def%20_bb_volume_climax%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20upper%2C%20_mid%2C%20lower%20%3D%20talib.BBANDS%28c%2C%20timeperiod%3D20%2C%20nbdevup%3D2.0%2C%20nbdevdn%3D2.0%2C%20matype%3D0%29%0A%20%20%20%20v_mean%20%3D%20talib.SMA%28v%2C%20timeperiod%3D20%29%0A%20%20%20%20ok%20%3D%20_finite%28upper%2C%20lower%2C%20v_mean%29%0A%20%20%20%20climax%20%3D%20ok%20%26%20%28v%20%3E%202.0%20%2A%20v_mean%29%0A%20%20%20%20out%5Bclimax%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bclimax%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=25b2acb22b67500f5c94d243d472c2c673845fb6cfd722ccbf4d403797df15fd\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":47,"row_hash":"0b8ecd02fac70e57ab238a5b0e2e28239040d36c146e10fe5864bbfdfb987780","body":"wavelab-journal-chain\nv=3\nseq=47\nprev=bf8885199a6ebe247dbb9640958e1ee74a6d041d2fb8b0051f9187c2316cbe4d\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.cci20_fade\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20the%20CCI%20extreme%2C%20robust%20to%20spikes\nrationale=The%20CCI%20uses%20the%20typical%20price%20%28H%2BL%2BC%29%2F3%20and%20normalises%20it%20by%20the%20mean%20ABSOLUTE%20deviation%2C%20not%20by%20the%20standard%20deviation.%20The%20difference%20is%20not%20cosmetic%20in%20BTC%3A%20the%20standard%20deviation%20squares%2C%20so%20a%20single%20liquidation%20candle%20inflates%20the%20denominator%20for%2020%20candles%20and%20anaesthetises%20the%20Bollinger%20signal%20right%20after%20the%20event.%20The%20mean%20absolute%20deviation%20barely%20flinches.%20The%20hypothesis%2C%20therefore%2C%20is%20that%20the%20robust%20statistic%20goes%20on%20detecting%20dislocations%20in%20the%20period%20after%20a%20shock%2C%20which%20is%20when%20the%20premium%20for%20providing%20liquidity%20ought%20to%20be%20highest%20because%20the%20usual%20providers%27%20capital%20is%20exhausted.\nprior=We%20expect%20the%20CCI%27s%20edge%20to%20beat%20Bollinger%27s%20%28hypothesis%201%29%20precisely%20and%20only%20in%20the%20windows%20that%20follow%20the%20largest-range%20candles%2C%20and%20to%20be%20similar%20or%20slightly%20worse%20over%20the%20rest%20of%20the%20sample%2C%20by%20giving%20more%20signals%20of%20poorer%20quality.%20We%20expect%20the%20classic%20%2B-100%20failure%20in%20a%20trend%2C%20just%20like%20the%20rest%20of%20the%20family.%20It%20is%20refuted%20if%20its%20edge%20conditioned%20on%20%27after%20a%20shock%27%20is%20not%20larger%20than%20Bollinger%27s%20in%20those%20same%20windows%3A%20that%20was%20the%20whole%20argument.\nparams_json=%7B%22period%22%3A%2220%22%2C%22threshold%22%3A%22100.00000000%22%7D\nparams_sha256=d96a389f12885b5e8a8b2eb6149e9919cea88403acfe9fd6330f21094bea98fe\ncode_text=def%20_cci_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20cci%20%3D%20talib.CCI%28h%2C%20low%2C%20c%2C%20timeperiod%3D20%29%0A%20%20%20%20ok%20%3D%20_finite%28cci%29%0A%20%20%20%20out%5Bok%20%26%20%28cci%20%3C%20-100.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28cci%20%3E%20100.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=d28b97fa516665039f0ff4ca6e4ad5351fa89e9cea36e90896d2075441095b34\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":48,"row_hash":"f5eca7e7598c3f462b585ad27811991987cb02cdbb01b93e8d864dff10a3b0df","body":"wavelab-journal-chain\nv=3\nseq=48\nprev=0b8ecd02fac70e57ab238a5b0e2e28239040d36c146e10fe5864bbfdfb987780\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.keltner20_atr14_fade\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20the%20Keltner%20channel%2C%20width%20in%20ATR\nrationale=The%20Keltner%20channel%20in%20its%20modern%20form%3A%20EMA20%20as%20the%20anchor%20and%202xATR14%20as%20the%20width.%20Against%20Bollinger%2C%20what%20changes%20is%20WHAT%20counts%20as%20a%20normal%20move.%20Bollinger%20measures%20the%20dispersion%20of%20the%20closes%3B%20the%20ATR%20measures%20the%20true%20range%2C%20wicks%20and%20gaps%20included.%20The%20difference%20matters%20for%20a%20concrete%20microstructure%20reason%3A%20a%20liquidation%20cascade%20leaves%20an%20enormous%20wick%20and%20a%20recovered%20close%2C%20which%20WIDENS%20the%20ATR%20immediately%20but%20barely%20moves%20the%20sigma%20of%20the%20closes.%20The%20Keltner%20channel%20therefore%20stops%20giving%20signals%20right%20after%20a%20liquidation%20event%2C%20while%20Bollinger%20goes%20on%20giving%20them.\nprior=We%20expect%20FEWER%20signals%20than%20Bollinger%20in%20the%20weeks%20following%20a%20crash%2C%20and%20for%20that%20reason%20a%20worse%20hit%20rate%20but%20a%20shorter%20left%20tail%3A%20it%20gives%20up%20the%20most%20profitable%20bounces%20in%20exchange%20for%20not%20entering%20at%20the%20worst%20moment.%20We%20expect%20it%20to%20be%20inferior%20to%20Bollinger%20in%20a%20quiet%20market%2C%20where%20the%20ATR%20narrows%20and%20the%20channel%20turns%20hypersensitive.%20It%20is%20refuted%20if%20its%20signals%20are%20indistinguishable%20from%20hypothesis%201%27s%3A%20that%20would%20indicate%20that%20in%20BTC%20the%20wick%20and%20the%20close%20carry%20the%20same%20information.\nparams_json=%7B%22atr_period%22%3A%2214%22%2C%22ema_period%22%3A%2220%22%2C%22multiplier%22%3A%222.00000000%22%7D\nparams_sha256=45429526dee2ebc910634f1e5de7e7b66a870b3ae972bf7c24681506d3c7b1dc\ncode_text=def%20_keltner_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%20timeperiod%3D20%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28ema%2C%20atr%29%0A%20%20%20%20upper%20%3D%20ema%20%2B%202.0%20%2A%20atr%0A%20%20%20%20lower%20%3D%20ema%20-%202.0%20%2A%20atr%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20lower%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20upper%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=a86dc171e07404ad57920ae1fb21a40affd1040f16713ccd1c3e4f1b42e9443c\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":49,"row_hash":"46b1d98f73567eaff85e7efbe42983cb4bf7d41f0ff271a47d2a7bddfb752508","body":"wavelab-journal-chain\nv=3\nseq=49\nprev=f5eca7e7598c3f462b585ad27811991987cb02cdbb01b93e8d864dff10a3b0df\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.rsi14_cardwell_sma200\nprereg_seq=2\nfamily=mean_reversion\ntitle=RSI%2040%2F80%20above%20SMA%20200%2C%2020%2F60%20below\nrationale=Andrew%20Cardwell%20observed%20that%20the%20RSI%20does%20not%20oscillate%20in%20the%20same%20range%20under%20every%20regime%3A%20in%20an%20uptrend%20it%20moves%20between%2040%20and%2080%2C%20and%20in%20a%20downtrend%20between%2020%20and%2060.%20The%20mechanism%20behind%20it%20is%20one%20of%20participant%20composition.%20In%20a%20bull%20market%20the%20falls%20are%20caused%20by%20profit%20taking%20from%20short-term%20traders%20and%20they%20run%20into%20structural%20buyers%20waiting%3B%20the%20selling%20pressure%20runs%20out%20sooner%2C%20and%20that%20is%20why%20the%20oscillator%27s%20floor%20is%20at%2040%20and%20not%20at%2030.%20Buying%20at%2030%20in%20that%20regime%20means%20waiting%20for%20a%20capitulation%20that%20almost%20never%20arrives%2C%20and%20staying%20out.%20The%20SMA200%20on%20the%20close%20decides%20which%20regime%20applies%20using%20the%20information%20available%20at%20the%20bar%2C%20without%20looking%20ahead.\nprior=We%20expect%20a%20positive%20edge%20and%2C%20above%20all%2C%20MORE%20TRADES%20on%20the%20side%20that%20favours%20the%20regime%20%28longs%20in%20an%20uptrend%2C%20shorts%20in%20a%20downtrend%29%20than%20hypothesis%205%2C%20and%20a%20large%20reduction%20in%20the%20losses%20on%20the%20opposite%20side.%20We%20expect%20it%20to%20fail%20at%20regime%20changes%2C%20when%20the%20price%20crosses%20the%20SMA200%20several%20times%20in%20a%20row%3A%20there%20the%20bands%20alternate%20and%20we%20buy%20at%2040%20just%20when%20the%20relevant%20regime%20had%20already%20turned%20bearish.%20It%20is%20refuted%20if%20it%20does%20not%20improve%20on%20hypothesis%205%2C%20or%20if%20all%20of%20its%20edge%20comes%20from%20the%20SMA200%27s%20directional%20filter%20and%20not%20from%20the%20asymmetric%20thresholds.\nparams_json=%7B%22bearish_band%22%3A%5B%2220.00000000%22%2C%2260.00000000%22%5D%2C%22bullish_band%22%3A%5B%2240.00000000%22%2C%2280.00000000%22%5D%2C%22period%22%3A%2214%22%2C%22regime_sma%22%3A%22200%22%7D\nparams_sha256=52b556b152b6f9d7c3976209b9d7585a5c6324a953ecf6aff36dd112dbb869fc\ncode_text=def%20_rsi_cardwell%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%20timeperiod%3D14%29%0A%20%20%20%20sma200%20%3D%20talib.SMA%28c%2C%20timeperiod%3D200%29%0A%20%20%20%20ok%20%3D%20_finite%28rsi%2C%20sma200%29%0A%0A%20%20%20%20bullish%20%3D%20ok%20%26%20%28c%20%3E%20sma200%29%20%20%20%23%20Cardwell%20range%2040-80%0A%20%20%20%20bearish%20%3D%20ok%20%26%20%28c%20%3C%3D%20sma200%29%20%20%23%20Cardwell%20range%2020-60%0A%0A%20%20%20%20out%5Bbullish%20%26%20%28rsi%20%3C%2040.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bbullish%20%26%20%28rsi%20%3E%2080.0%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bbearish%20%26%20%28rsi%20%3C%2020.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bbearish%20%26%20%28rsi%20%3E%2060.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=64e9e9b190061e333ca181e16e72083037b4210fc1a76b75974e37ed7f345ef9\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=260\neffective_from_ms=1790242821226\n"} {"seq":50,"row_hash":"6ce4b6b8a2e609af5a62ab3d9986aea1119deb62e7024228b4c6e3d872a34a63","body":"wavelab-journal-chain\nv=3\nseq=50\nprev=46b1d98f73567eaff85e7efbe42983cb4bf7d41f0ff271a47d2a7bddfb752508\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.rsi14_fixed_3070\nprereg_seq=2\nfamily=mean_reversion\ntitle=Buy%20RSI%20below%2030%2C%20sell%20above%2070\nrationale=RSI%2014%20with%20Wilder%27s%20original%20thresholds%2C%2030%20and%2070.%20It%20is%20registered%20even%20though%20hardly%20anybody%20expects%20it%20to%20work%2C%20and%20for%20a%20methodological%20reason%3A%20it%20is%20the%20control%20for%20hypothesis%206.%20Cardwell%27s%20claim%20%E2%80%94that%20the%20RSI%20%27pins%27%20at%20the%20extreme%20during%20trends%20and%20that%20this%20is%20why%20fixed%20thresholds%20fail%E2%80%94%20is%20only%20testable%20if%20the%20fixed%20control%20is%20registered%20in%20advance.%20If%20we%20only%20registered%20the%20adaptive%20version%20and%20it%20came%20out%20well%2C%20we%20would%20not%20know%20whether%20the%20credit%20belongs%20to%20Cardwell%27s%20bands%20or%20simply%20to%20the%20RSI.\nprior=We%20expect%20a%20NULL%20or%20NEGATIVE%20net%20edge%2C%20and%20in%20particular%20we%20expect%20the%20short%20side%20%28RSI%3E70%29%20to%20be%20the%20one%20that%20loses%20most%2C%20because%20BTC%20spends%20most%20of%20its%20history%20in%20bullish%20legs%20where%20the%20RSI%20goes%20above%2070%20and%20stays%20there.%20We%20expect%20most%20of%20the%20loss%20to%20be%20concentrated%20in%20a%20few%20long%2C%20directional%20legs.%20It%20is%20refuted%20if%20the%20fixed%2030%2F70%20matches%20or%20beats%20hypothesis%206%27s%20Cardwell%20bands%3A%20that%20would%20invalidate%20this%20family%27s%20central%20premise%20about%20the%20RSI%27s%20bias%20in%20a%20trend.\nparams_json=%7B%22overbought%22%3A%2270.00000000%22%2C%22oversold%22%3A%2230.00000000%22%2C%22period%22%3A%2214%22%7D\nparams_sha256=ef495305f3db31fd3642b27c92feff49c4bab6f17b6bdee6054777f521f7f65b\ncode_text=def%20_rsi_fixed%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20rsi%20%3D%20talib.RSI%28c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28rsi%29%0A%20%20%20%20out%5Bok%20%26%20%28rsi%20%3C%2030.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28rsi%20%3E%2070.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=9b178ad159f7f8d1f0c0e5f2ec18283d5fb4ea7cccd793739fb6cba6a0941e7b\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":51,"row_hash":"66bcf73b9134e9ff1a40cfd1dd54ac905b27b9644ba38316e4352f563f72de5c","body":"wavelab-journal-chain\nv=3\nseq=51\nprev=6ce4b6b8a2e609af5a62ab3d9986aea1119deb62e7024228b4c6e3d872a34a63\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.streak3_fade\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20three%20consecutive%20closes%2C%20no%20indicator\nrationale=Three%20consecutive%20closes%20to%20the%20downside%20are%20bought%3B%20three%20to%20the%20upside%20are%20sold.%20There%20is%20no%20indicator%2C%20no%20normalisation%20by%20volatility%20and%20no%20threshold%20to%20tune%2C%20and%20that%20bareness%20is%20the%20point%3A%20it%20is%20the%20cleanest%20test%20of%20overreaction%20by%20extrapolation.%20The%20concrete%20behaviour%20is%20that%20of%20the%20trader%20who%20mistakes%20a%20short%20streak%20for%20a%20trend%20and%20positions%20in%20its%20direction%2C%20together%20with%20the%20risk%20manager%20who%20mechanically%20cuts%20exposure%20after%20several%20closes%20against%20them.%20If%20mean%20reversion%20in%20BTC%20really%20exists%20as%20a%20behavioural%20phenomenon%2C%20it%20has%20to%20show%20up%20here%3B%20if%20it%20only%20shows%20up%20in%20more%20elaborate%20formulations%2C%20we%20should%20suspect%20that%20what%20we%20are%20measuring%20is%20an%20artefact%20of%20those%20formulations.\nprior=We%20expect%20a%20VERY%20small%20edge%2C%20barely%20distinguishable%20from%20noise%2C%20and%20probably%20negative%20after%20costs%20given%20the%20high%20frequency%20of%20signals%3B%20what%20we%20expect%20to%20be%20informative%20is%20the%20SIGN%20and%20its%20consistency%20across%20timeframes%2C%20not%20the%20magnitude.%20We%20expect%20it%20to%20be%20negative%20in%20strongly%20trending%20legs%2C%20where%20streaks%20of%20three%20chain%20together.%20It%20is%20refuted%2C%20and%20with%20it%20the%20overreaction%20premise%20of%20the%20whole%20family%2C%20if%20the%20sign%20is%20systematically%20negative%20on%20every%20timeframe%3A%20that%20would%20indicate%20that%20in%20BTC%20short%20streaks%20continue%20instead%20of%20reverting%2C%20and%20then%20whichever%20of%20the%20eleven%20preceding%20hypotheses%20work%20would%20be%20capturing%20something%20else.\nparams_json=%7B%22consecutive_bars%22%3A%223%22%7D\nparams_sha256=e2ad36db29b1787dfcad84a41d9f3e043f623be63bf4c76fdd6a1433842dd9c7\ncode_text=def%20_streak3%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20c1%2C%20c2%2C%20c3%20%3D%20_prev%28c%29%2C%20_prev%28_prev%28c%29%29%2C%20_prev%28_prev%28_prev%28c%29%29%29%0A%20%20%20%20ok%20%3D%20_finite%28c1%2C%20c2%2C%20c3%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20c1%29%20%26%20%28c1%20%3C%20c2%29%20%26%20%28c2%20%3C%20c3%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20c1%29%20%26%20%28c1%20%3E%20c2%29%20%26%20%28c2%20%3E%20c3%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=188129ddf624fd54b3bc9170203647138487dac2c2f64569300322f5895a52c4\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":52,"row_hash":"6ab1e3b484593ef780c392b71735e8456c7becf131d5678df79cfc5e2690337c","body":"wavelab-journal-chain\nv=3\nseq=52\nprev=66bcf73b9134e9ff1a40cfd1dd54ac905b27b9644ba38316e4352f563f72de5c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.stretch_ema200_atr14\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20a%203-ATR%20stretch%20from%20the%20EMA%20200\nrationale=The%20eight%20previous%20hypotheses%20measure%20dislocations%20against%20an%20anchor%20of%2014-20%20candles%2C%20the%20range%20trader%27s%20horizon.%20This%20one%20changes%20scale%3A%20it%20measures%20the%20distance%20to%20the%20EMA200%20in%20units%20of%20ATR14%2C%20with%20the%20multiplier%203%20from%20the%20convention%20for%20ATR-based%20exits.%20The%20participant%20is%20a%20different%20one.%20The%20200-period%20average%20is%20the%20reference%20that%20capital%20allocators%20and%20structural%20holders%20use%20to%20decide%20whether%20the%20asset%20is%20%27expensive%27%20or%20%27cheap%27%3B%20when%20the%20price%20moves%20three%20daily%20ranges%20away%20from%20it%2C%20the%20demand%20that%20shows%20up%20is%20not%20from%20market%20makers%20but%20from%20rebalancing%2C%20and%20it%20operates%20on%20a%20timescale%20of%20weeks.\nprior=We%20expect%20VERY%20FEW%20signals%2C%20a%20positive%20edge%20per%20trade%20but%20with%20an%20enormous%20variance%20and%20a%20long%20recovery%20horizon%2C%20of%20dozens%20of%20candles.%20We%20expect%20the%20short%20side%20%283%20ATR%20above%20the%20EMA200%29%20to%20work%20worse%20than%20the%20long%20one%2C%20because%20in%20BTC%27s%20bubbles%20the%20price%20has%20stayed%20stretched%20above%20it%20for%20months.%20It%20is%20refuted%20if%20the%20number%20of%20signals%20is%20high%20%E2%80%94that%20would%20mean%203%20ATR%20is%20not%20an%20extreme%20in%20this%20asset%20and%20the%20%27structural%20dislocation%27%20premise%20is%20false%E2%80%94%20or%20if%20the%20edge%20runs%20out%20within%20a%20few%20candles%2C%20which%20would%20make%20it%20indistinguishable%20from%20short-term%20reversion.\nparams_json=%7B%22atr_period%22%3A%2214%22%2C%22ema_period%22%3A%22200%22%2C%22multiplier%22%3A%223.00000000%22%7D\nparams_sha256=5de546be1af0a52710c699f78c62c56661b7bc14f837436b12a7cf966432b3c6\ncode_text=def%20_stretch_ema200%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20ema200%20%3D%20talib.EMA%28c%2C%20timeperiod%3D200%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28ema200%2C%20atr%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20ema200%20-%203.0%20%2A%20atr%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20ema200%20%2B%203.0%20%2A%20atr%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=097d3fd3ee007c5fa8490568521cf9abe027efbd8f792e43ee11766ffefdf217\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=420\neffective_from_ms=1790242821226\n"} {"seq":53,"row_hash":"4959e7fc2fc577a7baf2be3a1daec55613fd972234b8e5bea7f347b414db6fe6","body":"wavelab-journal-chain\nv=3\nseq=53\nprev=6ab1e3b484593ef780c392b71735e8456c7becf131d5678df79cfc5e2690337c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.sweep_rejection_20\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20the%20sweep%20with%20a%20rejection%20wick\nrationale=The%20candle%20pierces%20the%20low%20of%20the%20previous%2020%20but%20closes%20in%20the%20upper%20third%20of%20its%20own%20range.%20That%20shape%20is%20the%20observable%20footprint%20of%20a%20specific%20sequence%3A%20beneath%20a%20visible%20low%2C%20buyers%27%20stops%20and%20breakout%20sell%20orders%20accumulate%3B%20a%20participant%20who%20needs%20to%20buy%20size%20pushes%20the%20price%20down%20there%2C%20those%20orders%20execute%20and%20give%20them%20the%20counterparty%20they%20needed%2C%20and%20the%20price%20comes%20back%20because%20the%20selling%20was%20mechanical%20and%20exhausted%20itself%20within%20the%20candle.%20The%20key%20is%20that%20the%20rejection%20is%20confirmed%20INSIDE%20the%20same%20bar%2C%20by%20the%20close%3A%20there%20is%20no%20need%20to%20see%20the%20next%20candle%2C%20and%20that%20is%20why%20the%20signal%20is%20causal.\nprior=We%20expect%20a%20positive%20and%20short-lived%20edge%2C%20with%20the%20bulk%20of%20the%20move%20in%20the%20first%20candles%20after%20the%20signal.%20We%20expect%20the%20edge%20to%20be%20larger%20on%2015m%20and%201h%20than%20on%204h%2C%20because%20the%20accumulation%20of%20stops%20at%20visible%20levels%20is%20a%20microstructure%20phenomenon%20and%20it%20blurs%20under%20aggregation.%20We%20expect%20it%20to%20fail%20when%20the%20piercing%20of%20the%20low%20is%20the%20real%20start%20of%20a%20bear%20leg%3A%20there%20the%20close%20in%20the%20upper%20third%20is%20only%20a%20technical%20bounce%20inside%20the%20fall.%20It%20is%20refuted%20if%20there%20is%20no%20difference%20in%20edge%20between%20the%20candles%20that%20pierce%20the%20previous%20low%20and%20the%20ones%20that%20simply%20close%20strong.\nparams_json=%7B%22lookback%22%3A%2220%22%2C%22rejection_fraction%22%3A%220.66666667%22%7D\nparams_sha256=3c623b42e3d9f2522dc4339989aa6b5c899cc2bd516f842d696323352e9bcf0a\ncode_text=def%20_sweep_rejection%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%0A%20%20%20%20%23%20Low%2Fhigh%20of%20the%2020%20PREVIOUS%20candles%3A%20talib.MIN%28...%29%5Bi%5D%20covers%20the%20window%20ending%20at%20i%0A%20%20%20%20%23%20INCLUSIVE%2C%20so%20it%20has%20to%20be%20shifted%20by%20one%20bar%20to%20exclude%20the%20current%20candle.%20The%20shift%20runs%0A%20%20%20%20%23%20towards%20the%20future%20%28_prev%29%2C%20never%20backwards.%0A%20%20%20%20min_prev%20%3D%20_prev%28talib.MIN%28low%2C%20timeperiod%3D20%29%29%0A%20%20%20%20max_prev%20%3D%20_prev%28talib.MAX%28h%2C%20timeperiod%3D20%29%29%0A%0A%20%20%20%20rng%20%3D%20h%20-%20low%0A%20%20%20%20ok%20%3D%20_finite%28min_prev%2C%20max_prev%2C%20rng%29%20%26%20%28rng%20%3E%200.0%29%0A%0A%20%20%20%20%23%20Rejection%3A%20the%20candle%20pierces%20the%20previous%20extreme%20but%20closes%20in%20the%20opposite%20third%20of%20its%0A%20%20%20%20%23%20range.%0A%20%20%20%20sweep_low%20%3D%20ok%20%26%20%28low%20%3C%20min_prev%29%20%26%20%28%28c%20-%20low%29%20%2F%20np.where%28ok%2C%20rng%2C%201.0%29%20%3E%202.0%20%2F%203.0%29%0A%20%20%20%20sweep_high%20%3D%20ok%20%26%20%28h%20%3E%20max_prev%29%20%26%20%28%28h%20-%20c%29%20%2F%20np.where%28ok%2C%20rng%2C%201.0%29%20%3E%202.0%20%2F%203.0%29%0A%0A%20%20%20%20out%5Bsweep_low%5D%20%3D%201%0A%20%20%20%20out%5Bsweep_high%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=c8658f23b9056e506cdd933f25922ddec3b15a7e3bde3dba45649764bc32eb2d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":54,"row_hash":"1f42962bbbdbe1bd40a4d564b1a51178124cdb11a5c3c76fc0f52896a37b8a00","body":"wavelab-journal-chain\nv=3\nseq=54\nprev=4959e7fc2fc577a7baf2be3a1daec55613fd972234b8e5bea7f347b414db6fe6\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=mean_reversion.willr14_fade\nprereg_seq=2\nfamily=mean_reversion\ntitle=Fade%20the%20close%20at%20the%2014-candle%20extreme\nrationale=%25R%20does%20not%20measure%20momentum%3A%20it%20measures%20where%20the%20price%20closes%20within%20the%20high-low%20range%20of%20the%20last%2014%20candles.%20That%20makes%20it%20sensitive%20to%20a%20different%20behaviour%20from%20the%20one%20the%20RSI%20picks%20up.%20Closing%20at%20the%20absolute%20floor%20of%20a%20two-week%20range%20is%20the%20signature%20of%20a%20stop%20run%3A%20a%20push%20looking%20for%20the%20liquidity%20accumulated%20below%20the%20previous%20lows%2C%20executed%20by%20somebody%20who%20needs%20counterparty%20for%20a%20large%20position.%20That%20flow%20is%20mechanical%20and%20uninformed%2C%20and%20once%20executed%20it%20disappears%2C%20which%20is%20exactly%20the%20condition%20for%20the%20absorption%20to%20be%20profitable.\nprior=We%20expect%20a%20positive%20edge%20concentrated%20at%20SHORT%20horizons%20%28a%20few%20candles%29%3A%20the%20sweep%20effect%20runs%20out%20quickly%20and%2C%20if%20the%20position%20is%20held%2C%20the%20signal%20turns%20into%20a%20directional%20bet%2C%20which%20is%20not%20what%20the%20hypothesis%20claims.%20We%20expect%20it%20to%20fail%20on%20genuine%20range%20breaks%2C%20where%20the%20low%20of%20the%20range%20gives%20way%20because%20there%20is%20new%20information%20and%20the%20%25R%20stays%20glued%20to%20-100%20for%20the%20whole%20leg.%20It%20is%20refuted%20if%20the%20edge%20does%20not%20decay%20with%20the%20holding%20horizon.\nparams_json=%7B%22overbought%22%3A%22-20.00000000%22%2C%22oversold%22%3A%22-80.00000000%22%2C%22period%22%3A%2214%22%7D\nparams_sha256=c406ddf453edc52b6f68127068969732e4d8ef81bfc08b753f8c4ce21aeecb34\ncode_text=def%20_willr_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20h%2C%20low%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20out%20%3D%20_sig%28c.size%29%0A%20%20%20%20wr%20%3D%20talib.WILLR%28h%2C%20low%2C%20c%2C%20timeperiod%3D14%29%0A%20%20%20%20ok%20%3D%20_finite%28wr%29%0A%20%20%20%20out%5Bok%20%26%20%28wr%20%3C%20-80.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28wr%20%3E%20-20.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=6de97e88bd62fa43b10b3ff9a2f4530521da1a3619f60e4891697cb85267c1c4\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmean_reversion.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":55,"row_hash":"b8ebda3cac34a9275a46b0a47a567170802a679a9610add207cd0e293b522ff4","body":"wavelab-journal-chain\nv=3\nseq=55\nprev=1f42962bbbdbe1bd40a4d564b1a51178124cdb11a5c3c76fc0f52896a37b8a00\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.ao_confirms_extreme\nprereg_seq=2\nfamily=momentum\ntitle=New%20high%20confirmed%20by%20a%20stronger%20AO\nrationale=A%20new%20price%20high%20accompanied%20by%20an%20AO%20HIGHER%20than%20at%20the%20window%27s%20previous%20high%20means%20that%20the%20displacement%20of%20the%20average%20cost%20is%20bigger%20than%20it%20was%20last%20time%3A%20the%20cohort%20doing%20the%20buying%20is%20more%20numerous%2C%20not%20the%20same%20people%20rotating%20the%20same%20capital.%20That%20is%20the%20pattern%20Elliott%20practitioners%20call%20a%20third%20wave%2C%20the%20one%20with%20the%20most%20participation%20and%20the%20least%20resistance.%20The%20real%20mechanism%20is%20herding%3A%20the%20confirmed%20break%20draws%20in%20the%20systematic%20follower%20and%20retail%20at%20the%20same%20time%2C%20and%20both%20buy%20on%20the%20same%20side%20of%20the%20book.\nprior=We%20expect%20a%20positive%20edge%20but%20a%20very%20concentrated%20one%3A%20the%20signal%20should%20be%20flat%20most%20of%20the%20time%20and%20active%20on%20only%20a%20few%20bars%20per%20year.%20We%20expect%20it%20to%20be%20WORSE%20than%20ao_sign%20in%20total%20edge%20%28by%20being%20in%20the%20market%20far%20less%29%20and%20BETTER%20in%20edge%20per%20bar.%20It%20is%20falsified%20if%20its%20edge%20per%20bar%20does%20not%20beat%20ao_divergence_extreme%27s%3A%20in%20that%20case%20the%20wave%203%20%2F%20wave%205%20distinction%20of%20Elliott%20folklore%20has%20no%20empirical%20content.\nparams_json=%7B%22fast%22%3A%225%22%2C%22separation%22%3A%2210%22%2C%22slow%22%3A%2234%22%2C%22window%22%3A%22100%22%7D\nparams_sha256=0245ae7f182e4010a3cf1ab148402b5e290f497a08ac98340604501fb66dc671\ncode_text=def%20_ao_confirms%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_DIV_WINDOW%20%2B%20_AO_SLOW%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20ao%20%3D%20_ao%28s%29%0A%20%20%20%20jmax%20%3D%20_prior_extreme%28c%2C%20find_max%3DTrue%29%0A%20%20%20%20jmin%20%3D%20_prior_extreme%28c%2C%20find_max%3DFalse%29%0A%0A%20%20%20%20has_max%20%3D%20jmax%20%3E%3D%200%0A%20%20%20%20jm%20%3D%20np.where%28has_max%2C%20jmax%2C%200%29%0A%20%20%20%20ok_max%20%3D%20has_max%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjm%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjm%5D%29%0A%20%20%20%20out%5Bok_max%20%26%20%28c%20%3E%20c%5Bjm%5D%29%20%26%20%28ao%20%3E%20ao%5Bjm%5D%29%20%26%20%28ao%20%3E%200%29%5D%20%3D%201%0A%0A%20%20%20%20has_min%20%3D%20jmin%20%3E%3D%200%0A%20%20%20%20jn%20%3D%20np.where%28has_min%2C%20jmin%2C%200%29%0A%20%20%20%20ok_min%20%3D%20has_min%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjn%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjn%5D%29%0A%20%20%20%20out%5Bok_min%20%26%20%28c%20%3C%20c%5Bjn%5D%29%20%26%20%28ao%20%3C%20ao%5Bjn%5D%29%20%26%20%28ao%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=c867ffca477eb4bb29d7c8b154e0f412fdca9de18e9e1b68d7d7c46392dd0f00\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":56,"row_hash":"b937cfed80c6d702624cfcfc69aeb8e1d0e30c1533c4be82615a0cb0110696c8","body":"wavelab-journal-chain\nv=3\nseq=56\nprev=b8ebda3cac34a9275a46b0a47a567170802a679a9610add207cd0e293b522ff4\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.ao_divergence_extreme\nprereg_seq=2\nfamily=momentum\ntitle=Fade%20the%20high%20the%20AO%20won%27t%20confirm\nrationale=A%20new%20price%20high%20with%20an%20AO%20LOWER%20than%20at%20the%20previous%20high%20says%20that%20the%20price%20was%20made%20with%20less%20displacement%20of%20the%20average%20cost%3A%20the%20high%20is%20produced%20by%20short%20covering%20and%20late%20retail%2C%20with%20a%20smaller%20aggregate%20size%2C%20while%20the%20cohort%20that%20drove%20the%20previous%20leg%20is%20already%20distributing%20into%20them.%20Both%20peaks%20are%20required%20to%20be%20above%20zero%20%28Bill%20Williams%27%20twin%20peaks%29%20so%20as%20not%20to%20confuse%20exhaustion%20with%20a%20bounce%20inside%20a%20fall.%20We%20emit%20the%20signal%20against%20the%20price.\nprior=Our%20prior%20is%20UNFAVOURABLE%20and%20we%20register%20it%20all%20the%20same.%20We%20expect%20a%20slightly%20negative%20edge%20over%20the%20history%20as%20a%20whole%20and%20a%20clearly%20negative%20one%20inside%20the%20long%20trends%20of%202017-Q4%20and%202020-Q4%2C%20where%20the%20divergence%20appears%20and%20the%20price%20goes%20on%20rising%20for%20weeks%3B%20we%20only%20expect%20a%20positive%20edge%20in%20the%20immediate%20neighbourhood%20of%20cycle%20tops%2C%20which%20are%20four%20events%20and%20therefore%20an%20insufficient%20n.%20It%20is%20falsified%20as%20a%20trading%20tool%20if%20its%20overall%20edge%20is%20not%20positive%3B%20it%20is%20registered%20in%20order%20to%20leave%20the%20expected%20failure%20of%20a%20very%20popular%20artefact%20on%20the%20record%2C%20not%20to%20endorse%20it.\nparams_json=%7B%22fast%22%3A%225%22%2C%22separation%22%3A%2210%22%2C%22slow%22%3A%2234%22%2C%22window%22%3A%22100%22%7D\nparams_sha256=0245ae7f182e4010a3cf1ab148402b5e290f497a08ac98340604501fb66dc671\ncode_text=def%20_ao_divergence%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_DIV_WINDOW%20%2B%20_AO_SLOW%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20ao%20%3D%20_ao%28s%29%0A%20%20%20%20jmax%20%3D%20_prior_extreme%28c%2C%20find_max%3DTrue%29%0A%20%20%20%20jmin%20%3D%20_prior_extreme%28c%2C%20find_max%3DFalse%29%0A%0A%20%20%20%20has_max%20%3D%20jmax%20%3E%3D%200%0A%20%20%20%20jm%20%3D%20np.where%28has_max%2C%20jmax%2C%200%29%0A%20%20%20%20ok_max%20%3D%20has_max%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjm%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjm%5D%29%0A%20%20%20%20%23%20Bill%20Williams%27%20bearish%20%22twin%20peaks%22%3A%20both%20peaks%20above%20zero.%0A%20%20%20%20out%5Bok_max%20%26%20%28c%20%3E%20c%5Bjm%5D%29%20%26%20%28ao%20%3C%20ao%5Bjm%5D%29%20%26%20%28ao%20%3E%200%29%20%26%20%28ao%5Bjm%5D%20%3E%200%29%5D%20%3D%20-1%0A%0A%20%20%20%20has_min%20%3D%20jmin%20%3E%3D%200%0A%20%20%20%20jn%20%3D%20np.where%28has_min%2C%20jmin%2C%200%29%0A%20%20%20%20ok_min%20%3D%20has_min%20%26%20np.isfinite%28c%29%20%26%20np.isfinite%28c%5Bjn%5D%29%20%26%20np.isfinite%28ao%29%20%26%20np.isfinite%28ao%5Bjn%5D%29%0A%20%20%20%20out%5Bok_min%20%26%20%28c%20%3C%20c%5Bjn%5D%29%20%26%20%28ao%20%3E%20ao%5Bjn%5D%29%20%26%20%28ao%20%3C%200%29%20%26%20%28ao%5Bjn%5D%20%3C%200%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=cb7914fb0b97da0b1d1e7a0140f0d13fa720d6694bb4c04451d379a0c5558896\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":57,"row_hash":"096bf2d6592663c1f6de198126e0661b2ebb33e3a0a0460bb3ad1f24624f2cd4","body":"wavelab-journal-chain\nv=3\nseq=57\nprev=b937cfed80c6d702624cfcfc69aeb8e1d0e30c1533c4be82615a0cb0110696c8\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.ao_sign\nprereg_seq=2\nfamily=momentum\ntitle=AO%20above%20zero%2C%20recent%20buyers%20in%20profit\nrationale=The%20AO%20subtracts%20the%20median%20price%20of%20the%20last%2034%20candles%20from%20that%20of%20the%20last%205%2C%20that%20is%2C%20it%20compares%20the%20average%20cost%20of%20the%20recent%20buying%20cohort%20with%20that%20of%20the%20previous%20one.%20If%20it%20is%20positive%2C%20those%20who%20bought%20recently%20are%20in%20profit%20and%20are%20in%20no%20hurry%20to%20sell%2C%20so%20the%20supply%20into%20each%20rise%20is%20thin%3B%20if%20it%20is%20negative%2C%20every%20bounce%20runs%20into%20people%20getting%20out%20at%20break-even%2C%20which%20is%20dense%2C%20continuously%20renewed%20supply.%20It%20uses%20%28H%2BL%29%2F2%20instead%20of%20the%20close%2C%20which%20reduces%20the%20weight%20of%20the%20closing-auction%20price%20relative%20to%20the%20range%20actually%20traded.\nprior=We%20expect%20a%20positive%20edge%20in%20a%20trend%20and%20around%20zero%20or%20negative%20in%20a%20range%2C%20where%20the%20crossover%20of%20the%20two%20averages%20happens%20with%20a%20systematic%20lag.%20We%20expect%20it%20NOT%20to%20beat%20an%20equivalent%20moving-average%20crossover%20from%20the%20trend%20family%3A%20if%20it%20does%2C%20the%20median%20price%20contributes%20something%20the%20close%20does%20not%2C%20and%20that%20would%20be%20a%20result%20in%20itself.%20It%20is%20falsified%20if%20the%20sign%20of%20the%20AO%20separates%20future%20returns%20not%20even%20in%20a%20trending%20regime.\nparams_json=%7B%22fast%22%3A%225%22%2C%22slow%22%3A%2234%22%7D\nparams_sha256=a3479e205fdce21157f78c1b5da71b52b171527b38125cd20b93acb9a5b5bd6d\ncode_text=def%20_ao_sign%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_AO_SLOW%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20ao%20%3D%20_ao%28s%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28ao%29%0A%20%20%20%20out%5Bok%20%26%20%28ao%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28ao%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=2995c2db3ba7df90da2c596686dfba3c92ef157701a9a65c9df829bbae320dab\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":58,"row_hash":"2f57f964076d809e0e5a7f930afdc8e77f8b1d8157556e9cb5f26e971f41eab6","body":"wavelab-journal-chain\nv=3\nseq=58\nprev=096bf2d6592663c1f6de198126e0661b2ebb33e3a0a0460bb3ad1f24624f2cd4\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.er_kaufman_filtered\nprereg_seq=2\nfamily=momentum\ntitle=Momentum%20only%20when%20the%20path%20is%20straight\nrationale=The%20efficiency%20ratio%20divides%20the%20net%20displacement%20by%20the%20total%20path%20travelled%2C%20so%20it%20is%20high%20when%20the%20price%20goes%20from%20A%20to%20B%20in%20almost%20a%20straight%20line.%20A%20straight%20path%20is%20the%20signature%20of%20a%20sustained%20imbalance%20of%20the%20book%20%E2%80%94somebody%20large%20executing%20in%20one%20direction%20for%20days%E2%80%94%20and%20a%20zigzag%20path%20is%20the%20signature%20of%20buyers%20and%20sellers%20alternating%20against%20a%20liquidity%20provider.%20The%20hypothesis%20is%20that%20momentum%20only%20pays%20in%20the%20first%20case%2C%20because%20in%20the%20second%20the%20one%20chasing%20the%20trend%20buys%20expensively%20from%20the%20one%20providing%20it%20and%20pays%20the%20spread%20over%20and%20over.\nprior=We%20expect%20the%20edge%20conditioned%20on%20ER%E2%89%A50.30%20to%20be%20clearly%20superior%20to%20roc10%27s%20and%20the%20filter%20to%20greatly%20reduce%20the%20number%20of%20bars%20in%20position.%20It%20is%20falsified%20if%20the%20filtered%20edge%20does%20NOT%20beat%20roc10%27s%3A%20that%20would%20mean%20the%20straightness%20of%20the%20path%20says%20nothing%20about%20future%20persistence%2C%20which%20is%20precisely%20the%20postulated%20mechanism.%20The%200.30%20threshold%20is%20fixed%20a%20priori%3B%20if%20it%20fails%2C%20no%20other%20threshold%20is%20tried%2C%20the%20hypothesis%20is%20taken%20as%20refuted.\nparams_json=%7B%22period%22%3A%2210%22%2C%22threshold%22%3A%220.30000000%22%7D\nparams_sha256=a9f6a9c19e0b43b93d56fd9f4697029085e67acb144937781444ba5bd2f130d0\ncode_text=def%20_er_filtered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ER_PERIOD%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20net%20%3D%20c%20-%20_back%28c%2C%20_ER_PERIOD%29%0A%20%20%20%20path%20%3D%20talib.SUM%28_f%28np.abs%28np.diff%28c%2C%20prepend%3Dnp.nan%29%29%29%2C%20_ER_PERIOD%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28net%29%20%26%20np.isfinite%28path%29%20%26%20%28path%20%3E%200%29%0A%20%20%20%20er%20%3D%20np.full%28c.size%2C%20np.nan%29%0A%20%20%20%20er%5Bok%5D%20%3D%20np.abs%28net%5Bok%5D%29%20%2F%20path%5Bok%5D%0A%20%20%20%20efficient%20%3D%20np.isfinite%28er%29%20%26%20%28er%20%3E%3D%20_ER_THRESHOLD%29%0A%20%20%20%20out%5Befficient%20%26%20%28net%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Befficient%20%26%20%28net%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=c239aeeb4ffd82cf1175db0232f6b00767cd39dfd2d7e6969131ebb7963e10cb\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":59,"row_hash":"4ce41a651865c8fa28c33043c94c3144ba3eec3eded39bc65fb8d99def1e8d3e","body":"wavelab-journal-chain\nv=3\nseq=59\nprev=2f57f964076d809e0e5a7f930afdc8e77f8b1d8157556e9cb5f26e971f41eab6\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.kama_cross\nprereg_seq=2\nfamily=momentum\ntitle=Above%20a%20KAMA%20that%20flattens%20in%20chop\nrationale=The%20KAMA%20uses%20the%20same%20efficiency%20ratio%20to%20interpolate%20between%20a%202-period%20average%20and%20a%2030-period%20one%3A%20it%20sticks%20to%20the%20price%20when%20the%20path%20is%20efficient%20and%20flattens%20out%20when%20it%20is%20noisy.%20The%20participant%20this%20is%20meant%20to%20avoid%20being%20is%20a%20specific%20one%3A%20the%20trend%20follower%20who%20buys%20every%20false%20break%20in%20a%20range%20and%20hands%20the%20spread%20to%20the%20market%20maker%20candle%20after%20candle.%20Against%20er_kaufman_filtered%2C%20which%20decides%20whether%20to%20trade%20at%20all%2C%20here%20efficiency%20decides%20the%20SPEED%20of%20the%20filter%20and%20never%20stops%20having%20an%20opinion.\nprior=We%20expect%20fewer%20signal%20changes%20and%20a%20better%20edge%20per%20bar%20than%20a%20fixed-average%20crossover%2C%20and%20we%20expect%20it%20to%20fail%20at%20the%20start%20of%20explosive%20trends%2C%20where%20the%20adaptation%20lags%20behind%20and%20it%20enters%20late.%20It%20is%20falsified%20if%20its%20edge%20does%20not%20beat%20that%20of%20the%20fixed%20EMA%20crossover%20from%20the%20trend%20family%3A%20in%20that%20case%20adapting%20the%20speed%20buys%20nothing%20and%20only%20adds%20a%20moving%20part.\nparams_json=%7B%22er_period%22%3A%2210%22%2C%22fast%22%3A%222%22%2C%22slow%22%3A%2230%22%7D\nparams_sha256=5a34d528f668145ced6e85a56acaea85b648a48dd81ec19c56c1df1ed3d1faf1\ncode_text=def%20_kama_cross%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_KAMA_ER%20%2B%2032%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20kama%20%3D%20talib.KAMA%28c%2C%20_KAMA_ER%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28kama%29%20%26%20np.isfinite%28c%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20kama%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20kama%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=3528b6cc4243dd169a1e2fd9d047cc789c7b33a55d32a5df65d327ab56cfc4a2\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":60,"row_hash":"b13a0cc4f88d145de10e623945624aa941a7cbf317870fbe6c6e5dfe4e17ba15","body":"wavelab-journal-chain\nv=3\nseq=60\nprev=4ce41a651865c8fa28c33043c94c3144ba3eec3eded39bc65fb8d99def1e8d3e\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.linreg_acceleration\nprereg_seq=2\nfamily=momentum\ntitle=Steepening%20regression%20slope%2C%20immune%20to%20wicks\nrationale=The%20least-squares%20slope%20of%20twenty%20log%20prices%20uses%20all%20twenty%20observations%2C%20not%20just%20the%20endpoints%2C%20so%20a%20single%20cascading-liquidation%20wick%20%E2%80%94which%20is%20forced%20supply%2C%20not%20informed%20demand%E2%80%94%20does%20not%20dominate%20it.%20Its%20change%20over%20twenty%20candles%20measures%20whether%20the%20force%20sustaining%20the%20trend%20is%20growing%20or%20running%20out.%20The%20concrete%20hypothesis%20is%20that%20momentum%20measured%20with%20an%20estimator%20robust%20to%20liquidation%20noise%20survives%20where%20momentum%20measured%20from%20endpoints%20does%20not.\nprior=It%20overlaps%20with%20roc_term_structure%20on%20purpose%20and%20is%20registered%20all%20the%20same%3A%20if%20linreg_acceleration%27s%20edge%20is%20materially%20LARGER%2C%20the%20difference%20is%20down%20to%20the%20noise%20of%20wicks%20and%20liquidations%20and%20not%20to%20the%20concept%20of%20acceleration%3B%20if%20the%20two%20are%20indistinguishable%2C%20the%20robust%20estimator%20buys%20nothing%20in%20BTC.%20We%20expect%20a%20small%20difference.%20It%20is%20falsified%20if%20neither%20version%20has%20an%20edge%2C%20and%20we%20expect%20both%20to%20fail%20at%20trend%20restarts%20after%20capitulation%2C%20where%20the%20slope%20is%20still%20negative%20once%20the%20bottom%20is%20already%20in.\nparams_json=%7B%22period%22%3A%2220%22%7D\nparams_sha256=4838a2385eccfc4e1af37cde2596ae62f4585c510560cbcafb9a922495bb1f18\ncode_text=def%20_linreg_acceleration%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%202%20%2A%20_LINREG%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20safe%20%3D%20np.where%28np.isfinite%28c%29%20%26%20%28c%20%3E%200%29%2C%20c%2C%20np.nan%29%0A%20%20%20%20with%20np.errstate%28invalid%3D%22ignore%22%2C%20divide%3D%22ignore%22%29%3A%0A%20%20%20%20%20%20%20%20log_c%20%3D%20np.log%28safe%29%0A%20%20%20%20if%20not%20np.isfinite%28log_c%29.any%28%29%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20slope%20%3D%20talib.LINEARREG_SLOPE%28_f%28log_c%29%2C%20_LINREG%29%0A%20%20%20%20delta%20%3D%20slope%20-%20_back%28slope%2C%20_LINREG%29%20%20%20%20%20%20%20%20%20%23%20change%20over%20a%20non-overlapping%20window%0A%20%20%20%20ok%20%3D%20np.isfinite%28slope%29%20%26%20np.isfinite%28delta%29%0A%20%20%20%20out%5Bok%20%26%20%28slope%20%3E%200%29%20%26%20%28delta%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28slope%20%3C%200%29%20%26%20%28delta%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=334b1547fe72d295279719821fa53e8c7f752868ed405be9746c1cdbd1fadbfc\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":61,"row_hash":"6164490d0c3e296bd31ad1347208da9c5cfd30857ff1470c5ee7917242ebfef9","body":"wavelab-journal-chain\nv=3\nseq=61\nprev=b13a0cc4f88d145de10e623945624aa941a7cbf317870fbe6c6e5dfe4e17ba15\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.momentum_with_volume\nprereg_seq=2\nfamily=momentum\ntitle=Twenty-bar%20momentum%20backed%20by%20rising%20volume\nrationale=The%20herd%20leaves%20its%20footprint%20in%20the%20volume%3A%20a%20leg%20with%20growing%20participation%20implies%20new%20money%20coming%20in%2C%20whereas%20one%20with%20falling%20volume%20is%20the%20same%20capital%20rotating%20among%20those%20already%20inside%2C%20and%20that%20one%20runs%20out%20on%20its%20own.%20We%20require%20the%205-candle%20volume%20average%20to%20exceed%20the%2020-candle%20one%20at%20the%20same%20time%20as%20the%2020-candle%20return%20has%20a%20definite%20sign%2C%20so%20that%20the%20signal%20is%20only%20active%20when%20direction%20and%20participation%20coincide.%20The%20two%20volume%20windows%20are%20not%20two%20variants%20of%20one%20parameter%3A%20both%20are%20needed%20to%20define%20%27growing%27%2C%20and%20they%20are%20the%20conventional%20relative-volume%20pair.\nprior=We%20expect%20an%20edge%20superior%20to%20the%20plain%20ROC%27s%20only%20on%201d%20and%204h%2C%20and%20FAILURE%20on%201h%20because%20of%20the%20intraday%20seasonality%20of%20volume%20%28the%20Asian%20and%20US%20sessions%29%2C%20which%20fires%20the%20filter%20by%20hour%20of%20day%20and%20not%20by%20conviction.%20This%20is%20also%20the%20first%20hypothesis%20in%20the%20family%20that%20ought%20to%20break%20if%20the%20data%20comes%20from%20an%20exchange%20with%20inflated%20or%20washed%20volume.%20It%20is%20falsified%20if%20the%20volume%20filter%20does%20not%20improve%20on%20the%20unfiltered%2020-bar%20ROC.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20that%20control%20%E2%80%94the%20unfiltered%2020-bar%20ROC%E2%80%94%20was%20not%20registered%20anywhere%2C%20so%20the%20falsification%20criterion%20above%20could%20not%20be%20executed%3B%20it%20has%20been%20registered%20as%20%60flow.roc20_unfiltered%60%20and%20that%20is%20what%20this%20hypothesis%20must%20be%20measured%20against.%20It%20is%20further%20declared%20that%20%60flow.trend_with_participation%60%20is%20the%20same%20construction%20%28ROC-20%20conditioned%20on%20an%20expansion%20of%20volume%29%20with%20a%20different%20pair%20of%20volume%20averages%2C%20and%20that%20the%20two%20are%20dependent%20trials%20even%20though%20they%20share%20few%20signals.\nparams_json=%7B%22roc%22%3A%2220%22%2C%22volume_long%22%3A%2220%22%2C%22volume_short%22%3A%225%22%7D\nparams_sha256=3be3eb3e35e451678635b46255840c72631e34f0a65f707501974c419c45b447\ncode_text=def%20_momentum_with_volume%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ROC_LONG%20%2B%20_VOL_LONG%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20v%20%3D%20_f%28s.volume%29%0A%20%20%20%20if%20not%20np.isfinite%28v%29.any%28%29%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%20_ROC_LONG%29%0A%20%20%20%20v_short%20%3D%20talib.SMA%28v%2C%20_VOL_SHORT%29%0A%20%20%20%20v_long%20%3D%20talib.SMA%28v%2C%20_VOL_LONG%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28roc%29%20%26%20np.isfinite%28v_short%29%20%26%20np.isfinite%28v_long%29%20%26%20%28v_long%20%3E%200%29%0A%20%20%20%20participating%20%3D%20ok%20%26%20%28v_short%20%3E%20v_long%29%0A%20%20%20%20out%5Bparticipating%20%26%20%28roc%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bparticipating%20%26%20%28roc%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=e963f28fcb16e656e4668c1e2bcf66b87fbe5887c1fd19e1fdcbb574f8997484\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":62,"row_hash":"6f507dfea22302048364b89da55923958a4c0ea1a20ae6e0178c87de045ff665","body":"wavelab-journal-chain\nv=3\nseq=62\nprev=6164490d0c3e296bd31ad1347208da9c5cfd30857ff1470c5ee7917242ebfef9\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.roc10\nprereg_seq=2\nfamily=momentum\ntitle=Follow%20the%20last%20ten%20candles%27%20direction\nrationale=Pure%20underreaction.%20When%20relevant%20information%20appears%20%28a%20macro%20print%2C%20a%20move%20by%20a%20large%20holder%2C%20a%20regulatory%20headline%29%20not%20every%20participant%20processes%20it%20at%20the%20same%20time%3A%20the%20adjustment%20is%20spread%20across%20several%20candles%20because%20the%20big%20desks%20slice%20their%20orders%20so%20as%20not%20to%20move%20the%20market.%20The%20sign%20of%20the%20last%20ten%20candles%27%20return%20is%20the%20most%20direct%20measure%20of%20that%20adjustment%20in%20progress%2C%20before%20the%20positioning%20saturates.\nprior=We%20expect%20a%20positive%20edge%20on%204h%20and%201d%20and%20a%20NULL%20OR%20NEGATIVE%20edge%20on%201h%2C%20where%20microstructure%20noise%20and%20the%20cost%20per%20turnover%20eat%20the%20effect.%20It%20is%20falsified%20if%20the%20sign%20of%20the%20ROC%20separates%20future%20returns%20on%20no%20timeframe%3B%20and%20if%20the%20edge%20turned%20out%20to%20be%20LARGER%20on%201h%20than%20on%201d%2C%20the%20mechanism%20we%20postulate%20is%20false%3A%20we%20would%20be%20measuring%20microstructure%20autocorrelation%2C%20not%20information%20diffusion.\nparams_json=%7B%22period%22%3A%2210%22%7D\nparams_sha256=5ce3c90ae02dfb8c1dfdaafe3fc6f20c504a67ff6e395fdd22f2042315c42e7b\ncode_text=def%20_roc_short%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ROC_SHORT%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20roc%20%3D%20talib.ROC%28c%2C%20_ROC_SHORT%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28roc%29%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3E%200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28roc%20%3C%200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=54d6270e6173ff3c39bcd5b3300ea270222e1981ecc76f9e91c32f08dd56cdf7\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":63,"row_hash":"c71ef059e368489c8a7ce93b62eb619d65fb5112247ffeca3c55220e8b85620a","body":"wavelab-journal-chain\nv=3\nseq=63\nprev=6f507dfea22302048364b89da55923958a4c0ea1a20ae6e0178c87de045ff665\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.roc_term_structure\nprereg_seq=2\nfamily=momentum\ntitle=Speeding%20up%2C%20not%20just%20rising\nrationale=Second-order%20herding%20effect.%20A%20trend%20that%20is%20ACCELERATING%20indicates%20that%20new%20participants%20are%20still%20coming%20in%20%E2%80%94rising%20leverage%2C%20rising%20perpetual%20funding%2C%20FOMO%20buying%E2%80%94%20whereas%20one%20that%20is%20decelerating%20indicates%20that%20the%20marginal%20buyer%20has%20run%20out%20and%20all%20that%20is%20left%20is%20rotation%20among%20those%20already%20inside.%20We%20compare%20the%20per-candle%20rate%20over%2010%20candles%20against%20the%20one%20over%2020%20so%20that%20the%20comparison%20is%20on%20a%20homogeneous%20scale%3B%20this%20is%20not%20a%20variant%20of%20roc10%2C%20it%20is%20a%20condition%20on%20its%20derivative.\nprior=We%20expect%20a%20positive%20edge%2C%20higher%20per%20bar%20than%20roc10%20while%20the%20trend%20accelerates%2C%20and%20we%20expect%20it%20to%20FAIL%20exactly%20at%20blow-off%20tops%2C%20where%20the%20acceleration%20peaks%20on%20the%20eve%20of%20the%20turn%20%28December%202017%2C%20April%20and%20November%202021%29.%20It%20is%20falsified%20if%20its%20edge%20is%20indistinguishable%20from%20roc10%27s%3A%20the%20acceleration%20would%20be%20adding%20no%20information%20over%20the%20level.\nparams_json=%7B%22long%22%3A%2220%22%2C%22short%22%3A%2210%22%7D\nparams_sha256=2e06c1e800124d2f56860a71226d42a82e307df3fedb543d7c55f2a6b03161f5\ncode_text=def%20_roc_term_structure%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_ROC_LONG%20%2B%201%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20%23%20Rate%20PER%20CANDLE%2C%20so%20that%20the%20two%20horizons%20are%20comparable%20in%20scale.%0A%20%20%20%20short_rate%20%3D%20talib.ROC%28c%2C%20_ROC_SHORT%29%20%2F%20_ROC_SHORT%0A%20%20%20%20long_rate%20%3D%20talib.ROC%28c%2C%20_ROC_LONG%29%20%2F%20_ROC_LONG%0A%20%20%20%20ok%20%3D%20np.isfinite%28short_rate%29%20%26%20np.isfinite%28long_rate%29%0A%20%20%20%20out%5Bok%20%26%20%28long_rate%20%3E%200%29%20%26%20%28short_rate%20%3E%20long_rate%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28long_rate%20%3C%200%29%20%26%20%28short_rate%20%3C%20long_rate%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=d5fb6ca28917ab64342434489771edb6f5415ca53443e3dcdacfee5bfc8f029c\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":64,"row_hash":"89686470e0dd1d48ade1f46368ee83d3acaad38680de2443ccb59b2d10569527","body":"wavelab-journal-chain\nv=3\nseq=64\nprev=c71ef059e368489c8a7ce93b62eb619d65fb5112247ffeca3c55220e8b85620a\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=momentum.sign_persistence\nprereg_seq=2\nfamily=momentum\ntitle=Counting%20green%20candles%2C%20ignoring%20their%20size\nrationale=It%20counts%20how%20many%20of%20the%20last%20twenty%20candles%20closed%20up%20and%20discards%20magnitude%20entirely.%20The%20reason%20is%20that%20the%20two%20mechanisms%20leave%20different%20footprints%3A%20herding%20and%20systematic%20following%20produce%20a%20succession%20of%20small%2C%20repeated%20purchases%20%E2%80%94drift%20with%20many%20candles%20of%20the%20same%20sign%E2%80%94%20whereas%20a%20headline%20or%20a%20liquidation%20produces%20an%20enormous%20magnitude%20in%20a%20single%20candle%20and%20no%20persistence%20at%20all.%20Separating%20frequency%20from%20size%20is%20exactly%20what%20this%20hypothesis%20tests%2C%20and%20it%20makes%20it%20immune%20to%20BTC%27s%20fat%20tails%20into%20the%20bargain.\nprior=We%20expect%20a%20positive%20edge%20SMALLER%20than%20roc10%27s%20but%20more%20stable%20across%20regimes%2C%20it%20being%20a%20count%20statistic.%20We%20expect%20it%20to%20fail%20explicitly%20in%20stretches%20of%20slow%20bullish%20drift%20followed%20by%20vertical%20falls%20%28the%20second%20half%20of%202021%29%3A%20there%20the%20frequency%20of%20green%20candles%20is%20high%20and%20the%20cumulative%20return%20negative%2C%20and%20the%20signal%20will%20be%20long%20the%20whole%20way.%20It%20is%20falsified%20if%20the%20count%20of%20signs%20separates%20future%20returns%20on%20no%20timeframe.\nparams_json=%7B%22threshold%22%3A%2214%22%2C%22window%22%3A%2220%22%7D\nparams_sha256=ea2dceb89eaef8be4027b0601119718838e86c516f8024dfb748d7a20a5eced0\ncode_text=def%20_sign_persistence%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%2C%20out%20%3D%20_base%28s%2C%20_PERSIST_WINDOW%20%2B%202%29%0A%20%20%20%20if%20c%20is%20None%3A%0A%20%20%20%20%20%20%20%20return%20out%0A%20%20%20%20r%20%3D%20np.diff%28c%2C%20prepend%3Dnp.nan%29%0A%20%20%20%20up%20%3D%20%28r%20%3E%200%29.astype%28np.float64%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20NaN%20-%3E%20False%20-%3E%200.0%2C%20no%20invented%20signal%0A%20%20%20%20down%20%3D%20%28r%20%3C%200%29.astype%28np.float64%29%0A%20%20%20%20n_up%20%3D%20talib.SUM%28_f%28up%29%2C%20_PERSIST_WINDOW%29%0A%20%20%20%20n_down%20%3D%20talib.SUM%28_f%28down%29%2C%20_PERSIST_WINDOW%29%0A%20%20%20%20ok%20%3D%20np.isfinite%28n_up%29%20%26%20np.isfinite%28n_down%29%0A%20%20%20%20out%5Bok%20%26%20%28n_up%20%3E%3D%20_PERSIST_HIGH%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28n_down%20%3E%3D%20_PERSIST_HIGH%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=f4bbf1faa8f9354411060eb98339da84e18bd1b54406dabf94355132358326d8\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fmomentum.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":65,"row_hash":"0c4f6e16ac63b935d9a39705f403809a367411c1982786a830325fef724c9567","body":"wavelab-journal-chain\nv=3\nseq=65\nprev=89686470e0dd1d48ade1f46368ee83d3acaad38680de2443ccb59b2d10569527\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=seasonality.post_monthly_expiry_long\nprereg_seq=2\nfamily=seasonality\ntitle=Long%20the%20three%20days%20after%20monthly%20expiry\nrationale=Once%20the%20monthly%20expiry%20has%20passed%20%28last%20Friday%2C%2008%3A00%20UTC%20on%20Deribit%29%2C%20the%20delta%20hedging%20that%20anchors%20price%20to%20the%20strikes%20with%20the%20most%20open%20interest%20disappears%2C%20and%20positioning%20is%20rebuilt%3A%20expired%20calls%20are%20rolled%20to%20the%20next%20month%2C%20the%20desks%20reopen%20the%20carry%20and%20the%20leverage%20that%20was%20trimmed%20comes%20back.%20That%20rebuilding%20of%20long%20positioning%20is%2C%20mechanically%2C%20buying%20flow%20spread%20over%20the%20immediately%20following%20days.\nprior=We%20expect%20small%20positive%20drift%20in%20the%20three%20days%20after%20each%20monthly%20expiry.%20It%20fails%20if%20it%20is%20nil%2C%20and%20most%20especially%20if%20it%20turns%20out%20to%20be%20the%20symmetric%20mirror%20of%20%60pre_quarterly_expiry_short%60%3A%20if%20what%20we%20are%20measuring%20is%20a%20single%20pivot%20around%20the%20expiry%2C%20they%20are%20not%20two%20findings%20but%20one%20and%20it%20has%20to%20be%20counted%20as%20ONE%20trial.%20We%20expect%20it%20to%20fail%20in%20the%20months%20where%20the%20expiry%20falls%20next%20to%20the%20turn%20of%20the%20month%2C%20where%20its%20window%20blurs%20into%20%60turn_of_month_long%60%27s%20and%20neither%20of%20the%20two%20is%20attributable.\nparams_json=%7B%22anchor%22%3A%22last%20Friday%20of%20each%20month%2C%2008%3A00%20UTC%22%2C%22days_after%22%3A%223%22%7D\nparams_sha256=f1490af2c2c2f9aa14cebd31581d34cc7720b009a58a4d1c736fd01fe042a869\ncode_text=def%20_post_monthly_expiry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20dates%20%3D%20_date%28_hold_ts%28s%29%29%0A%20%20%20%20months%20%3D%20dates.astype%28%22datetime64%5BM%5D%22%29%0A%0A%20%20%20%20%23%20The%20expiry%20in%20force%20is%20this%20month%27s%20if%20it%20has%20already%20happened%3B%20if%20not%2C%20the%20previous%20month%27s.%0A%20%20%20%20%23%20Without%20this%2C%20the%20first%20days%20of%20a%20month%20%28when%20the%20last%20Friday%20falls%20on%20the%2030th%20or%2031st%29%0A%20%20%20%20%23%20would%20be%20left%20out.%0A%20%20%20%20exp_current%20%3D%20_last_friday%28months%29%0A%20%20%20%20exp_previous%20%3D%20_last_friday%28months%20-%20np.timedelta64%281%2C%20%22M%22%29%29%0A%20%20%20%20in_force%20%3D%20np.where%28dates%20%3E%3D%20exp_current%2C%20exp_current%2C%20exp_previous%29%0A%0A%20%20%20%20days_since%20%3D%20%28dates%20-%20in_force%29.astype%28np.int64%29%0A%20%20%20%20out%5B%28days_since%20%3E%3D%201%29%20%26%20%28days_since%20%3C%3D%203%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=5ba6270d6b6b065d6a6115ff54c8b39447ea22b4c967830f96fd5cd9ba16b89b\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fseasonality.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":66,"row_hash":"906a679e116db971fdfc1d4f420e3b8de45ac83d12354dae00f155fde6f8101b","body":"wavelab-journal-chain\nv=3\nseq=66\nprev=0c4f6e16ac63b935d9a39705f403809a367411c1982786a830325fef724c9567\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=seasonality.pre_quarterly_expiry_short\nprereg_seq=2\nfamily=seasonality\ntitle=Short%20the%20week%20before%20quarterly%20expiry\nrationale=The%20largest%20open%20interest%20in%20options%20and%20futures%20%28Deribit%20and%20CME%29%20expires%20on%20the%20last%20Friday%20of%20March%2C%20June%2C%20September%20and%20December.%20In%20the%20week%20before%2C%20that%20interest%20is%20closed%20or%20rolled%3A%20the%20spot-futures%20basis%20compresses%2C%20the%20desks%20that%20were%20funding%20the%20carry%20unwind%20the%20spot%20long%20that%20hedged%20it%2C%20and%20options%20holders%20adjust%20delta%20against%20an%20ever-nearer%20expiry.%20The%20net%20of%20those%20trades%20removes%20LONG%20leverage%2C%20which%20is%20the%20structurally%20dominant%20side%20in%20crypto%2C%20and%20removing%20the%20dominant%20side%20pushes%20the%20price%20down.\nprior=We%20expect%20slightly%20negative%20drift%20in%20the%20seven%20days%20before%20quarterly%20expiry.%20It%20fails%20if%20the%20drift%20is%20positive%20or%20indistinguishable%20from%20the%20rest%20of%20the%20quarter.%20A%20warning%20that%20is%20part%20of%20the%20registration%3A%20there%20are%20four%20quarterly%20expiries%20a%20year%2C%20so%20the%20effective%20sample%20is%20a%20few%20dozen%20EVENTS%2C%20not%20thousands%20of%20candles%3B%20the%20multiple-comparison%20correction%20has%20to%20be%20applied%20over%20events%20and%20the%20confidence%20intervals%20computed%20by%20blocks%2C%20not%20per%20candle%2C%20or%20the%20standard%20error%20will%20come%20out%20falsely%20tiny.%20If%20the%20effect%20only%20shows%20up%20in%20the%20quarters%20of%20one%20particular%20bull%20year%2C%20what%20we%20have%20is%20that%20year%20and%20not%20the%20expiry.\nparams_json=%7B%22anchor%22%3A%22last%20Friday%20of%20the%20quarter%2C%2008%3A00%20UTC%22%2C%22days_before%22%3A%227%22%2C%22months%22%3A%5B%223%22%2C%226%22%2C%229%22%2C%2212%22%5D%7D\nparams_sha256=f95b74ab6faead0eb8e4951cbb4525375f458a95bb8e0a06d1bc3c486594ef7b\ncode_text=def%20_pre_quarterly_expiry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20dates%20%3D%20_date%28_hold_ts%28s%29%29%0A%20%20%20%20months%20%3D%20dates.astype%28%22datetime64%5BM%5D%22%29%0A%20%20%20%20quarterly%20%3D%20np.isin%28%28months.astype%28np.int64%29%20%25%2012%29%2C%20%282%2C%205%2C%208%2C%2011%29%29%20%20%20%23%20Mar%2C%20Jun%2C%20Sep%2C%20Dec%0A%20%20%20%20days_to%20%3D%20%28_last_friday%28months%29%20-%20dates%29.astype%28np.int64%29%0A%20%20%20%20out%5Bquarterly%20%26%20%28days_to%20%3E%3D%201%29%20%26%20%28days_to%20%3C%3D%207%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=e06adc17b3cb136982efd3e8613213e55ac0e5316b4d3a95e3cb9b56f877e4aa\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fseasonality.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":67,"row_hash":"9ad5e619d1ddee7d9a34c89ba59428e3466208f3d7fae4cb52fb44e92251d82a","body":"wavelab-journal-chain\nv=3\nseq=67\nprev=906a679e116db971fdfc1d4f420e3b8de45ac83d12354dae00f155fde6f8101b\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=seasonality.turn_of_month_long\nprereg_seq=2\nfamily=seasonality\ntitle=Long%20the%20last%20day%20of%20the%20month%20and%20the%20first%20three\nrationale=Recurring%20purchases%20have%20a%20calendar%3A%20payroll%2C%20automatic%20DCA%20programmes%20on%20the%20exchanges%20and%20periodic%20contributions%20from%20funds%20and%20treasuries%20all%20cluster%20at%20month%20end%20and%20in%20the%20first%20days%20of%20the%20next%20one.%20That%20flow%20is%20price-insensitive%20%E2%80%94%20it%20buys%20the%20amount%2C%20whatever%20it%20costs%20%E2%80%94%20and%20it%20arrives%20synchronised%20into%20a%20book%20whose%20sellers%20do%20not%20share%20that%20synchrony.%20It%20is%20the%20same%20turn-of-month%20effect%20documented%20in%20equities%20since%20the%201980s%2C%20transplanted%20to%20an%20asset%20whose%20retail%20base%20buys%20a%20fixed%20amount%20rather%20than%20on%20a%20one-off%20conviction.\nprior=We%20expect%20a%20small%20positive%20edge%20on%20the%20last%20calendar%20day%20of%20the%20month%20and%20the%20first%20three%20of%20the%20next%2C%20above%20the%20null%20arm.%20It%20fails%20if%20the%20edge%20is%20nil%2C%20which%20is%20what%20to%20expect%20if%20crypto%20flow%20is%20not%20synchronised%20with%20any%20payroll%2C%20being%20a%20global%20base%20with%20no%20common%20payday.%20Second%20criterion%2C%20and%20a%20stricter%20one%3A%20if%20the%20edge%20is%20concentrated%20in%20just%20ONE%20of%20the%20four%20days%2C%20it%20is%20a%20coincidence%20and%20not%20a%20flow%20%E2%80%94%20the%20mechanism%20predicts%20a%20BLOCK%20of%20days%2C%20not%20a%20date.%20We%20expect%20it%20to%20weaken%20in%20the%20months%20whose%201st%20falls%20at%20a%20weekend%2C%20with%20the%20fiat%20rails%20closed.\nparams_json=%7B%22days%22%3A%22last%20calendar%20day%20of%20the%20month%20and%20days%201%2C%202%20and%203%20of%20the%20next%22%7D\nparams_sha256=af5cfba956e6b1eb9169870c84bcc81ee4b9a4313a058d9210e0483f87d918ea\ncode_text=def%20_turn_of_month%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20dates%20%3D%20_date%28_hold_ts%28s%29%29%0A%20%20%20%20dom%2C%20length%20%3D%20_day_of_month%28dates%29%0A%20%20%20%20out%5B%28dom%20%3C%3D%203%29%20%7C%20%28dom%20%3D%3D%20length%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=c522653c5f8ac36c01038a173465d39ff84e533bc9ccd12c3e33236566a78a64\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fseasonality.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":68,"row_hash":"474701e3dcebbadb541651e46e6cdae6688dc706ad399fde57ac1f554bc148c9","body":"wavelab-journal-chain\nv=3\nseq=68\nprev=9ad5e619d1ddee7d9a34c89ba59428e3466208f3d7fae4cb52fb44e92251d82a\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=seasonality.weekend_short\nprereg_seq=2\nfamily=seasonality\ntitle=Short%20the%20weekend%2C%20fiat%20rails%20closed\nrationale=At%20the%20weekend%20the%20fiat%20rails%20are%20closed%3A%20no%20bank%20transfers%2C%20no%20creation%20or%20redemption%20of%20ETF%20shares%2C%20and%20the%20CME%20does%20not%20trade.%20What%20is%20left%20is%20the%2024%2F7%20perpetual%20with%20market%20makers%20who%20trim%20inventory%20because%20they%20cannot%20hedge%20on%20the%20regulated%20market%2C%20so%20the%20book%20thins%20out%20and%20spreads%20widen.%20The%20buying%20flow%20that%20has%20a%20calendar%20%28institutional%2C%20payroll%2C%20ETF%29%20disappears%20for%2048%20hours%2C%20while%20the%20forced%20selling%20flow%20%E2%80%94%20leverage%20liquidations%20%E2%80%94%20never%20rests.%20The%20asymmetry%20between%20a%20buyer%20who%20keeps%20office%20hours%20and%20an%20automatic%20seller%20is%20the%20mechanism.\nprior=We%20expect%20Saturday%20and%20Sunday%20drift%20to%20be%20less%20than%20or%20equal%20to%20zero%20and%20clearly%20below%20that%20of%20weekdays.%20It%20fails%20if%20the%20weekend%20shows%20positive%20drift%20comparable%20to%20the%20weekday%20one.%20We%20also%20expect%20the%20effect%20to%20have%20WEAKENED%20since%202021%2C%20when%20perpetuals%20and%20automated%20market%20making%20came%20to%20dominate%20volume%3A%20if%20it%20only%20shows%20up%20in%20the%202017-2020%20subsample%2C%20it%20is%20a%20fossil%20of%20a%20market%20that%20no%20longer%20exists%20and%20we%20will%20declare%20it%20as%20such%20instead%20of%20selling%20it%20as%20a%20tradeable%20regularity.\nparams_json=%7B%22days%22%3A%22Saturday%20and%20Sunday%20UTC%22%7D\nparams_sha256=e7b0d1f330e481e87a64f2f29d97b70ec0ddd7904b162109620d41f71ab978d1\ncode_text=def%20_weekend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20out%20%3D%20np.zeros%28len%28s%29%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20wd%20%3D%20_weekday%28_hold_ts%28s%29%29%0A%20%20%20%20out%5Bwd%20%3E%3D%205%5D%20%3D%20-1%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20Saturday%20%285%29%20and%20Sunday%20%286%29%0A%20%20%20%20return%20out%0A\ncode_sha256=108db0123233af86eaf7f30386e00b78f6b022e605251e317818097b91879d97\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fseasonality.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":69,"row_hash":"329450c5aa3de2611bdf41243caaed30f4bdb8f8b57338306802c8b81ddc146d","body":"wavelab-journal-chain\nv=3\nseq=69\nprev=474701e3dcebbadb541651e46e6cdae6688dc706ad399fde57ac1f554bc148c9\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.atr_buffered_break\nprereg_seq=2\nfamily=structure\ntitle=Break%20half%20an%20ATR%20past%20the%20level\nrationale=A%20direct%20complement%20to%20%60sweep_reversal_20%60%20and%20an%20explicit%20test%20of%20hypothesis%201.%20If%20it%20is%20true%20that%20the%20stops%20pile%20up%20just%20behind%20the%20level%20and%20that%20somebody%20goes%20looking%20for%20them%2C%20then%20the%20MARGINAL%20break%20%E2%80%94the%20one%20that%20pokes%20a%20few%20ticks%20above%E2%80%94%20is%20systematically%20the%20worst%2C%20because%20it%20is%20exactly%20the%20one%20produced%20by%20whoever%20wants%20to%20sell.%20Requiring%20the%20close%20to%20clear%20the%20level%20by%20half%20a%2014-candle%20ATR%20discards%20that%20zone%20without%20changing%20anything%20else%20about%20the%20rule%2C%20and%20it%20makes%20the%20buffer%20adapt%20to%20volatility%20on%20its%20own%20instead%20of%20fixing%20an%20arbitrary%20percentage.\nprior=We%20expect%20a%20positive%20edge%20and%20a%20larger%20one%20per%20trade%20than%20the%20break%20without%20a%20buffer%2C%20and%20this%20is%20the%20comparison%20that%20matters.%20Since%20%60sweep_reversal_20%60%20claims%20the%20discarded%20zone%20has%20a%20NEGATIVE%20edge%2C%20the%20two%20hypotheses%20have%20to%20be%20consistent%20with%20each%20other%3A%20if%20the%20sweep%20turns%20out%20profitable%20but%20the%20buffer%20does%20not%20improve%20the%20break%2C%20or%20the%20other%20way%20round%2C%20one%20of%20the%20two%20is%20measuring%20something%20else.%20We%20expect%20the%20buffer%20to%20hurt%20on%201d%2C%20where%20half%20a%20daily%20ATR%20is%20an%20enormous%20move%20and%20entering%20that%20late%20gives%20away%20most%20of%20the%20displacement.\nparams_json=%7B%22atr%22%3A%2214%22%2C%22atr_buffer%22%3A%220.50000000%22%2C%22channel%22%3A%2220%22%7D\nparams_sha256=72a43803a22623e8688d113cd5cb1fe6bdaf63a4f65c0dc05260d6b9f1db148f\ncode_text=def%20_atr_buffered_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28_f%28s.high%29%2C%20_f%28s.low%29%2C%20c%2C%2014%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20hh%20%2B%200.5%20%2A%20atr%29%2C%20_lt%28c%2C%20ll%20-%200.5%20%2A%20atr%29%29%0A\ncode_sha256=af8c46a36e33df6027f41ada349ff12e50110f8704a8987ad31d0a934a736e6e\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":70,"row_hash":"8e4492f8c0b1832e036f54ddc006c852106c478ccb3419d4d5231c303755a98a","body":"wavelab-journal-chain\nv=3\nseq=70\nprev=329450c5aa3de2611bdf41243caaed30f4bdb8f8b57338306802c8b81ddc146d\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.bos_swing\nprereg_seq=2\nfamily=structure\ntitle=Break%20of%20the%20last%20confirmed%20swing\nrationale=The%20structural%20version%20of%20the%20breakout%3A%20instead%20of%20a%20fixed-length%20channel%2C%20the%20level%20is%20the%20last%20swing%20high%20or%20low%20CONFIRMED%20by%20a%205-candle%20fractal.%20The%20mechanical%20difference%20matters%3A%20a%2020%20channel%20moves%20through%20the%20mere%20passage%20of%20time%20even%20if%20nothing%20has%20happened%2C%20whereas%20a%20pivot%20only%20changes%20when%20the%20market%20has%20genuinely%20turned%20and%20left%20somebody%20trapped%20at%20the%20extreme.%20That%20is%20where%20the%20real%20stops%20are%2C%20because%20it%20is%20the%20only%20point%20that%20invalidates%20the%20thesis%20of%20whoever%20bought%20the%20previous%20impulse.\nprior=We%20expect%20a%20positive%20edge%20similar%20to%20or%20slightly%20below%20the%2020%20channel%27s%20but%20with%20FEWER%20trades%2C%20because%20the%20levels%20are%20more%20stable.%20We%20expect%20it%20to%20fail%20when%20volatility%20compresses%3A%20with%20small%20candles%20the%20fractal%20confirms%20trivial%20pivots%2C%20the%20level%20ends%20up%20a%20tick%20away%20from%20price%20and%20the%20signal%20flips%20sign%20constantly.%20The%20hypothesis%20is%20refuted%20if%20the%20edge%20per%20trade%20does%20not%20beat%20the%2020%20channel%27s%2C%20because%20then%20the%20%27structural%27%20part%20adds%20nothing%20over%20a%20rolling%20maximum.\nparams_json=%7B%22confirmation_lag%22%3A%222%22%2C%22fractal_k%22%3A%222%22%2C%22fractal_window%22%3A%225%22%7D\nparams_sha256=ad33585f6e524ebc529b5d82965cf6f655a96e1bf0e94836209e848d921fe5a5\ncode_text=def%20_bos_swing%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20_%2C%20pl1%2C%20_%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20ph1%29%2C%20_lt%28c%2C%20pl1%29%29%0A\ncode_sha256=70b0d8f4faf4b907fc300fd638b26ad394f456492ce52426e94599b11cfc084b\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":71,"row_hash":"5129c011c1fc7e753035fdcd411dcd29a40c4358c496706ef459c6ff6ade3169","body":"wavelab-journal-chain\nv=3\nseq=71\nprev=8e4492f8c0b1832e036f54ddc006c852106c478ccb3419d4d5231c303755a98a\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.choch\nprereg_seq=2\nfamily=structure\ntitle=First%20break%20against%20the%20structure%20in%20force\nrationale=The%20change%20of%20character%20is%20the%20first%20time%20the%20sequence%20breaks%3A%20we%20had%20been%20making%20higher%20highs%20and%20higher%20lows%20and%20suddenly%20the%20last%20low%20is%20lost.%20The%20mechanism%20is%20not%20the%20break%20itself%20but%20WHO%20is%20on%20the%20other%20side%3A%20in%20a%20rising%20sequence%2C%20each%20low%20is%20where%20the%20latest%20batch%20of%20trend%20buyers%20got%20in%2C%20with%20the%20stop%20just%20underneath.%20Losing%20that%20low%20means%20the%20demand%20that%20was%20holding%20the%20impulse%20up%20no%20longer%20shows%20up%2C%20and%20it%20turns%20the%20recent%20buyers%20into%20forced%20sellers.%20The%20difference%20from%20%60bos_swing%60%20is%20that%20here%20only%20the%20break%20AGAINST%20the%20structure%20in%20force%20is%20traded%2C%20not%20the%20one%20with%20it.\nprior=We%20expect%20a%20positive%20edge%20but%20SMALLER%20than%20the%20continuation%20one%2C%20and%20heavily%20dependent%20on%20the%20timeframe%3A%20credible%20on%204h%20and%201d%2C%20doubtful%20on%2015m.%20We%20expect%20it%20to%20fail%20clearly%20in%20strong%20trends%2C%20where%20most%20CHoCHs%20are%20shakeouts%20inside%20the%20impulse%20and%20price%20resumes%3A%20there%20it%20should%20give%20a%20NEGATIVE%20edge%2C%20and%20if%20it%20does%20not%2C%20the%20signal%20is%20not%20capturing%20what%20we%20think%20it%20is.%20It%20is%20also%20refuted%20if%20its%20result%20is%20indistinguishable%20from%20%60bos_swing%60%27s%20with%20the%20sign%20flipped%3A%20that%20would%20mean%20we%20are%20only%20measuring%20price%20autocorrelation%2C%20not%20structure.\nparams_json=%7B%22context%22%3A%222%20pivots%20per%20side%22%2C%22fractal_k%22%3A%222%22%7D\nparams_sha256=ea00237189d26c23a65f11f1386a248f19015469c36125d9f4cbecfa5ebd70b9\ncode_text=def%20_choch%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20ph2%2C%20pl1%2C%20pl2%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20uptrend%20%3D%20_gt%28ph1%2C%20ph2%29%20%26%20_gt%28pl1%2C%20pl2%29%20%20%20%20%20%20%23%20rising%20sequence%20in%20force%0A%20%20%20%20downtrend%20%3D%20_lt%28ph1%2C%20ph2%29%20%26%20_lt%28pl1%2C%20pl2%29%20%20%20%20%23%20falling%20sequence%20in%20force%0A%20%20%20%20%23%20Change%20of%20character%3A%20first%20low%20lost%20after%20a%20rising%20sequence%20%28and%20its%20mirror%20image%29.%0A%20%20%20%20choch_dn%20%3D%20uptrend%20%26%20_lt%28c%2C%20pl1%29%0A%20%20%20%20choch_up%20%3D%20downtrend%20%26%20_gt%28c%2C%20ph1%29%0A%20%20%20%20return%20_hold%28choch_up%2C%20choch_dn%29%0A\ncode_sha256=0be8f30a9cc254548716dc6ce0e2d5f2da9e9cf4e94db04c23f3fb846e2ff7ee\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":72,"row_hash":"b51bf221dc559ff5360ee07d5db3de16d87b0b5c32860622f5e44cf70e65e4f1","body":"wavelab-journal-chain\nv=3\nseq=72\nprev=5129c011c1fc7e753035fdcd411dcd29a40c4358c496706ef459c6ff6ade3169\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.compression_break\nprereg_seq=2\nfamily=structure\ntitle=Break%20with%20the%20channel%20at%20its%20narrowest\nrationale=A%20break%20only%20matters%20if%20there%20was%20contained%20disagreement%20beforehand.%20When%20the%20width%20of%20the%2020%20channel%20falls%20to%20its%20lowest%20of%20the%20last%2060%20candles%2C%20buyers%20and%20sellers%20have%20reached%20a%20narrow%20equilibrium%20and%20both%20camps%20have%20been%20stacking%20stops%20very%20close%20by%2C%20a%20few%20ticks%20from%20price%20and%20from%20each%20other.%20Leaving%20that%20zone%20executes%20both%20stop%20books%20in%20a%20chain%2C%20which%20is%20the%20only%20moment%20when%20a%20break%20drags%20along%20a%20volume%20disproportionate%20to%20the%20size%20of%20the%20preceding%20move.%20Compression%20does%20not%20predict%20direction%3A%20it%20only%20says%20that%20the%20move%20which%20resolves%20it%20will%20be%20disproportionate.\nprior=We%20expect%20an%20edge%20per%20trade%20HIGHER%20than%20%60donchian_break_20%60%27s%20with%20far%20fewer%20trades%2C%20and%20that%20comparison%20is%20the%20hypothesis%27s%20real%20test%3A%20if%20the%20compression%20filter%20improves%20nothing%2C%20the%20twin-stop-book%20idea%20is%20false%20and%20all%20we%20were%20doing%20was%20trading%20less.%20We%20expect%20it%20to%20fail%20after%20violent%20falls%2C%20where%20the%20compression%20appears%20through%20exhaustion%20and%20not%20through%20equilibrium%2C%20and%20on%201d%2C%20where%2060%20candles%20are%20two%20months%20and%20the%20width%20minimum%20arrives%20late.\nparams_json=%7B%22channel%22%3A%2220%22%2C%22compression_window%22%3A%2260%22%7D\nparams_sha256=264f2019a3cd20cd89331f91aa7b2d5665122216cfe6cf838fb9386f683357e1\ncode_text=def%20_compression_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20width%20%3D%20hh%20-%20ll%0A%20%20%20%20min_width%20%3D%20talib.MIN%28_f%28np.nan_to_num%28width%2C%20nan%3Dnp.inf%29%29%2C%2060%29%0A%20%20%20%20%23%20%60width%60%20at%20i%20already%20depends%20only%20on%20candles%20%3C%20i%3B%20talib%27s%2060-window%20ends%20at%20i.%0A%20%20%20%20compressed%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28width%29%20%7C%20np.isnan%28min_width%29%20%7C%20np.isinf%28min_width%29%29%0A%20%20%20%20np.less_equal%28width%2C%20min_width%2C%20out%3Dcompressed%2C%20where%3Dok%29%0A%20%20%20%20return%20_hold%28compressed%20%26%20_gt%28c%2C%20hh%29%2C%20compressed%20%26%20_lt%28c%2C%20ll%29%29%0A\ncode_sha256=67f9c5ff60511c11b25802fdba57cc7bda2334c89f35c5592541bacb7e0a266d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":73,"row_hash":"6def35f71fe745b921d241f7833829c987fd37c0b24dd8e45bb7236b56396ff6","body":"wavelab-journal-chain\nv=3\nseq=73\nprev=b51bf221dc559ff5360ee07d5db3de16d87b0b5c32860622f5e44cf70e65e4f1\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.donchian_55_exit_20\nprereg_seq=2\nfamily=structure\ntitle=Donchian%2055%20entry%2C%20exit%20flat%20at%2020\nrationale=This%20is%20not%20the%20same%20hypothesis%20as%20the%2020%20channel%20with%20a%20different%20number%2C%20and%20that%20is%20why%20it%20is%20registered%20separately%3A%20the%20claim%20here%20is%20not%20about%20the%20entry%20level%20but%20about%20the%20ASYMMETRY%20between%20entering%20and%20exiting.%20Entry%20happens%20only%20on%20the%2055-candle%20break%2C%20the%20one%20that%20requires%20an%20imbalance%20that%20has%20already%20absorbed%20the%20whole%20quarter%27s%20liquidity%2C%20and%20the%20exit%20uses%20a%20shorter%2020%20channel%20and%20goes%20FLAT%2C%20with%20no%20reversal.%20The%20bet%20is%20that%20the%20participant%20who%20triggers%20the%20cascade%20%28leveraged%20liquidations%2C%20treasury%20rebalancing%29%20takes%20weeks%20to%20exhaust%20itself%2C%20while%20its%20disappearance%20shows%20up%20within%20days%3B%20exiting%20flat%20instead%20of%20flipping%20avoids%20paying%20the%20wrong%20side%20of%20a%20consolidation.\nprior=We%20expect%20a%20positive%20edge%20and%20FEWER%20trades%20than%20%60donchian_break_20%60%2C%20with%20a%20smaller%20maximum%20cumulative%20loss%20thanks%20to%20the%20flat%20state.%20We%20expect%20it%20to%20fail%20on%20low%20timeframes%20%2815m%2C%201h%29%2C%20where%2055%20candles%20are%20a%20few%20hours%20and%20the%20break%20identifies%20no%20structural%20flow%20at%20all%3A%20there%20the%20result%20should%20be%20indistinguishable%20from%20zero%2C%20or%20negative%20after%20costs.%20If%20the%20edge%20were%20equal%20or%20greater%20on%2015m%20than%20on%201d%2C%20the%20mechanical%20explanation%20above%20is%20false.\nparams_json=%7B%22entry%22%3A%2255%22%2C%22exit%22%3A%2220%22%2C%22mode%22%3A%22long%2Fshort%20with%20a%20flat%20state%22%7D\nparams_sha256=f97bb754cdd8a2da606345ca74bb65fd72097ca93242c4b278f326ab6b238966\ncode_text=def%20_donchian_55_exit_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20hi55%2C%20lo55%20%3D%20_prev_max%28s.high%2C%2055%29%2C%20_prev_min%28s.low%2C%2055%29%0A%20%20%20%20hi20%2C%20lo20%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%23%20Explicit%20loop%3A%20the%20state%20at%20i%20depends%20on%20the%20state%20at%20i-1%20and%20on%20data%20from%20i.%20Nothing%0A%20%20%20%20%20%20%20%20%23%20else.%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20np.isnan%28hi55%5Bi%5D%29%20and%20c%5Bi%5D%20%3E%20hi55%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20not%20np.isnan%28lo55%5Bi%5D%29%20and%20c%5Bi%5D%20%3C%20lo55%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20elif%20pos%20%3D%3D%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20np.isnan%28lo20%5Bi%5D%29%20and%20c%5Bi%5D%20%3C%20lo20%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%20%20%20%20%20%20%20%20%20%20%23%20exit%20and%20stay%20flat%3A%20re-entering%20on%20the%20same%20close%20is%20ambiguous%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20np.isnan%28hi20%5Bi%5D%29%20and%20c%5Bi%5D%20%3E%20hi20%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A\ncode_sha256=759e448473ba63c7766851977ea49083e9f873bb3d7476f1c0bb211d466f0143\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":74,"row_hash":"d9a51d9ced64f6ca3be817de51c71ea3245251c782b542a5477d0f643ad16c2c","body":"wavelab-journal-chain\nv=3\nseq=74\nprev=6def35f71fe745b921d241f7833829c987fd37c0b24dd8e45bb7236b56396ff6\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.donchian_break_20\nprereg_seq=2\nfamily=structure\ntitle=Flip%20sides%20on%20every%20Donchian%2020%20break\nrationale=The%20high%20of%20the%20previous%2020%20candles%20is%20the%20level%20where%20the%20largest%20quantity%20of%20resting%20orders%20converges%3A%20the%20shorts%27%20stops%2C%20stop%20entries%20from%20those%20waiting%20for%20confirmation%2C%20and%20hedges%20from%20option%20sellers.%20When%20price%20takes%20it%20out%2C%20those%20orders%20execute%20as%20market%20orders%20and%20consume%20the%20book%20in%20the%20same%20direction%2C%20which%20pushes%20price%20further%20and%20forces%20more%20closing.%20If%20that%20cascade%20exists%20in%20BTC%2C%20a%20plain%20stop-and-reverse%20on%20the%20channel%20should%20capture%20it%20with%20no%20further%20machinery.\nprior=We%20expect%20a%20positive%20edge%20concentrated%20in%20a%20few%20right-tail%20episodes%20%28a%20handful%20of%20trades%20supply%20almost%20the%20entire%20result%29%2C%20with%20a%20LOW%20hit%20rate%2C%20below%2045%25.%20We%20expect%20it%20to%20fail%20%E2%80%94a%20negative%20edge%2C%20not%20a%20nil%20one%E2%80%94%20in%20prolonged%20ranges%2C%20where%20every%20breakout%20reverses%20and%20the%20system%20pays%20the%20spread%20in%20both%20directions.%20If%20it%20comes%20out%20with%20a%20positive%20edge%20AND%20a%20high%20hit%20rate%2C%20the%20hypothesis%20is%20wrong%3A%20that%20would%20point%20to%20a%20data%20or%20execution%20fault%2C%20not%20to%20a%20structural%20effect.\nparams_json=%7B%22channel%22%3A%2220%22%2C%22mode%22%3A%22stop-and-reverse%22%7D\nparams_sha256=8d1dd9b17a9ac5d91606b11ee84de5da03a51335bb77475cb59eb4b16bf8b392\ncode_text=def%20_donchian_break_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20_prev_max%28s.high%2C%2020%29%29%2C%20_lt%28c%2C%20_prev_min%28s.low%2C%2020%29%29%29%0A\ncode_sha256=12b8801ce81611237150d5076e64d75cbedef11781d3fe1273d93e29448762e3\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":75,"row_hash":"2f3b39526730538828fc093cf1b6e330921228f59fd1be06007b405554b70239","body":"wavelab-journal-chain\nv=3\nseq=75\nprev=d9a51d9ced64f6ca3be817de51c71ea3245251c782b542a5477d0f643ad16c2c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.range_fade_swing\nprereg_seq=2\nfamily=structure\ntitle=Fade%20the%20swing%20extremes%20in%20mixed%20structure\nrationale=Deliberately%20contradicts%20%60bos_swing%60%20on%20the%20same%20level%2C%20and%20only%20activates%20where%20that%20one%20should%20be%20weakest%3A%20when%20the%20sequence%20of%20pivots%20is%20mixed%20and%20there%20is%20no%20directional%20structure.%20The%20reasoning%20is%20about%20inventory.%20With%20no%20trend%20to%20absorb%2C%20whoever%20provides%20liquidity%20at%20the%20swing%20extremes%20runs%20no%20risk%20of%20ending%20up%20on%20the%20wrong%20side%20of%20a%20sustained%20move%2C%20so%20they%20can%20defend%20those%20levels%20with%20size%3B%20the%20break%20finds%20no%20continuation%20and%20price%20reverts%20towards%20the%20middle%20of%20the%20range.%20The%20strong%20claim%20is%20not%20%27ranges%20revert%27%2C%20but%20that%20the%20SAME%20signal%20changes%20sign%20according%20to%20the%20structural%20state.\nprior=We%20expect%20a%20positive%20edge%20ONLY%20under%20the%20mixed-structure%20filter%2C%20and%20we%20explicitly%20expect%20the%20same%20rule%20without%20that%20filter%20to%20give%20a%20negative%20edge.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20that%20unfiltered%20rule%20was%20not%20registered%2C%20so%20this%20hypothesis%27s%20central%20falsification%20criterion%20could%20not%20be%20run%3B%20it%20has%20been%20registered%20as%20%60structure.swing_fade_unfiltered%60%20and%20that%20is%20what%20it%20must%20be%20measured%20against.%20A%205-candle%20fractal%20leaves%20the%20level%20very%20close%20to%20price%2C%20so%20we%20expect%20MANY%20trades%20and%20for%20costs%20to%20eat%20a%20small%20gross%20edge%3A%20if%20the%20net%20edge%20does%20not%20survive%20realistic%20commissions%20and%20spread%2C%20the%20hypothesis%20is%20refuted%20even%20if%20the%20gross%20one%20is%20positive%2C%20and%20it%20is%20not%20legitimate%20to%20rescue%20it%20by%20raising%20k.%20We%20expect%20it%20to%20fail%20at%20regime%20turns%2C%20where%20the%20structure%20looks%20mixed%20exactly%20while%20the%20new%20trend%20is%20being%20built%3A%20there%20the%20fades%20execute%20against%20the%20initial%20impulse%20and%20should%20be%20the%20worst%20trades%20in%20the%20whole%20family.%20If%20the%20result%20is%20positive%20both%20here%20and%20in%20%60bos_swing%60%20without%20the%20regime%20separating%20them%2C%20the%20filter%20is%20doing%20nothing%20and%20both%20conclusions%20must%20be%20discarded.\nparams_json=%7B%22filter%22%3A%22mixed%20structure%22%2C%22fractal_k%22%3A%222%22%2C%22horizon%22%3A%2210%22%7D\nparams_sha256=4cce6b51fb20ba2f09362f481ec1d74bc972a0893150ab67f0732295fd93c637\ncode_text=def%20_range_fade_swing%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20_%2C%20pl1%2C%20_%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20mixed%20%3D%20_structure_state%28s%29%20%3D%3D%200%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20neither%20HH%2BHL%20nor%20LH%2BLL%0A%20%20%20%20%23%20%60_fresh%60%3A%20the%20event%20is%20the%20TOUCH%20of%20the%20extreme%2C%20not%20the%20state%20of%20being%20beyond%20it.%0A%20%20%20%20short_ev%20%3D%20mixed%20%26%20_fresh%28_gt%28c%2C%20ph1%29%29%0A%20%20%20%20long_ev%20%3D%20mixed%20%26%20_fresh%28_lt%28c%2C%20pl1%29%29%0A%20%20%20%20return%20_hold_n%28long_ev%2C%20short_ev%29%0A\ncode_sha256=b2cc29502741c2dd04ce7a75c8ec5fee918b65c444944e52b9c0f4b4e31b81f5\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":76,"row_hash":"b20984530da14b054e9e0ab9c0bbe174d1e78ecf9ee68cbb5cd85fdefb514008","body":"wavelab-journal-chain\nv=3\nseq=76\nprev=2f3b39526730538828fc093cf1b6e330921228f59fd1be06007b405554b70239\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.retest_hold\nprereg_seq=2\nfamily=structure\ntitle=Trade%20the%20break%20only%20after%20its%20retest\nrationale=The%20broken%20level%20changes%20role%2C%20and%20there%20is%20a%20concrete%20flow%20reason%20for%20it%3A%20those%20who%20sold%20at%20resistance%20and%20got%20trapped%20try%20to%20get%20out%20at%20their%20entry%20point%20when%20price%20comes%20back%2C%20and%20those%20who%20missed%20the%20break%20have%20their%20reference%20there%20to%20buy%20without%20chasing.%20Both%20act%20in%20the%20same%20place%20and%20in%20the%20same%20direction.%20The%20trading%20condition%20is%20demanding%20on%20purpose%3A%20it%20has%20to%20break%2C%20COME%20BACK%20and%20touch%20the%20level%20within%2010%20candles%2C%20and%20close%20on%20the%20right%20side%20again.%20If%20only%20the%20break%20mattered%2C%20this%20would%20add%20nothing%20over%20hypothesis%201.\nprior=We%20expect%20FEWER%20trades%20than%20the%20plain%20break%20and%20a%20better%20result%20per%20trade%2C%20because%20the%20retest%20filters%20out%20the%20breaks%20with%20no%20buyer%20behind%20them.%20We%20expect%20it%20to%20fail%20on%20the%20most%20violent%20breaks%20%E2%80%94precisely%20the%20ones%20that%20contribute%20most%20to%20hypothesis%201%E2%80%94%20because%20those%20never%20come%20back%20to%20touch%20the%20level%20and%20the%20filter%20discards%20them%3A%20if%20the%20breakout%20effect%20is%20pure%20right%20tail%2C%20this%20filter%20should%20DESTROY%20the%20edge%20rather%20than%20improve%20it.%20That%20is%20the%20test%20that%20matters%2C%20and%20both%20conclusions%20are%20publishable.\nparams_json=%7B%22channel%22%3A%2220%22%2C%22horizon%22%3A%2210%22%2C%22retest_window%22%3A%2210%22%7D\nparams_sha256=086a8e41471e53c8eef6510b7bc59d7177a6790912dc6c257a0a1f1b394dd5a1\ncode_text=def%20_retest_hold%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%2C%20hi%2C%20lo%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20ev_up%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%20%20%20%20ev_dn%20%3D%20np.zeros%28n%2C%20dtype%3Dbool%29%0A%0A%20%20%20%20lvl_u%20%3D%20np.nan%0A%20%20%20%20ttl_u%20%3D%200%0A%20%20%20%20touched_u%20%3D%20False%0A%20%20%20%20lvl_d%20%3D%20np.nan%0A%20%20%20%20ttl_d%20%3D%200%0A%20%20%20%20touched_d%20%3D%20False%0A%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%23%20Everything%20read%20here%20is%20from%20candle%20i%20or%20from%20state%20accumulated%20over%20earlier%20candles.%0A%20%20%20%20%20%20%20%20brk_u%20%3D%20%28not%20np.isnan%28hh%5Bi%5D%29%29%20and%20c%5Bi%5D%20%3E%20hh%5Bi%5D%0A%20%20%20%20%20%20%20%20brk_d%20%3D%20%28not%20np.isnan%28ll%5Bi%5D%29%29%20and%20c%5Bi%5D%20%3C%20ll%5Bi%5D%0A%0A%20%20%20%20%20%20%20%20if%20brk_u%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20lvl_u%2C%20ttl_u%2C%20touched_u%20%3D%20hh%5Bi%5D%2C%20_HOLD%2C%20False%0A%20%20%20%20%20%20%20%20elif%20ttl_u%20%3E%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ttl_u%20-%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20lo%5Bi%5D%20%3C%3D%20lvl_u%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20touched_u%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20touched_u%20and%20c%5Bi%5D%20%3E%20lvl_u%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ev_up%5Bi%5D%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ttl_u%20%3D%200%0A%0A%20%20%20%20%20%20%20%20if%20brk_d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20lvl_d%2C%20ttl_d%2C%20touched_d%20%3D%20ll%5Bi%5D%2C%20_HOLD%2C%20False%0A%20%20%20%20%20%20%20%20elif%20ttl_d%20%3E%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ttl_d%20-%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20hi%5Bi%5D%20%3E%3D%20lvl_d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20touched_d%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20touched_d%20and%20c%5Bi%5D%20%3C%20lvl_d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ev_dn%5Bi%5D%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ttl_d%20%3D%200%0A%0A%20%20%20%20return%20_hold_n%28ev_up%2C%20ev_dn%29%0A\ncode_sha256=3f169297f83084be19b328bd57ae5943890006c317c6ae19908bde7b0dfc9a9d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":77,"row_hash":"86f5ef31100ac2de73dfe593dda098851974be9d59c46daa62aabb07094f8467","body":"wavelab-journal-chain\nv=3\nseq=77\nprev=b20984530da14b054e9e0ab9c0bbe174d1e78ecf9ee68cbb5cd85fdefb514008\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.sweep_reversal_20\nprereg_seq=2\nfamily=structure\ntitle=Fade%20the%20break%20that%20closes%20back%20inside\nrationale=The%20opposite%20face%20of%20%60donchian_break_20%60%2C%20on%20the%20SAME%20level%20and%20on%20purpose.%20If%20liquidity%20is%20piled%20up%20just%20behind%20the%2020-candle%20extreme%2C%20there%20is%20a%20participant%20with%20a%20direct%20incentive%20to%20go%20and%20get%20it%3A%20whoever%20needs%20to%20execute%20size%20and%20can%20only%20do%20so%20against%20everybody%20else%27s%20stops.%20The%20observable%20signature%20is%20a%20candle%20that%20pierces%20the%20level%20on%20the%20high%20but%20closes%20INSIDE%20the%20range%3A%20the%20stops%20were%20filled%2C%20there%20was%20no%20continuation%20behind%20them%20and%20price%20comes%20back.%20Closing%20inside%20is%20the%20key%20condition%2C%20because%20it%20separates%20absorption%20from%20a%20genuine%20break.\nprior=We%20expect%20a%20short-lived%20positive%20edge%20%E2%80%94concentrated%20in%20the%20first%20candles%20of%20the%2010-candle%20horizon%E2%80%94%20with%20a%20HIGH%20hit%20rate%20and%20a%20small%20average%20gain%2C%20the%20inverse%20profile%20to%20the%20breakout%27s.%20We%20expect%20it%20to%20fail%20in%20strong%20trends%2C%20where%20the%20false%20break%20is%20only%20a%20pause%20before%20continuing%2C%20and%20to%20fail%20on%201d%2C%20where%20a%20daily%20candle%20bundles%20too%20many%20events%20for%20the%20close%20to%20mean%20%27absorption%27.%20If%20both%20this%20hypothesis%20and%20%60donchian_break_20%60%20come%20out%20positive%20over%20the%20same%20period%20and%20regime%2C%20the%20estimator%20should%20be%20suspected%20before%20either%20of%20them%20is%20believed.\nparams_json=%7B%22channel%22%3A%2220%22%2C%22horizon%22%3A%2210%22%7D\nparams_sha256=68533be3b2d8fd9144a6e2d1bd243e4d9028ac73cb011dc1665b998c7428142f\ncode_text=def%20_sweep_reversal_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%2C%20hi%2C%20lo%20%3D%20_f%28s.close%29%2C%20_f%28s.high%29%2C%20_f%28s.low%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20short_ev%20%3D%20_gt%28hi%2C%20hh%29%20%26%20_lt%28c%2C%20hh%29%20%20%20%20%23%20pierces%20the%20previous%20high%20and%20closes%20below%20it%0A%20%20%20%20long_ev%20%3D%20_lt%28lo%2C%20ll%29%20%26%20_gt%28c%2C%20ll%29%20%20%20%20%20%23%20pierces%20the%20previous%20low%20and%20closes%20above%20it%0A%20%20%20%20return%20_hold_n%28long_ev%2C%20short_ev%29%0A\ncode_sha256=d9d2ab1506d29c8e592700de84f98d33099fefcd7de12c615b087c173248c11a\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":78,"row_hash":"441d7543ecdc6b5812399338da0790dd30a7e4d0ed2ba302f0a5d40a9a279a0e","body":"wavelab-journal-chain\nv=3\nseq=78\nprev=86f5ef31100ac2de73dfe593dda098851974be9d59c46daa62aabb07094f8467\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.swing_fade_unfiltered\nprereg_seq=2\nfamily=structure\ntitle=Fade%20the%20swing%20extremes%20in%20any%20structure\nrationale=Unconditional%20control%20for%20%60range_fade_swing%60%3A%20fading%20the%20touch%20of%20the%20last%20confirmed%20pivot%20in%20ALL%20structural%20states%2C%20not%20only%20when%20the%20sequence%20is%20mixed.%20It%20claims%20no%20mechanism%20of%20its%20own%20%E2%80%94on%20the%20contrary%2C%20the%20inventory%20mechanism%20that%20justifies%20the%20fade%20only%20holds%20when%20there%20is%20no%20trend%20to%20absorb%E2%80%94%20and%20it%20is%20here%20because%20a%20conditional%20claim%20is%20only%20testable%20if%20the%20unconditional%20case%20is%20measured%20too.%20Without%20this%20control%2C%20a%20positive%20result%20for%20%60range_fade_swing%60%20would%20not%20distinguish%20%27the%20structural%20filter%20contributes%27%20from%20%27fading%20swing%20extremes%20always%20wins%20and%20the%20filter%20is%20decorative%27.\nprior=We%20expect%20a%20NEGATIVE%20edge%2C%20and%20we%20are%20committed%20to%20that%20sign%20in%20advance%3A%20without%20the%20filter%2C%20the%20same%20rule%20goes%20short%20against%20every%20breakout%20of%20a%20live%20trend%2C%20which%20is%20the%20declared%20failure%20mode%20of%20all%20fading.%20The%20joint%20reading%20is%20what%20matters%20and%20it%20is%20fixed%20now%3A%20if%20this%20one%20comes%20out%20negative%20and%20%60range_fade_swing%60%20positive%2C%20the%20structural%20state%20does%20separate%20regimes%20and%20the%20conditional%20claim%20holds%3B%20if%20both%20come%20out%20similar%2C%20the%20filter%20does%20nothing%20and%20both%20must%20be%20discarded%3B%20if%20this%20one%20comes%20out%20POSITIVE%2C%20what%20we%20have%20is%20generic%20mean%20reversion%20at%20the%20swing%20extremes%20and%20%60range_fade_swing%60%27s%20inventory%20argument%20is%20false%20even%20if%20its%20number%20is%20good.\nparams_json=%7B%22filter%22%3A%22none%22%2C%22fractal_k%22%3A%222%22%2C%22horizon%22%3A%2210%22%7D\nparams_sha256=4c9282f55b1b72918b7887fbe53fd72d3422cde68db37f9841c329dc7885cc07\ncode_text=def%20_swing_fade_unfiltered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%20%3D%20_f%28s.close%29%0A%20%20%20%20ph1%2C%20_%2C%20pl1%2C%20_%20%3D%20_pivot_levels%28s%29%0A%20%20%20%20%23%20Identical%20to%20%60range_fade_swing%60%20except%20for%20the%20absence%20of%20the%20%60mixed%60%20filter.%0A%20%20%20%20return%20_hold_n%28_fresh%28_lt%28c%2C%20pl1%29%29%2C%20_fresh%28_gt%28c%2C%20ph1%29%29%29%0A\ncode_sha256=4b528c2ee0236e42e70e5331f89c6d3e114fbb84539caaa91fd67fcac106ebdb\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":79,"row_hash":"16c85c0736a48755c190d0662df925ca5477392ef54ccc75e44a823de9071b9c","body":"wavelab-journal-chain\nv=3\nseq=79\nprev=441d7543ecdc6b5812399338da0790dd30a7e4d0ed2ba302f0a5d40a9a279a0e\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.swing_trend_state\nprereg_seq=2\nfamily=structure\ntitle=Long%20on%20higher%20highs%2C%20flat%20when%20mixed\nrationale=The%20family%27s%20minimal%20hypothesis%2C%20and%20deliberately%20the%20dullest%3A%20no%20event%20and%20no%20breakout%2C%20just%20the%20classic%20Dow%20classification.%20Long%20while%20the%20last%20two%20confirmed%20pivots%20are%20a%20higher%20high%20AND%20a%20higher%20low%2C%20short%20in%20the%20mirror%20case%2C%20and%20flat%20when%20the%20structure%20is%20mixed.%20It%20serves%20as%20the%20BENCHMARK%3A%20if%20the%20event%20hypotheses%20do%20not%20beat%20this%2C%20what%20they%20are%20capturing%20is%20the%20underlying%20trend%20and%20not%20the%20liquidity%20mechanism%20they%20claim%20to%20exploit.%20Being%20flat%20on%20mixed%20structure%20is%20the%20part%20that%20contributes%2C%20because%20that%20is%20where%20trend%20following%20loses%20money.\nprior=We%20expect%20a%20small%20positive%20edge%2C%20dominated%20by%20BTC%27s%20historical%20bullish%20bias%2C%20with%20a%20substantial%20amount%20of%20time%20out%20of%20the%20market%20%28more%20than%2025%25%20of%20candles%29.%20We%20expect%20the%20short%20side%20to%20have%20a%20negative%20or%20nil%20edge%20on%20its%20own%3A%20if%20the%20shorts%20contribute%20as%20much%20as%20the%20longs%2C%20the%20data%20period%20should%20be%20treated%20with%20suspicion%20rather%20than%20celebrated.%20It%20is%20refuted%20as%20a%20useful%20benchmark%20if%20its%20result%20is%20indistinguishable%20from%20buying%20and%20sitting%20still.\nparams_json=%7B%22fractal_k%22%3A%222%22%7D\nparams_sha256=a1c30d68b696e6329b19cd2565a07f674ad23d2bea841bef4fe007a7ef9e54ef\ncode_text=def%20_swing_trend_state%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20return%20_structure_state%28s%29%0A\ncode_sha256=8afaa70ae54fa04cda08c5ad4998ce0d3e1811d54279d92c9d69ce0989fe71fe\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":80,"row_hash":"1a8e156b65c7ebdc21886358b830016e0161ed78385fa87e9542dc9e4d7ec7be","body":"wavelab-journal-chain\nv=3\nseq=80\nprev=16c85c0736a48755c190d0662df925ca5477392ef54ccc75e44a823de9071b9c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=structure.volume_confirmed_break\nprereg_seq=2\nfamily=structure\ntitle=Only%20the%20break%20that%20volume%20confirms\nrationale=If%20the%20breakout%20mechanism%20is%20the%20cascading%20execution%20of%20accumulated%20orders%2C%20then%20it%20has%20a%20compulsory%20fingerprint%3A%20volume.%20A%20break%20on%20volume%20below%20its%2020-period%20average%20means%20there%20was%20nobody%20waiting%20at%20that%20level%2C%20that%20price%20got%20there%20by%20drift%20and%20not%20by%20execution%2C%20and%20that%20there%20is%20therefore%20no%20forced%20flow%20to%20continue%20the%20move.%20Volume%20is%20not%20used%20here%20as%20an%20indicator%20but%20as%20a%20VERIFICATION%20of%20the%20mechanism%20that%20hypotheses%201%20and%208%20take%20for%20granted.\nprior=We%20expect%20a%20positive%20edge%20and%2C%20above%20all%2C%20an%20edge%20per%20trade%20GREATER%20than%20unfiltered%20%60donchian_break_20%60%27s.%20If%20the%20volume%20filter%20improves%20nothing%2C%20the%20order-cascade%20explanation%20is%20seriously%20weakened%20for%20every%20breakout%20hypothesis%20in%20this%20family%2C%20and%20that%20is%20a%20more%20valuable%20result%20than%20the%20hypothesis%20itself.%20We%20expect%20it%20to%20fail%20on%201d%2C%20where%20BTC%27s%20daily%20volume%20is%20dominated%20by%20the%20weekly%20cycle%20and%20by%20the%20split%20across%20exchanges%2C%20not%20by%20the%20breakout%20event.\nparams_json=%7B%22channel%22%3A%2220%22%2C%22volume_average%22%3A%2220%22%7D\nparams_sha256=f0d9a92a7e26c47e9df17c867dc6a36b6a0a49e37b72bb8c21c184c95606d70d\ncode_text=def%20_volume_confirmed_break%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20n%20%3D%20len%28s%29%0A%20%20%20%20if%20n%20%3C%20_MIN_BARS%3A%0A%20%20%20%20%20%20%20%20return%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20c%2C%20v%20%3D%20_f%28s.close%29%2C%20_f%28s.volume%29%0A%20%20%20%20hh%2C%20ll%20%3D%20_prev_max%28s.high%2C%2020%29%2C%20_prev_min%28s.low%2C%2020%29%0A%20%20%20%20v_avg%20%3D%20talib.SMA%28v%2C%2020%29%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20includes%20candle%20i%3A%20a%20datum%20available%20at%20i%0A%20%20%20%20strong%20%3D%20_gt%28v%2C%20v_avg%29%0A%20%20%20%20return%20_hold%28_gt%28c%2C%20hh%29%20%26%20strong%2C%20_lt%28c%2C%20ll%29%20%26%20strong%29%0A\ncode_sha256=f88d24eb7846d141e8886de8cbccde581a21241e87ef60a12a0c09a89d5f89e9\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fstructure.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":81,"row_hash":"9be8d8798868074bc9edd690af0ec5d8ad32bfad1f4448e74aea59df907b74cf","body":"wavelab-journal-chain\nv=3\nseq=81\nprev=1a8e156b65c7ebdc21886358b830016e0161ed78385fa87e9542dc9e4d7ec7be\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.adx_dmi_14\nprereg_seq=2\nfamily=trend\ntitle=Trade%20direction%20only%20above%20ADX%2025\nrationale=Separates%20two%20questions%20that%20moving%20averages%20run%20together%3A%20is%20there%20a%20trend%3F%20%28ADX%29%20and%20in%20which%20direction%3F%20%28DMI%29.%20The%20proposed%20mechanism%20is%20that%20persistence%20only%20appears%20once%20the%20dispersion%20of%20opinion%20has%20already%20resolved%3A%20if%20most%20of%20the%20aggressive%20volume%20arrives%20on%20the%20same%20side%2C%20the%20market%20maker%20accumulates%20directional%20inventory%20and%20hedges%20IN%20THE%20SAME%20DIRECTION%2C%20amplifying%20the%20very%20move%20that%20is%20hurting%20him.%20Below%20ADX%2025%20there%20are%20two%20camps%20of%20similar%20size%20and%20the%20flow%20cancels%20out%20without%20leaving%20any%20drift.\nprior=We%20expect%20the%20edge%20to%20come%20from%20AVOIDING%20the%20range%2C%20not%20from%20getting%20the%20direction%20right%20more%20often.%20Explicit%20falsifiable%20test%3A%20per-bar%20performance%20INSIDE%20the%20filter%20must%20beat%20that%20of%20the%20bars%20the%20filter%20discards%3B%20if%20it%20does%20not%2C%20the%20ADX%20carries%20no%20information%20and%20the%20hypothesis%20dies%20even%20if%20the%20overall%20result%20is%20positive.%20We%20expect%20it%20to%20enter%20late%20and%20give%20up%20a%20large%20part%20of%20the%20start%20of%20every%20trend%2C%20because%20the%20ADX%20needs%20a%20move%20that%20has%20already%20happened%20in%20order%20to%20climb%20above%2025.\nparams_json=%7B%22adx_threshold%22%3A%2225%22%2C%22period%22%3A%2214%22%7D\nparams_sha256=d625470646159da3ca32a5d3f5eb76d329a65a9394b60c0f9138c26b243dfbda\ncode_text=def%20_adx_dmi_14%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20adx%20%3D%20talib.ADX%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20pdi%20%3D%20talib.PLUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20mdi%20%3D%20talib.MINUS_DI%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_ok%28adx%2C%20pdi%2C%20mdi%29%0A%20%20%20%20strong%20%3D%20ok%20%26%20%28adx%20%3E%3D%2025.0%29%0A%20%20%20%20out%5Bstrong%20%26%20%28pdi%20%3E%20mdi%29%5D%20%3D%201%0A%20%20%20%20out%5Bstrong%20%26%20%28mdi%20%3E%20pdi%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=ec086afe67ddcaee81d0f569b5c90d295352e841f9880ad70c3acc4c0095e64d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":82,"row_hash":"567b87162a14b6a313c507541dc0739253c8319ab258bac509b260a707c6ef54","body":"wavelab-journal-chain\nv=3\nseq=82\nprev=9be8d8798868074bc9edd690af0ec5d8ad32bfad1f4448e74aea59df907b74cf\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.aroon_25\nprereg_seq=2\nfamily=trend\ntitle=Time%20since%20the%20last%20high%2C%20not%20price\nrationale=Aroon%20measures%20not%20price%20but%20TIME%20since%20the%20last%20extreme%2C%20and%20that%20is%20a%20different%20variable%20from%20everything%20else%20in%20this%20family.%20The%20thesis%20is%20that%20a%20trend%20is%20a%20renewal%20process%3A%20as%20long%20as%20new%20highs%20keep%20appearing%20frequently%2C%20there%20are%20buyers%20willing%20to%20pay%20prices%20that%20have%20never%20been%20paid%2C%20which%20only%20happens%20if%20information%20is%20still%20being%20incorporated.%20When%20the%20rate%20of%20new%20extremes%20falls%2C%20the%20flow%20has%20exhausted%20itself%20even%20if%20price%20has%20not%20turned%20yet.\nprior=We%20expect%20it%20to%20exit%20BEFORE%20the%20moving%20averages%20at%20tops%20%E2%80%94%20giving%20back%20less%20profit%20on%20the%20turn%20%E2%80%94%20and%20to%20pay%20for%20that%20insurance%20with%20clearly%20worse%20entries.%20Falsifiable%3A%20if%20its%20pattern%20of%20results%20is%20indistinguishable%20from%20trend.ema_cross_21_55%27s%20across%20every%20regime%2C%20the%20time%20information%20is%20redundant%20with%20the%20price%20information%20and%20the%20hypothesis%20adds%20nothing%20new%20to%20the%20family.%20We%20expect%20a%20nil%20or%20negative%20edge%20in%20a%20range%20with%20alternating%20extremes%2C%20where%20both%20arms%20stay%20high%20and%20the%20signal%20switches%20off.\nparams_json=%7B%22high_threshold%22%3A%2270%22%2C%22low_threshold%22%3A%2230%22%2C%22period%22%3A%2225%22%7D\nparams_sha256=a60d11031d90e9d70d041a56b6f3ed8f3677ad426cbacee43b3280a4b69f80e3\ncode_text=def%20_aroon_25%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%0A%20%20%20%20out%20%3D%20np.zeros%28h.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20down%2C%20up%20%3D%20talib.AROON%28h%2C%20l%2C%2025%29%0A%20%20%20%20ok%20%3D%20_ok%28up%2C%20down%29%0A%20%20%20%20out%5Bok%20%26%20%28up%20%3E%2070.0%29%20%26%20%28down%20%3C%2030.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28down%20%3E%2070.0%29%20%26%20%28up%20%3C%2030.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=985e111f0d710bc432776db0f67d043b441bd5677674a90a617667d8c4b70d4c\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":83,"row_hash":"3136739db091a64383b53145b65e6b683a7a20a6282a37c265de7e39f8518e9d","body":"wavelab-journal-chain\nv=3\nseq=83\nprev=567b87162a14b6a313c507541dc0739253c8319ab258bac509b260a707c6ef54\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.donchian_turtle_55_20\nprereg_seq=2\nfamily=trend\ntitle=Break%20the%2055-bar%20high%2C%20exit%20at%2020\nrationale=Above%20a%2055-bar%20high%2C%20short%20sellers%27%20stops%20and%20breakout%20buy%20orders%20pile%20up.%20Their%20execution%20is%20a%20mechanical%20demand%20shock%2C%20insensitive%20to%20price%2C%20and%20the%20book%20is%20thin%20right%20there%20precisely%20because%20nobody%20has%20been%20willing%20to%20sell%20at%20that%20level%20yet%3B%20every%20stop%20that%20fills%20pushes%20into%20the%20next%20one.%20The%2055%2F20%20pair%20is%20Turtle%20System%202%20published%20as%20a%20unit%2C%20not%20a%20grid%3A%20the%20shorter%20exit%20exists%20so%20that%20the%20position%20dies%20before%20the%20capital%20does%2C%20and%20separating%20the%20two%20numbers%20would%20be%20a%20different%20hypothesis.\nprior=We%20expect%20a%20very%20asymmetric%20distribution%3A%20mostly%20small%20losing%20trades%20and%20a%20right%20tail%20that%20carries%20the%20whole%20result%20%E2%80%94%20that%20is%2C%20a%20positive%20MEAN%20with%20a%20negative%20MEDIAN.%20If%20the%20median%20comes%20out%20positive%2C%20what%20is%20at%20work%20is%20not%20the%20stop%20cascade%20but%20something%20else%2C%20and%20the%20declared%20mechanism%20is%20refuted.%20We%20expect%20clear%20failure%20in%20high-volatility%20markets%20without%20direction%2C%20where%20the%20false%20breakout%20is%20the%20norm.\nparams_json=%7B%22entry%22%3A%2255%22%2C%22exit%22%3A%2220%22%7D\nparams_sha256=2c69d6aa63125850806122f53f6e273105d41678d44e63a0112f3bf4a001b99f\ncode_text=def%20_donchian_turtle_55_20%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20n%20%3D%20c.size%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20%23%20%2B1%20bar%20of%20lag%3A%20channel%20of%20the%2055%20%28or%2020%29%20PRECEDING%20bars%2C%20excluding%20the%20current%20one.%0A%20%20%20%20hh_entry%20%3D%20_lag%28talib.MAX%28h%2C%2055%29%2C%201%29%0A%20%20%20%20ll_entry%20%3D%20_lag%28talib.MIN%28l%2C%2055%29%2C%201%29%0A%20%20%20%20hh_exit%20%3D%20_lag%28talib.MAX%28h%2C%2020%29%2C%201%29%0A%20%20%20%20ll_exit%20%3D%20_lag%28talib.MIN%28l%2C%2020%29%2C%201%29%0A%20%20%20%20ok%20%3D%20_ok%28hh_entry%2C%20ll_entry%2C%20hh_exit%2C%20ll_exit%2C%20c%29%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20if%20not%20ok%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20if%20pos%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3E%20hh_entry%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20c%5Bi%5D%20%3C%20ll_entry%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20elif%20pos%20%3D%3D%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3C%20ll_exit%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%20if%20c%5Bi%5D%20%3C%20ll_entry%5Bi%5D%20else%200%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3E%20hh_exit%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%20if%20c%5Bi%5D%20%3E%20hh_entry%5Bi%5D%20else%200%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A\ncode_sha256=9b008e72271ea7f03ecb6d1745b47feb0fabe2a3cada912df68728eb2e6d5b19\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":84,"row_hash":"3bbf463950c02a8cb20acea01d21295cb885f02f60e07ef1fffc7246899bc722","body":"wavelab-journal-chain\nv=3\nseq=84\nprev=3136739db091a64383b53145b65e6b683a7a20a6282a37c265de7e39f8518e9d\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.ema200_filter\nprereg_seq=2\nfamily=trend\ntitle=Long%20above%20the%20EMA%20200%2C%20short%20below\nrationale=The%20200%20average%20measures%20no%20physical%20property%20of%20the%20market%3A%20it%20is%20a%20public%20focal%20point%20that%20risk%20desks%2C%20the%20financial%20press%20and%20allocation%20bots%20quote%20daily.%20Its%20power%2C%20if%20it%20has%20any%2C%20is%20entirely%20reflexive%20%E2%80%94%20there%20are%20real%20mandates%20that%20cut%20exposure%20%27below%20the%20200%27%2C%20and%20that%20cut%20is%20genuine%20flow%20executed%20at%20the%20level.%20We%20register%20the%20bare%20level%20and%20not%20the%20slope%20because%20for%20an%20EMA200%20the%20slope%20is%20very%20nearly%20a%20function%20of%20the%20cross%20itself%2C%20and%20adding%20it%20would%20be%20the%20same%20trial%20run%20twice.\nprior=The%20prediction%20that%20matters%20is%20a%20cross-prediction%2C%20not%20one%20about%20profit%3A%20if%20the%20mechanism%20is%20reflexive%2C%20the%20effect%20must%20be%20LARGER%20on%201d%2C%20which%20is%20where%20the%20level%20is%20published%20and%20watched%2C%20and%20close%20to%20nil%20on%2015m%20and%201h.%20An%20edge%20equal%20to%20or%20greater%20on%2015m%20would%20falsify%20the%20explanation%20even%20if%20the%20number%20came%20out%20profitable%2C%20and%20in%20that%20case%20the%20hypothesis%20must%20be%20declared%20failed%20despite%20making%20money.%20We%20expect%20a%20nil%20or%20negative%20edge%20in%20periods%20without%20a%20secular%20trend.\nparams_json=%7B%22period%22%3A%22200%22%7D\nparams_sha256=06cf0a4cffeb46b9827fe297f47b93c1ee83a5f145f7d595e59bc5bdd9a72a63\ncode_text=def%20_ema200_filter%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20e200%20%3D%20talib.EMA%28c%2C%20200%29%0A%20%20%20%20ok%20%3D%20_ok%28c%2C%20e200%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20e200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20e200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=1f01d217c52d613c49566b0956a97d2cb61e5282e6f1347d5ea6a2da925a6aed\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=600\neffective_from_ms=1790242821226\n"} {"seq":85,"row_hash":"89d039d32e16b07c9edaa6923bc651402a7924fc32717213982e939d2cd72327","body":"wavelab-journal-chain\nv=3\nseq=85\nprev=3bbf463950c02a8cb20acea01d21295cb885f02f60e07ef1fffc7246899bc722\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.ema_cross_21_55\nprereg_seq=2\nfamily=trend\ntitle=Side%20with%20the%20faster%20of%20two%20averages\nrationale=New%20information%20is%20not%20incorporated%20within%20one%20candle%20because%20the%20large%20participant%20cannot%20execute%20within%20one%20candle%3A%20a%20mandate%20of%20any%20size%20is%20sliced%20over%20days%20so%20as%20not%20to%20move%20the%20price%20against%20itself%2C%20so%20today%27s%20buyer%20is%20also%20tomorrow%27s%20buyer.%20That%20slicing%20leaves%20positive%20autocorrelation%20in%20the%20drift%20at%20the%20scale%20of%20weeks.%20The%20EMA21%2FEMA55%20cross%20predicts%20nothing%3A%20it%20merely%20declares%20that%20the%20flow%20imbalance%20is%20still%20live%2C%20and%20it%20gets%20paid%20for%20as%20long%20as%20the%20same%20participant%20keeps%20executing.\nprior=We%20expect%20a%20positive%20edge%20in%20a%20trending%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20range%2C%20with%20the%20loss%20concentrated%20in%20a%20few%20weeks%20of%20whipsaw.%20If%20the%20edge%20were%20positive%20in%20ranges%20too%2C%20the%20slicing%20mechanism%20would%20be%20false%20and%20we%20would%20be%20measuring%20something%20else.%20Falsifiable%20cross-prediction%3A%20the%20effect%20must%20degrade%20as%20the%20timeframe%20drops%2C%20because%20sliced%20institutional%20execution%20does%20not%20live%20at%20the%2015m%20scale.\nparams_json=%7B%22fast%22%3A%2221%22%2C%22slow%22%3A%2255%22%7D\nparams_sha256=33e6e85af38473eab80c6eccd9cafd2ecc00610e418f55d2a2c5b53a24666728\ncode_text=def%20_ema_cross_21_55%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20fast%20%3D%20talib.EMA%28c%2C%2021%29%0A%20%20%20%20slow%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20ok%20%3D%20_ok%28fast%2C%20slow%29%0A%20%20%20%20out%5Bok%20%26%20%28fast%20%3E%20slow%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28fast%20%3C%20slow%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=eb6feb9c4df4fa5b42b0309ff2e54cc28d5470149cdca7c0156c189850491dfd\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":86,"row_hash":"60002a7b5db5ed4da980442e38e712e9c39a93329b351fa076bccd09659748aa","body":"wavelab-journal-chain\nv=3\nseq=86\nprev=89d039d32e16b07c9edaa6923bc651402a7924fc32717213982e939d2cd72327\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.ema_stack_21_55_200\nprereg_seq=2\nfamily=trend\ntitle=Only%20when%20all%20three%20horizons%20agree\nrationale=Each%20horizon%20belongs%20to%20a%20different%20participant%3A%20intraday%2C%20swing%20and%20allocator.%20While%20they%20disagree%2C%20whoever%20is%20positioned%20against%20the%20move%20provides%20the%20liquidity%20that%20absorbs%20whoever%20is%20positioned%20with%20it%2C%20and%20price%20reverts.%20When%20all%20three%20agree%2C%20nobody%20is%20left%20structurally%20obliged%20to%20sell%20into%20the%20advance%2C%20depth%20on%20the%20opposite%20side%20withdraws%20and%20the%20SAME%20flow%20moves%20more%20price.%20The%20hypothesis%20is%20not%20about%20moving%20averages%20but%20about%20the%20absence%20of%20a%20natural%20counterparty.\nprior=We%20expect%20far%20fewer%20bars%20in%20the%20market%20than%20trend.ema_cross_21_55%20and%20better%20performance%20PER%20BAR.%20Falsifiable%20in%20two%20ways%3A%20if%20time%20in%20market%20does%20not%20fall%20clearly%2C%20the%20agreement%20condition%20is%20filtering%20nothing%3B%20and%20if%20per-bar%20performance%20does%20not%20beat%20the%20plain%20cross%2C%20the%20%27absence%20of%20counterparty%27%20adds%20nothing.%20We%20expect%20it%20to%20go%20flat%20and%20give%20up%20the%20whole%20opening%20move%20at%20every%20regime%20change%2C%20because%20the%20EMA200%20aligns%20late.\nparams_json=%7B%22long%22%3A%22200%22%2C%22medium%22%3A%2255%22%2C%22short%22%3A%2221%22%7D\nparams_sha256=439ad7d25889a4ca56b47a2ca9ac6941225766e9f982c916413d1cb9593a19c8\ncode_text=def%20_ema_stack_21_55_200%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20e21%20%3D%20talib.EMA%28c%2C%2021%29%0A%20%20%20%20e55%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20e200%20%3D%20talib.EMA%28c%2C%20200%29%0A%20%20%20%20ok%20%3D%20_ok%28e21%2C%20e55%2C%20e200%29%0A%20%20%20%20out%5Bok%20%26%20%28e21%20%3E%20e55%29%20%26%20%28e55%20%3E%20e200%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28e21%20%3C%20e55%29%20%26%20%28e55%20%3C%20e200%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=abb84cf83c1a2ff11073604657047e932ee6cf3b51f65d3cd2650f7e0f4cb5a3\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=600\neffective_from_ms=1790242821226\n"} {"seq":87,"row_hash":"37330b645a5893800e7ab36cdb96eb75ed38cbf359a4bba7f61a6e220b1ae8f5","body":"wavelab-journal-chain\nv=3\nseq=87\nprev=60002a7b5db5ed4da980442e38e712e9c39a93329b351fa076bccd09659748aa\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.ichimoku_kumo\nprereg_seq=2\nfamily=trend\ntitle=Above%20the%20Ichimoku%20cloud%2C%20flat%20inside%20it\nrationale=The%20cloud%20is%20the%20only%20popular%20construction%20that%20declares%20the%20equilibrium%20zone%20with%20THICKNESS%3A%20between%20Senkou%20A%20and%20B%20there%20is%20no%20signal%2C%20and%20the%20thickness%20grows%20exactly%20when%20the%20recent%20extremes%20disagree%20with%20each%20other.%20It%20encodes%20the%20memory%20of%20the%209-%2C%2026-%20and%2052-bar%20ranges%2C%20the%20review%20horizons%20of%20a%20Japanese%20desk%2C%20and%20its%20value%20%E2%80%94%20if%20it%20has%20any%20%E2%80%94%20is%20reflexive%2C%20given%20how%20enormously%20the%20system%20is%20adopted%20in%20Asia.%20The%20%2B26%20displacement%20is%20what%20makes%20it%20interesting%20and%20also%20what%20makes%20it%20easy%20to%20implement%20wrong%3A%20it%20is%20information%20from%2026%20bars%20ago%20drawn%20forward%2C%20never%20future%20information.\nprior=We%20expect%20an%20edge%20similar%20to%20the%20moving-average%20cross%20but%20with%20considerably%20MORE%20time%20out%20of%20the%20market%2C%20because%20the%20cloud%20declares%20equilibrium%20explicitly.%20Falsifiable%3A%20if%20time%20out%20of%20the%20market%20does%20not%20increase%20clearly%20relative%20to%20trend.ema_cross_21_55%2C%20the%20cloud%20filters%20nothing%20and%20is%20a%20slow%20moving%20average%20with%20two%20coats%20of%20paint.%20We%20expect%20it%20to%20fail%20on%20trends%20that%20start%20from%20compression%2C%20where%20the%20cloud%20is%20thin%20and%20stops%20nothing.\nparams_json=%7B%22displacement%22%3A%2226%22%2C%22kijun%22%3A%2226%22%2C%22senkou_b%22%3A%2252%22%2C%22tenkan%22%3A%229%22%7D\nparams_sha256=ff01e7930dbad15b00b049034536b8ef410023e25e5160549f70b21c61c414a1\ncode_text=def%20_ichimoku_kumo%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20tenkan%20%3D%20%28talib.MAX%28h%2C%209%29%20%2B%20talib.MIN%28l%2C%209%29%29%20%2F%202.0%0A%20%20%20%20kijun%20%3D%20%28talib.MAX%28h%2C%2026%29%20%2B%20talib.MIN%28l%2C%2026%29%29%20%2F%202.0%0A%20%20%20%20%23%20%2B26%20displacement%3A%20TODAY%27s%20level%20comes%20out%20of%20data%20from%2026%20bars%20ago.%20Past%2C%20not%20future.%0A%20%20%20%20span_a%20%3D%20_lag%28%28tenkan%20%2B%20kijun%29%20%2F%202.0%2C%2026%29%0A%20%20%20%20span_b%20%3D%20_lag%28%28talib.MAX%28h%2C%2052%29%20%2B%20talib.MIN%28l%2C%2052%29%29%20%2F%202.0%2C%2026%29%0A%20%20%20%20ok%20%3D%20_ok%28tenkan%2C%20kijun%2C%20span_a%2C%20span_b%2C%20c%29%0A%20%20%20%20cloud_top%20%3D%20np.maximum%28span_a%2C%20span_b%29%0A%20%20%20%20cloud_bottom%20%3D%20np.minimum%28span_a%2C%20span_b%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20cloud_top%29%20%26%20%28tenkan%20%3E%20kijun%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20cloud_bottom%29%20%26%20%28tenkan%20%3C%20kijun%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=c02551ee298a50934c1a917d4b93b65766904ea5a757f6d30e09fb151f0e10d5\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":88,"row_hash":"d4c856035569eaef1301e95d97fac9789fb2848c6712a4642f0a8e24f9c10ac0","body":"wavelab-journal-chain\nv=3\nseq=88\nprev=37330b645a5893800e7ab36cdb96eb75ed38cbf359a4bba7f61a6e220b1ae8f5\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.linreg_slope_55_atr14\nprereg_seq=2\nfamily=trend\ntitle=Only%20when%20the%20drift%20outruns%20the%20noise\nrationale=Drift%20is%20only%20exploitable%20relative%20to%20the%20noise%20you%20have%20to%20wade%20through%20to%20collect%20it%3B%20a%20market%20that%20grinds%20higher%20in%20the%20middle%20of%20a%20gale%20is%20not%20tradeable.%20The%2055-bar%20regression%20slope%20estimates%20the%20drift%20and%20the%20ATR14%20the%20noise%20per%20bar%2C%20and%20requiring%20the%20window%27s%20cumulative%20displacement%20to%20exceed%201%20ATR%20is%20a%20change%20of%20unit%2C%20not%20a%20threshold%20fitted%20to%20data.%20It%20is%20the%20most%20literal%20formulation%20of%20%27trend%27%20in%20the%20whole%20family%3A%20no%20crosses%2C%20no%20focal%20points%20and%20no%20memory%20of%20extremes.\nprior=We%20expect%20this%20to%20be%20the%20detector%20with%20the%20FEWEST%20trades%20and%2C%20above%20all%2C%20the%20most%20stable%20one%20across%20timeframes%2C%20because%20the%20threshold%20is%20dimensionless.%20That%20is%20the%20falsifiable%20test%3A%20if%20its%20edge%20does%20not%20survive%20a%20change%20of%20timeframe%20better%20than%20trend.ema_cross_21_55%27s%20does%2C%20normalising%20by%20volatility%20adds%20nothing.%20We%20expect%20it%20to%20fail%20exactly%20at%20volatility%20jumps%2C%20because%20the%20ATR%20reacts%20late%20and%20the%20threshold%20loosens%20precisely%20when%20it%20should%20be%20tightening.\nparams_json=%7B%22atr%22%3A%2214%22%2C%22threshold_in_atr%22%3A%221.00000000%22%2C%22window%22%3A%2255%22%7D\nparams_sha256=b0e3e24daa18595018c1badc0b53d5edbce3d3dd52823087e30c4914209269ac\ncode_text=def%20_linreg_slope_55_atr14%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20slope%20%3D%20talib.LINEARREG_SLOPE%28c%2C%2055%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20ok%20%3D%20_ok%28slope%2C%20atr%29%20%26%20%28atr%20%3E%200.0%29%0A%20%20%20%20%23%20cumulative%20displacement%20of%20the%20window%2C%20in%20ATR%3A%20requiring%20%3E%201%20is%20requiring%20that%20the%20drift%0A%20%20%20%20%23%20dominate%20the%20noise%20in%20the%20noise%27s%20own%20unit.%20It%20is%20not%20a%20tuned%20threshold%3A%20it%20is%20a%20change%20of%0A%20%20%20%20%23%20unit.%0A%20%20%20%20ratio%20%3D%20np.full%28c.size%2C%20np.nan%2C%20dtype%3Dnp.float64%29%0A%20%20%20%20ratio%5Bok%5D%20%3D%20%28slope%5Bok%5D%20%2A%2055.0%29%20%2F%20atr%5Bok%5D%0A%20%20%20%20out%5Bok%20%26%20%28ratio%20%3E%201.0%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28ratio%20%3C%20-1.0%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=3f3b20563b27ceed31db60dbbdd40562819ab7a9e9972554348f81c8694c9353\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":89,"row_hash":"f2a53cba47b77c1f0ad5543f42724812bee592e43d824d6516358826b96bf1e7","body":"wavelab-journal-chain\nv=3\nseq=89\nprev=d4c856035569eaef1301e95d97fac9789fb2848c6712a4642f0a8e24f9c10ac0\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.macd_12_26_9\nprereg_seq=2\nfamily=trend\ntitle=Trade%20MACD%20acceleration%2C%20not%20the%20level\nrationale=The%20MACD%20against%20its%20signal%20line%20measures%20the%20ACCELERATION%20of%20the%20flow%20imbalance%2C%20not%20its%20level.%20Systematic%20momentum%20programmes%20scale%20size%20continuously%20as%20a%20function%20of%20the%20signal%20rather%20than%20in%20binary%20fashion%3A%20when%20the%20drift%20accelerates%20they%20add%20to%20the%20position%2C%20and%20that%20addition%20is%20literally%20tomorrow%27s%20drift.%20The%20bet%20is%20that%20this%20feedback%20loop%20shows%20up%20in%20the%20second%20derivative%20before%20it%20shows%20up%20in%20price.\nprior=We%20expect%20more%20position%20changes%20and%20a%20lower%20hit%20rate%20per%20trade%20than%20trend.ema_cross_21_55%2C%20and%20a%20similar%20GROSS%20edge%20that%20may%20disappear%20net%20of%20costs.%20Directly%20falsifiable%3A%20if%20the%20MACD%20does%20not%20beat%20the%20moving-average%20cross%20net%2C%20%27anticipating%20through%20acceleration%27%20has%20no%20content%20and%20it%20is%20an%20expensive%20moving%20average.%20We%20expect%20a%20clearly%20negative%20edge%20in%20a%20low-volatility%20range%2C%20where%20acceleration%20is%20only%20noise.\nparams_json=%7B%22fast%22%3A%2212%22%2C%22signal%22%3A%229%22%2C%22slow%22%3A%2226%22%7D\nparams_sha256=4105361b477d65dddb99505299e55315d0d5b0f7f9020688f7283f6841bd2de5\ncode_text=def%20_macd_12_26_9%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20c%20%3D%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20macd%2C%20signal%2C%20_%20%3D%20talib.MACD%28c%2C%2012%2C%2026%2C%209%29%0A%20%20%20%20ok%20%3D%20_ok%28macd%2C%20signal%29%0A%20%20%20%20out%5Bok%20%26%20%28macd%20%3E%20signal%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28macd%20%3C%20signal%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=d41a6c20c5d230e02605db8cf3d250a3f817d768eea1073ad52e7f7fe0b98608\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":90,"row_hash":"e6083bf13da1980cc0f785b7aa565e7e389b2eee70e13cf6a508974ac9112175","body":"wavelab-journal-chain\nv=3\nseq=90\nprev=f2a53cba47b77c1f0ad5543f42724812bee592e43d824d6516358826b96bf1e7\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.psar_002_020\nprereg_seq=2\nfamily=trend\ntitle=Tighten%20the%20stop%20with%20every%20new%20high\nrationale=The%20SAR%20tightens%20the%20stop%20as%20the%20trend%20matures%2C%20accelerating%20with%20every%20new%20extreme.%20It%20reproduces%20an%20observable%20behaviour%3A%20the%20manager%20raises%20the%20stop%20after%20each%20new%20high%20to%20protect%20unrealised%20profit%2C%20and%20that%20staircase%20of%20stops%20is%20latent%20supply%20which%2C%20once%20touched%2C%20executes%20as%20a%20cascade.%20It%20is%20registered%20explicitly%20as%20the%20OPPOSITE%20hypothesis%20to%20trend.supertrend_atr14_x3%20on%20the%20same%20question%3A%20whether%20to%20tighten%20the%20stop%20or%20to%20give%20it%20room.\nprior=We%20predict%20that%20SAR%20and%20Supertrend%20disagree%20systematically%20about%20how%20long%20the%20position%20is%20held%20and%20that%20ONE%20of%20the%20two%20is%20clearly%20worse%3B%20we%20bet%20on%20the%20SAR%20losing%20net%20through%20excess%20trading.%20The%20result%20that%20would%20refute%20the%20whole%20question%20is%20that%20both%20perform%20the%20same%3A%20that%20would%20mean%20stop%20distance%20is%20not%20a%20relevant%20variable%20and%20that%20both%20rationalisations%20are%20noise.%20The%20SAR%20is%20always%20in%20the%20market%2C%20so%20we%20expect%20severe%20damage%20in%20a%20range.\nparams_json=%7B%22acceleration%22%3A%220.02000000%22%2C%22maximum%22%3A%220.20000000%22%7D\nparams_sha256=18d6530b5bf61e581fdd8ef18495ddd3acdc0150ea9f959e1285e445b989aa0f\ncode_text=def%20_psar_002_020%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20sar%20%3D%20talib.SAR%28h%2C%20l%2C%20acceleration%3D0.02%2C%20maximum%3D0.2%29%0A%20%20%20%20ok%20%3D%20_ok%28sar%2C%20c%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20sar%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20sar%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=a83837752eb41ff9b34b2a99cc7a3e5ec6832bdc0807303b26c524c1a2a0b382\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":91,"row_hash":"b677fc6cece8a0b6b61651534afa2f0c20e25a746904b2e7225625ec7897139a","body":"wavelab-journal-chain\nv=3\nseq=91\nprev=e6083bf13da1980cc0f785b7aa565e7e389b2eee70e13cf6a508974ac9112175\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=trend.supertrend_atr14_x3\nprereg_seq=2\nfamily=trend\ntitle=Trail%20a%20wide%20stop%2C%20three%20ATR%20out\nrationale=An%20invalidation%20threshold%20fixed%20as%20a%20percentage%20is%20incoherent%20across%20volatility%20regimes%3A%20the%20same%202%25%20is%20noise%20in%20one%20regime%20and%20a%20signal%20in%20another.%20Supertrend%20puts%20the%20flip%203%20ATR%20away%20from%20the%20midpoint%2C%20which%20is%20roughly%20where%20a%20risk%20desk%20places%20the%20stop%20%E2%80%94%20far%20enough%20that%20ordinary%20noise%20does%20not%20touch%20it.%20If%20real%20stops%20cluster%20at%20that%20distance%2C%20the%20level%20stops%20being%20a%20drawn%20line%20and%20starts%20having%20flow%20behind%20it.%20The%20band%27s%20ratchet%20is%20the%20hypothesis%20that%20it%20pays%20to%20GIVE%20the%20position%20room.\nprior=We%20expect%20the%20same%20sign%20as%20the%20moving-average%20cross%20in%20a%20trend%2C%20but%20far%20fewer%20position%20changes%20thanks%20to%20the%20band%27s%20hysteresis%2C%20and%20that%20ALL%20the%20edge%20over%20the%20cross%20comes%20from%20that%20reduction%20and%20not%20from%20better%20accuracy.%20Falsifiable%3A%20if%20the%20number%20of%20position%20changes%20does%20not%20fall%20clearly%20relative%20to%20trend.ema_cross_21_55%2C%20the%20hysteresis%20is%20doing%20nothing.%20We%20expect%20it%20to%20give%20back%20a%20lot%20of%20profit%20on%20sharp%20reversals%2C%20precisely%20because%20of%20how%20far%20away%20the%20level%20sits%3B%20we%20predict%20it%20loses%20to%20trend.psar_002_020%20in%20markets%20that%20turn%20in%20a%20V.\nparams_json=%7B%22atr%22%3A%2214%22%2C%22multiplier%22%3A%223.00000000%22%7D\nparams_sha256=f4ed09e8b08fb50eb8027a6743e1f63bf8a0ce8231927a861ccd8b95e5716adb\ncode_text=def%20_supertrend_atr14_x3%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20h%2C%20l%2C%20c%20%3D%20_f64%28s.high%29%2C%20_f64%28s.low%29%2C%20_f64%28s.close%29%0A%20%20%20%20n%20%3D%20c.size%0A%20%20%20%20out%20%3D%20np.zeros%28n%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20hl2%20%3D%20%28h%20%2B%20l%29%20%2F%202.0%0A%20%20%20%20upper_band%20%3D%20hl2%20%2B%203.0%20%2A%20atr%0A%20%20%20%20lower_band%20%3D%20hl2%20-%203.0%20%2A%20atr%0A%20%20%20%20ok%20%3D%20_ok%28upper_band%2C%20lower_band%2C%20c%29%0A%20%20%20%20upper%20%3D%20np.nan%0A%20%20%20%20lower%20%3D%20np.nan%0A%20%20%20%20pos%20%3D%200%0A%20%20%20%20for%20i%20in%20range%281%2C%20n%29%3A%0A%20%20%20%20%20%20%20%20if%20not%20ok%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20if%20not%20np.isfinite%28upper%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20upper%2C%20lower%20%3D%20upper_band%5Bi%5D%2C%20lower_band%5Bi%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%20%20%20%20%20%20%20%20%23%20ratchet%3A%20the%20band%20only%20tightens%2C%20and%20is%20released%20only%20when%20price%20breaks%20through%20it.%0A%20%20%20%20%20%20%20%20if%20upper_band%5Bi%5D%20%3C%20upper%20or%20c%5Bi%20-%201%5D%20%3E%20upper%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20upper%20%3D%20upper_band%5Bi%5D%0A%20%20%20%20%20%20%20%20if%20lower_band%5Bi%5D%20%3E%20lower%20or%20c%5Bi%20-%201%5D%20%3C%20lower%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20lower%20%3D%20lower_band%5Bi%5D%0A%20%20%20%20%20%20%20%20if%20c%5Bi%5D%20%3E%20upper%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%201%0A%20%20%20%20%20%20%20%20elif%20c%5Bi%5D%20%3C%20lower%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20pos%20%3D%20-1%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20pos%0A%20%20%20%20return%20out%0A\ncode_sha256=0bd35cb26160c60e691726b4fcb83cc4b6a8e8638125536aa6fa2f8f84104a6a\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Ftrend.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=250\neffective_from_ms=1790242821226\n"} {"seq":92,"row_hash":"ba65650259a846cf227b346a05b9ac73d67893408046057a548fa0ae2872f6d6","body":"wavelab-journal-chain\nv=3\nseq=92\nprev=b677fc6cece8a0b6b61651534afa2f0c20e25a746904b2e7225625ec7897139a\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.bbw_pct_low_carry\nprereg_seq=2\nfamily=volatility\ntitle=Narrow%20Bollinger%20width%2C%20follow%20the%20EMA-55\nrationale=A%20controlled%20contrast%20to%20the%20previous%20one%3A%20identical%20direction%20rule%20%28price%20against%20the%20EMA-55%29%2C%20identical%20percentile%20window%20%28252%29%2C%20identical%20threshold%20%28bottom%20quintile%29%2C%20and%20the%20ONLY%20thing%20that%20changes%20is%20the%20compression%20estimator%3A%20Bollinger%20width%2C%20which%20is%20the%20standard%20deviation%20of%20CLOSES%2C%20against%20Rogers-Satchell%2C%20which%20uses%20the%20full%20OHLC%20range.%20The%20two%20can%20diverge%20a%20great%20deal%3A%20a%20candle%20with%20a%20long%20wick%20and%20a%20flat%20close%20%28an%20absorbed%20liquidation%29%20is%20quiet%20for%20Bollinger%20and%20noisy%20for%20RS.%20If%20the%20clustering%20mechanism%20is%20real%2C%20it%20should%20show%20up%20with%20both%20estimators.\nprior=We%20expect%20the%20SAME%20sign%20as%20%60rs_vol_pct_low_carry%60%20and%20a%20somewhat%20smaller%20magnitude%2C%20because%20the%20close-based%20estimator%20throws%20away%20the%20information%20in%20the%20wicks.%20The%20strong%20falsifiable%20prediction%20is%20the%20joint%20one%3A%20if%20one%20of%20the%20two%20gives%20a%20clear%20edge%20and%20the%20other%20gives%20zero%20or%20the%20opposite%20sign%2C%20the%20correct%20conclusion%20is%20NOT%20%27compression%20works%27%20but%20that%20we%20are%20measuring%20a%20quirk%20of%20the%20estimator%2C%20and%20neither%20of%20the%20two%20should%20survive%20the%20multiple-comparisons%20correction%20as%20evidence%20for%20the%20mechanism.\nparams_json=%7B%22bb_period%22%3A%2220%22%2C%22bb_sigma%22%3A%222.00000000%22%2C%22ema_direction%22%3A%2255%22%2C%22percentile_window%22%3A%22252%22%2C%22threshold%22%3A%220.20000000%22%7D\nparams_sha256=fa7d3996ca0f561274167d8463655717523d82f115519d40751b79634f3041d0\ncode_text=def%20_bbw_pct_low_carry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20up%2C%20mid%2C%20lo%20%3D%20talib.BBANDS%28c%2C%2020%2C%202.0%2C%202.0%2C%200%29%0A%20%20%20%20bw%20%3D%20np.full%28c.size%2C%20np.nan%29%0A%20%20%20%20good%20%3D%20~%28np.isnan%28up%29%20%7C%20np.isnan%28lo%29%20%7C%20np.isnan%28mid%29%29%20%26%20%28mid%20%21%3D%200%29%0A%20%20%20%20bw%5Bgood%5D%20%3D%20%28up%5Bgood%5D%20-%20lo%5Bgood%5D%29%20%2F%20mid%5Bgood%5D%0A%20%20%20%20rank%20%3D%20_rolling_rank%28bw%2C%20252%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20quiet%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28ema%29%20%26%20%28rank%20%3C%200.20%29%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=852bc9cd3b1e73edbdcca57843bf9d04ec58ddf92ea2bb93c636cb5d8903beba\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":93,"row_hash":"188128c21db0952bf8010904878b73317df444825609a8ef7aaa03b94f0d333f","body":"wavelab-journal-chain\nv=3\nseq=93\nprev=ba65650259a846cf227b346a05b9ac73d67893408046057a548fa0ae2872f6d6\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.chandelier_atr_trail\nprereg_seq=2\nfamily=volatility\ntitle=Trail%20three%20ATR%20from%20the%2022-candle%20extreme\nrationale=The%20Chandelier%20exit%20%28Chuck%20LeBeau%2C%2022%2F3%29%3A%20long%20while%20the%20close%20is%20above%20the%2022-candle%20low%20plus%203%C2%B7ATR-22%2C%20short%20while%20it%20is%20below%20the%2022-candle%20high%20minus%203%C2%B7ATR-22.%20The%20volatility%20content%20lies%20in%20the%20invalidation%20distance%20being%20scaled%20by%20the%20ATR%3A%20the%20position%20survives%20exactly%20the%20noise%20the%20current%20regime%20produces%20and%20not%20a%20bit%20more.%20It%20is%20the%20operational%20translation%20of%20volatility%20clustering%3A%20if%20variance%20is%20autocorrelated%2C%20tomorrow%27s%20noise%20is%20well%20estimated%20by%20today%27s%2C%20and%20a%20threshold%20fixed%20as%20a%20percentage%20would%20be%20too%20close%20in%20an%20agitated%20regime%20and%20too%20far%20in%20a%20quiet%20one.\nprior=We%20expect%20a%20positive%20edge%20in%20a%20trending%20regime%20and%20a%20NEGATIVE%20one%20in%20a%20range%3A%20the%20signal%20is%20always%20in%20the%20market%2C%20so%20in%20a%20range%20it%20pays%20for%20every%20turn.%20The%20falsifiable%20claim%20specific%20to%20this%20family%20is%20not%20%27trend%20following%20works%27%20%E2%80%94that%20is%20what%20the%20trend%20family%20tests%E2%80%94%20but%20that%20SCALING%20the%20threshold%20by%20the%20ATR%20beats%20the%20same%20structure%20with%20a%20fixed%20threshold%20%E2%80%94%20an%20arm%20that%20was%20NOT%20registered%20and%20that%20the%202026-09-08%20audit%20has%20added%20as%20%60volatility.chandelier_fixed_pct%60%2C%20without%20which%20this%20criterion%20could%20not%20be%20run.%20If%20the%20net%20result%20across%20the%20whole%20history%20were%20indistinguishable%20from%20zero%2C%20the%20correct%20conclusion%20is%20that%20in%20BTC%20the%20gain%20from%20the%20trends%20exactly%20offsets%20the%20cost%20of%20the%20ranges%2C%20and%20there%20is%20no%20edge%20attributable%20to%20volatility%20scaling.\nparams_json=%7B%22atr_period%22%3A%2222%22%2C%22mult%22%3A%223.00000000%22%2C%22window%22%3A%2222%22%7D\nparams_sha256=4801f13b7677fb4164a6b48c8b7b3627046106e72ff64f64cd4f9d7c5bfc2ce7\ncode_text=def%20_chandelier_trail%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2022%29%0A%20%20%20%20hh%20%3D%20talib.MAX%28h%2C%2022%29%0A%20%20%20%20ll%20%3D%20talib.MIN%28l%2C%2022%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28atr%29%20%7C%20np.isnan%28hh%29%20%7C%20np.isnan%28ll%29%29%0A%20%20%20%20long_stop%20%3D%20hh%20-%203.0%20%2A%20atr%0A%20%20%20%20short_stop%20%3D%20ll%20%2B%203.0%20%2A%20atr%0A%0A%20%20%20%20%23%20FIXED%20IN%20THE%20AUDIT%20%282026-09-08%29.%20This%20used%20to%20be%3A%0A%20%20%20%20%23%20%20%20%20%20entry%5Bok%20%26%20%28c%20%3E%20short_stop%29%5D%20%3D%201%0A%20%20%20%20%23%20%20%20%20%20entry%5Bok%20%26%20%28c%20%3C%20long_stop%29%5D%20%3D%20-1%0A%20%20%20%20%23%20and%20the%20two%20assignments%20trampled%20each%20other.%20When%20the%2022-candle%20range%20is%20wide%20%28hh%20-%20ll%20%3E%0A%20%20%20%20%23%206%C2%B7ATR%29%20the%20long%20threshold%20ends%20up%20ABOVE%20the%20short%20one%2C%20so%20a%20close%20in%20the%20zone%20between%20them%0A%20%20%20%20%23%20satisfied%20BOTH%20conditions%20at%20once%3B%20since%20the%20-1%20was%20written%20second%2C%20the%20short%20always%20won.%0A%20%20%20%20%23%20Measured%20over%20a%20series%20containing%20all%20three%20regimes%2C%20that%20affected%202.7%25%20of%20candles%20and%20forced%0A%20%20%20%20%23%20every%20one%20of%20them%20short.%0A%20%20%20%20%23%0A%20%20%20%20%23%20Why%20it%20mattered%2C%20and%20why%20it%20is%20not%20a%20detail.%20The%20comment%20on%20this%20very%20function%20declared%20the%0A%20%20%20%20%23%20opposite%20of%20what%20the%20code%20did%20%28%22when%20the%20close%20falls%20between%20the%20two%20thresholds%20there%20is%20no%0A%20%20%20%20%23%20new%20information%3A%20the%20state%20is%20held%22%29%2C%20and%20the%20bias%20was%20not%20random%3A%20the%20ambiguous%20zone%20appears%0A%20%20%20%20%23%20precisely%20in%20wide%20ranges%2C%20that%20is%2C%20in%20the%20regime%20where%20this%20hypothesis%27s%20prior%20predicts%0A%20%20%20%20%23%20LOSSES.%20An%20arbitrary%20tie-break%20that%20systematically%20goes%20short%20exactly%20in%20the%20regime%20you%20are%0A%20%20%20%20%23%20trying%20to%20measure%20contaminates%20the%20sign%20of%20the%20result%20and%20makes%20it%20uninterpretable%3A%20you%20could%0A%20%20%20%20%23%20not%20tell%20whether%20what%20was%20measured%20was%20the%20ATR%20scaling%20or%20the%20tie-break.%20The%20ambiguous%20zone%0A%20%20%20%20%23%20now%20emits%200%20%E2%80%94no%20new%20entry%E2%80%94%20and%20%60_hold%60%20carries%20the%20previous%20state%20forward%2C%20which%20is%20the%0A%20%20%20%20%23%20Chandelier%20rule%20as%20declared%20in%20the%20%60rationale%60%20and%20what%20%60_events%60%20does%20in%20the%20%60structure%60%0A%20%20%20%20%23%20family.%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20long_side%20%3D%20ok%20%26%20%28c%20%3E%20short_stop%29%0A%20%20%20%20short_side%20%3D%20ok%20%26%20%28c%20%3C%20long_stop%29%0A%20%20%20%20ambiguous%20%3D%20long_side%20%26%20short_side%0A%20%20%20%20entry%5Blong_side%20%26%20~ambiguous%5D%20%3D%201%0A%20%20%20%20entry%5Bshort_side%20%26%20~ambiguous%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28entry%2C%20np.zeros%28c.size%2C%20dtype%3Dbool%29%29%0A\ncode_sha256=c5367fa6e9ee2a717f82b85b37e27ffc3132c7563979bd05951e932d5ddeee54\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":94,"row_hash":"784428945197010cce9ab2a7f6d0ebb88b35b2f36cbd78c6bfed2e2a60ca2237","body":"wavelab-journal-chain\nv=3\nseq=94\nprev=188128c21db0952bf8010904878b73317df444825609a8ef7aaa03b94f0d333f\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.chandelier_fixed_pct\nprereg_seq=2\nfamily=volatility\ntitle=Trail%20a%20fixed%206%25%20instead%20of%20ATR\nrationale=Control%20for%20%60chandelier_atr_trail%60.%20Exactly%20the%20same%20structure%20%E2%80%94long%20while%20the%20close%20is%20above%20the%2022-candle%20low%20plus%20a%20buffer%2C%20short%20while%20it%20is%20below%20the%2022-candle%20high%20minus%20that%20buffer%E2%80%94%20with%20a%20single%20difference%3A%20the%20buffer%20is%20a%20FIXED%20percentage%20of%20the%20level%20instead%20of%203%C2%B7ATR-22.%20It%20is%20the%20arm%20that%20makes%20the%20family%27s%20central%20claim%20testable%2C%20which%20is%20not%20%27trend%20following%20works%27%20but%20that%20measuring%20the%20invalidation%20distance%20in%20units%20of%20the%20PREVAILING%20volatility%20beats%20measuring%20it%20in%20units%20of%20price.%20If%20volatility%20clustering%20is%20real%2C%20the%20scaled%20threshold%20should%20be%20too%20close%20in%20an%20agitated%20regime%20and%20too%20far%20in%20a%20quiet%20one%20exactly%20when%20the%20fixed%20one%20gets%20it%20wrong%2C%20and%20not%20before.\nprior=We%20expect%20a%20positive%20edge%20and%20a%20SMALLER%20one%20than%20%60chandelier_atr_trail%60%27s%2C%20with%20the%20difference%20concentrated%20in%20the%20volatility%20regime%20changes%20%E2%80%94the%20months%20after%20March%202020%20and%20May%202021%E2%80%94%20and%20practically%20nil%20over%20the%20rest%20of%20the%20sample.%20If%20the%20two%20turn%20out%20indistinguishable%2C%20the%20ATR%20scaling%20buys%20nothing%20and%20%60chandelier_atr_trail%60%20is%20refuted%20in%20its%20own%20claim%20even%20if%20it%20makes%20money%3B%20if%20this%20control%20turns%20out%20BETTER%2C%20volatility%20clustering%20operates%20in%20the%20opposite%20direction%20to%20the%20one%20described%20in%20this%20family%27s%20header%20and%20every%20compression%20hypothesis%20in%20this%20file%20must%20be%20reread%20with%20suspicion.%20The%206%25%20is%20frozen%3A%20if%20it%20fails%2C%20no%20other%20value%20is%20tried.\nparams_json=%7B%22buffer_pct%22%3A%220.06000000%22%2C%22scaling%22%3A%22none%22%2C%22window%22%3A%2222%22%7D\nparams_sha256=0ea385c0a9a64e68ec2586c50bd4542c131b174a08ce9fefa675555dae23c76e\ncode_text=def%20_chandelier_fixed_pct%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20%22%22%22Identical%20to%20%60_chandelier_trail%60%20except%20that%20the%20buffer%20is%20a%20fixed%206%25%20of%20the%20level%20instead%0A%20%20%20%20of%203%C2%B7ATR-22.%20The%206%25%20was%20not%20searched%20for%3A%20it%20is%20the%20value%20that%20matches%203%C2%B7ATR-22%20in%20a%20typical%0A%20%20%20%20BTC%20volatility%20regime%20on%204h%2C%20chosen%20in%20advance%20so%20that%20the%20control%20differs%20from%20the%20hypothesis%0A%20%20%20%20in%20the%20SCALING%20and%20not%20in%20the%20average%20aggressiveness%20of%20the%20threshold.%22%22%22%0A%20%20%20%20_%2C%20h%2C%20low%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20hh%20%3D%20talib.MAX%28h%2C%2022%29%0A%20%20%20%20ll%20%3D%20talib.MIN%28low%2C%2022%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28hh%29%20%7C%20np.isnan%28ll%29%29%0A%20%20%20%20long_stop%20%3D%20hh%20%2A%20%281.0%20-%200.06%29%0A%20%20%20%20short_stop%20%3D%20ll%20%2A%20%281.0%20%2B%200.06%29%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20long_side%20%3D%20ok%20%26%20%28c%20%3E%20short_stop%29%0A%20%20%20%20short_side%20%3D%20ok%20%26%20%28c%20%3C%20long_stop%29%0A%20%20%20%20ambiguous%20%3D%20long_side%20%26%20short_side%20%20%20%20%23%20same%20tie-break%20rule%20as%20the%20hypothesis%20it%20controls%0A%20%20%20%20entry%5Blong_side%20%26%20~ambiguous%5D%20%3D%201%0A%20%20%20%20entry%5Bshort_side%20%26%20~ambiguous%5D%20%3D%20-1%0A%20%20%20%20return%20_hold%28entry%2C%20np.zeros%28c.size%2C%20dtype%3Dbool%29%29%0A\ncode_sha256=c40ca5b768adda95033f224e4b0a1e69cd2e017727071bee73d8abd554fb084e\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":95,"row_hash":"6a8824c52f988afba30885b9954451891b4ab4555c02c1d9fa450f59b2313d33","body":"wavelab-journal-chain\nv=3\nseq=95\nprev=784428945197010cce9ab2a7f6d0ebb88b35b2f36cbd78c6bfed2e2a60ca2237\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.ema55_side_unfiltered\nprereg_seq=2\nfamily=volatility\ntitle=The%20EMA-55%20side%20with%20no%20volatility%20gate\nrationale=Unconditional%20control%20for%20%60rs_vol_pct_low_carry%60%20and%20%60bbw_pct_low_carry%60%3A%20exactly%20their%20same%20direction%20rule%20%E2%80%94close%20above%20or%20below%20the%20EMA-55%E2%80%94%20with%20no%20volatility%20gate%20at%20all.%20It%20claims%20no%20mechanism%20of%20its%20own%2C%20and%20that%20is%20the%20point%3A%20the%20two%20compression%20hypotheses%20do%20not%20bet%20that%20following%20the%20EMA-55%20wins%2C%20but%20that%20it%20wins%20MORE%20when%20realised%20volatility%20is%20in%20the%20bottom%20quintile.%20That%20is%20a%20claim%20about%20a%20difference%2C%20and%20a%20difference%20cannot%20be%20measured%20with%20a%20single%20arm.%20It%20is%20registered%20in%20%60volatility%60%20and%20not%20in%20%60trend%60%20because%20its%20only%20reason%20to%20exist%20is%20to%20serve%20as%20the%20denominator%20for%20this%20family%27s%20volatility%20gate.\nprior=We%20expect%20a%20small%20positive%20edge%2C%20dominated%20by%20BTC%27s%20secular%20drift%2C%20and%20we%20expect%20it%20to%20be%20SMALLER%20than%20%60rs_vol_pct_low_carry%60%27s.%20That%20comparison%20is%20the%20whole%20content%3A%20if%20this%20control%20matches%20or%20beats%20the%20two%20filtered%20versions%2C%20the%20volatility%20gate%20adds%20nothing%20and%20both%20are%20refuted%20even%20if%20their%20absolute%20number%20is%20good%3B%20if%20the%20two%20filtered%20ones%20beat%20it%2C%20the%20volatility-clustering%20claim%20holds.%20On%20its%20own%2C%20a%20positive%20result%20for%20this%20control%20is%20NOT%20a%20finding%3A%20it%20is%20the%20asset%27s%20drift%20split%20by%20which%20side%20of%20a%20moving%20average%20you%20are%20on%2C%20and%20it%20must%20be%20published%20as%20such.\nparams_json=%7B%22ema_direction%22%3A%2255%22%2C%22volatility_gate%22%3A%22none%22%7D\nparams_sha256=39722f96b96683e65c3ac04a13199684837fe2d79a0a4f5e2969b7b7219fda11\ncode_text=def%20_ema55_side_unfiltered%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~np.isnan%28ema%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=ce5ebb0829b0d6970bcba0bab57a271a11de4a040f7708ddd05e9cf22bdc0ef1\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":96,"row_hash":"202892f5bad127d72192e25ba831f5f0c8cfde0e9d2a8a4abeb3af049e15d730","body":"wavelab-journal-chain\nv=3\nseq=96\nprev=6a8824c52f988afba30885b9954451891b4ab4555c02c1d9fa450f59b2313d33\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.inside_bar_breakout\nprereg_seq=2\nfamily=volatility\ntitle=Break%20the%20inside%20bar%27s%20own%20extremes\nrationale=Inside%20bar%3A%20the%20range%20of%20the%20previous%20candle%20is%20STRICTLY%20contained%20within%20that%20of%20the%20one%20before%20it.%20It%20is%20not%20the%20same%20thing%20as%20NR7%2C%20and%20that%20is%20why%20it%20is%20registered%20separately%3A%20NR7%20is%20narrowness%20relative%20to%20a%20sample%20of%20seven%2C%20the%20inside%20bar%20is%20a%20condition%20of%20absolute%20containment%20relative%20to%20ONE%20specific%20candle%2C%20the%20mother.%20Containment%20means%20no%20participant%20managed%20to%20impose%20a%20price%20outside%20the%20range%20that%20had%20already%20been%20explored%20and%20rejected%3A%20equilibrium%20has%20reasserted%20itself%20within%20a%20known%20range%2C%20with%20the%20orders%20anchored%20to%20the%20extremes%20of%20the%20inside%20candle.%20Breaking%20them%20on%20a%20close%20invalidates%20that%20reassertion.\nprior=We%20expect%20a%20positive%20edge%2C%20of%20the%20same%20sign%20as%20%60nr7_breakout%60%20and%20of%20similar%20magnitude.%20The%20comparison%20between%20the%20two%20is%20informative%20in%20itself%3A%20if%20absolute%20containment%20works%20and%20relative%20narrowness%20does%20not%20%28or%20the%20other%20way%20round%29%2C%20what%20we%20have%20is%20a%20quirk%20of%20the%20criterion%20and%20not%20the%20contraction%20mechanism.%20We%20expect%20it%20to%20fail%20in%20markets%20with%20strong%20sustained%20drift%2C%20where%20the%20inside%20bar%20is%20only%20a%20continuation%20pause%20and%20the%20break%20already%20arrives%20late%2C%20and%20on%2015m%20during%20the%20lowest-volume%20hours%2C%20where%20the%20containment%20reflects%20an%20absence%20of%20participants%20rather%20than%20agreement%20among%20them.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20%60candles.inside_bar_break%60%20registers%20the%20same%20two-candle%20pattern%20but%20breaking%20the%20extremes%20of%20the%20MOTHER%20candle.%20Since%20the%20inside%20candle%27s%20high%20is%20lower%20than%20the%20mother%27s%2C%20every%20event%20of%20the%20former%20is%20also%20an%20event%20of%20the%20latter%3A%20they%20are%20the%20same%20pattern%20with%20two%20different%20thresholds.%20Both%20are%20kept%20because%20the%20level%20is%20the%20claim%20and%20these%20are%20different%20levels%2C%20but%20they%20are%20DEPENDENT%20trials%20and%20must%20be%20counted%20as%20such.%20%28A%20third%20registration%20of%20the%20same%20pattern%2C%20%60structure.inside_bar_break%60%2C%20was%20an%20exact%20duplicate%20of%20the%20%60candles%60%20one%20and%20has%20been%20removed%20in%20the%20audit.%29\nparams_json=%7B%22horizon_bars%22%3A%221%22%7D\nparams_sha256=1a94e2fec77a78e93dd6563a7a63cb93bdf459e7bb6f99e56bf9818c55a7a824\ncode_text=def%20_inside_bar_breakout%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20h1%2C%20l1%20%3D%20_shift%28h%2C%201%29%2C%20_shift%28l%2C%201%29%0A%20%20%20%20h2%2C%20l2%20%3D%20_shift%28h%2C%202%29%2C%20_shift%28l%2C%202%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28h1%29%20%7C%20np.isnan%28l1%29%20%7C%20np.isnan%28h2%29%20%7C%20np.isnan%28l2%29%29%0A%20%20%20%20inside%20%3D%20ok%20%26%20%28h1%20%3C%20h2%29%20%26%20%28l1%20%3E%20l2%29%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3E%20h1%29%5D%20%3D%201%0A%20%20%20%20out%5Binside%20%26%20%28c%20%3C%20l1%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=467d60a2d751c5d7ec6a4a55ac31f6089801c88b956f752ec2b4fb33e2d14a56\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":97,"row_hash":"ef5a6e83ece68366e66b7e5da29aa189761c005225ec8ee3fa45c1b71514d54b","body":"wavelab-journal-chain\nv=3\nseq=97\nprev=202892f5bad127d72192e25ba831f5f0c8cfde0e9d2a8a4abeb3af049e15d730\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.keltner_breakout\nprereg_seq=2\nfamily=volatility\ntitle=Close%20two%20ATR%20beyond%20the%20EMA-20\nrationale=A%20volatility-normalised%20breakout%20with%20no%20compression%20component%3A%20a%20close%20above%20EMA-20%20%2B%202%C2%B7ATR-10%2C%20or%20below%20EMA-20%20%E2%88%92%202%C2%B7ATR-10.%20Under%20a%20random%20walk%20with%20the%20CURRENT%20volatility%2C%20getting%20two%20ATR%20away%20from%20the%20mean%20is%20rare%3B%20that%20it%20happens%20is%20evidence%20that%20flow%20has%20arrived%20which%20the%20prevailing%20volatility%20level%20does%20not%20explain%20%E2%80%94%20that%20is%2C%20evidence%20of%20a%20change%20in%20the%20drift%20and%20not%20of%20a%20fluctuation.%20The%20threshold%20rescales%20itself%2C%20so%20the%20same%20rule%20is%20equally%20demanding%20at%2020%2C000%20as%20at%20100%2C000%20dollars.%20It%20is%20held%20until%20the%20close%20crosses%20back%20over%20the%20EMA-20%2C%20which%20is%20the%20minimal%20definition%20of%20%27the%20flow%20is%20over%27.\nprior=We%20expect%20a%20positive%20edge%20and%2C%20above%20all%2C%20an%20ASYMMETRY%20with%20respect%20to%20the%20squeeze%3A%20if%20%60squeeze_bb_kc_release%60%20beats%20this%20hypothesis%2C%20the%20prior%20compression%20adds%20information%20over%20and%20above%20the%20break%20alone%2C%20which%20is%20the%20family%27s%20central%20claim.%20If%20this%20one%20wins%20instead%2C%20the%20compression%20is%20decorative%20and%20the%20only%20thing%20that%20works%20is%20the%20volatility-normalised%20break.%20We%20expect%20it%20to%20fail%20in%20a%20mid-volatility%20range%2C%20where%20price%20crosses%20the%20two%20ATR%20in%20both%20directions%20repeatedly%20and%20each%20crossing%20costs%20a%20spread.\nparams_json=%7B%22atr_period%22%3A%2210%22%2C%22ema_period%22%3A%2220%22%2C%22mult%22%3A%222.00000000%22%7D\nparams_sha256=4a07d7eace27923a97bfcc320ab2e310c465157e9cf0322e693d12ead093f083\ncode_text=def%20_keltner_breakout%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2010%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28ema%29%20%7C%20np.isnan%28atr%29%29%0A%20%20%20%20up%2C%20lo%20%3D%20ema%20%2B%202.0%20%2A%20atr%2C%20ema%20-%202.0%20%2A%20atr%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20entry%5Bok%20%26%20%28c%20%3E%20up%29%5D%20%3D%201%0A%20%20%20%20entry%5Bok%20%26%20%28c%20%3C%20lo%29%5D%20%3D%20-1%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20cur%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28c.size%29%3A%0A%20%20%20%20%20%20%20%20if%20cur%20%3D%3D%201%20and%20ok%5Bi%5D%20and%20c%5Bi%5D%20%3C%20ema%5Bi%5D%20or%20cur%20%3D%3D%20-1%20and%20ok%5Bi%5D%20and%20c%5Bi%5D%20%3E%20ema%5Bi%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%200%0A%20%20%20%20%20%20%20%20e%20%3D%20int%28entry%5Bi%5D%29%0A%20%20%20%20%20%20%20%20if%20e%20%21%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%20e%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20cur%0A%20%20%20%20return%20out%0A\ncode_sha256=cbe77c8396ad2915c4ff910aa1726001d82bf262d55ffd361b72173e92fa9a7d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":98,"row_hash":"441df625528edae096090bab58a4bac9d2bfe1869c3236c9488e57c97cac5608","body":"wavelab-journal-chain\nv=3\nseq=98\nprev=ef5a6e83ece68366e66b7e5da29aa189761c005225ec8ee3fa45c1b71514d54b\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.natr_high_regime_trend\nprereg_seq=2\nfamily=volatility\ntitle=EMA-21%2F55%20cross%20with%20NATR%20above%20median\nrationale=The%20complementary%20half%2C%20registered%20so%20that%20the%20previous%20claim%20is%20falsifiable%20and%20not%20a%20selection%20made%20after%20the%20fact.%20Above%20the%20NATR-14%20median%2C%20the%20same%20trend%20signal%20trades%20when%20the%20typical%20travel%20is%20large%3A%20a%20single%20candle%20can%20cover%20the%20distance%20between%20the%20two%20averages%20several%20times%20over%2C%20so%20the%20cross%20happens%20and%20unwinds%20through%20amplitude%20noise%2C%20and%20on%20top%20of%20that%20spread%20and%20slippage%20are%20at%20their%20worst%20precisely%20there.\nprior=We%20expect%20a%20NIL%20OR%20NEGATIVE%20edge%20here%2C%20and%20a%20positive%20one%20in%20%60natr_low_regime_trend%60.%20That%20is%20the%20contrast%2C%20and%20we%20are%20committed%20to%20that%20sign%20in%20advance.%20If%20it%20came%20out%20the%20other%20way%20round%20%E2%80%94trend%20paying%20in%20high%20volatility%20and%20not%20in%20low%E2%80%94%20the%20mechanism%20we%20have%20described%20for%20this%20entire%20family%20would%20be%20wrong%3A%20it%20would%20mean%20that%20in%20BTC%20high%20volatility%20accompanies%20directional%20trend%20instead%20of%20destroying%20it%2C%20and%20the%20compression%20hypotheses%20in%20this%20file%20would%20have%20to%20be%20read%20with%20far%20more%20suspicion%20even%20if%20one%20of%20them%20gave%20a%20favourable%20number.\nparams_json=%7B%22cutoff%22%3A%220.50000000%22%2C%22ema_fast%22%3A%2221%22%2C%22ema_slow%22%3A%2255%22%2C%22natr_period%22%3A%2214%22%2C%22percentile_window%22%3A%22252%22%7D\nparams_sha256=22ba4afab47f6986e475fbc578f985859e0e2d03ba1def7f3c2d74fe8a9f07d2\ncode_text=def%20_natr_high_regime_trend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20return%20_natr_regime_trend%28s%2C%20high_vol%3DTrue%29%0A\ncode_sha256=c873186d50d9c38ea822bdabb8a4fb2d29f3c47aa8540280c34c0886e74f607c\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":99,"row_hash":"9e73075282000d3bd29056277ab7004297e623614f5501788d584d37d21a3388","body":"wavelab-journal-chain\nv=3\nseq=99\nprev=441df625528edae096090bab58a4bac9d2bfe1869c3236c9488e57c97cac5608\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.natr_low_regime_trend\nprereg_seq=2\nfamily=volatility\ntitle=EMA-21%2F55%20cross%20with%20NATR%20below%20median\nrationale=The%20normalised%20ATR%20%28NATR-14%2C%20the%20ATR%20as%20a%20percentage%20of%20price%29%20placed%20in%20its%20252-period%20rolling%20percentile%20classifies%20the%20regime%20without%20depending%20on%20the%20price%20level.%20Below%20its%20median%2C%20the%20typical%20travel%20per%20period%20is%20small%20relative%20to%20the%20position%20size%20anyone%20can%20hold%3A%20there%20are%20no%20stop%20sweeps%20and%20no%20liquidation%20chains%2C%20so%20whoever%20is%20on%20the%20right%20side%20of%20the%20EMA-21%2FEMA-55%20is%20not%20shaken%20out%20before%20the%20drift%20materialises.%20The%20trend%20signal%20is%20a%20fixed%20instrument%20here%3B%20what%20is%20being%20tested%20is%20the%20regime.\nprior=We%20expect%20a%20positive%20edge%2C%20and%20a%20greater%20one%20than%20that%20of%20the%20same%20unfiltered%20EMA-21%2F55%20signal.%20We%20expect%20it%20to%20fail%20if%20low%20volatility%20in%20BTC%20corresponds%20mainly%20to%20long%20accumulation%20ranges%20rather%20than%20to%20smooth%20trends%3A%20in%20that%20case%20the%20moving-average%20cross%20will%20give%20strings%20of%20false%20signals%20and%20the%20edge%20will%20be%20negative.%20It%20is%20the%20low%20half%20of%20the%20median%20split%3A%20together%20with%20%60natr_high_regime_trend%60%20it%20reconstructs%20the%20unfiltered%20signal%2C%20so%20the%20two%20cannot%20both%20be%20better%20than%20it.\nparams_json=%7B%22cutoff%22%3A%220.50000000%22%2C%22ema_fast%22%3A%2221%22%2C%22ema_slow%22%3A%2255%22%2C%22natr_period%22%3A%2214%22%2C%22percentile_window%22%3A%22252%22%7D\nparams_sha256=22ba4afab47f6986e475fbc578f985859e0e2d03ba1def7f3c2d74fe8a9f07d2\ncode_text=def%20_natr_low_regime_trend%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20return%20_natr_regime_trend%28s%2C%20high_vol%3DFalse%29%0A\ncode_sha256=80bae2c1f734ab0fc40668067a580f9ea50a53878ac63f0d3e6a7821479b556d\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":100,"row_hash":"44a4f5d2903f0de9a6df7b287a7ea032693f195c9dc8089700ea28c4d7413275","body":"wavelab-journal-chain\nv=3\nseq=100\nprev=9e73075282000d3bd29056277ab7004297e623614f5501788d584d37d21a3388\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.nr7_breakout\nprereg_seq=2\nfamily=volatility\ntitle=Break%20the%20narrowest%20range%20of%20seven%20candles\nrationale=Toby%20Crabel%27s%20NR7%3A%20the%20previous%20candle%20had%20the%20narrowest%20true%20range%20of%20the%20last%20seven.%20A%20local%20range%20minimum%20means%20buyers%20and%20sellers%20agreed%20on%20the%20price%20for%20a%20whole%20period%2C%20which%20concentrates%20the%20resting%20orders%20%28stops%20and%20limits%29%20into%20a%20very%20thin%20band.%20The%20next%20candle%20closing%20outside%20that%20band%20consumes%20those%20orders%20in%20one%20go%2C%20and%20the%20resulting%20imbalance%20is%20mechanical.%20It%20is%20the%20minimal%20version%20of%20the%20family%27s%20mechanism%3A%20contraction%20measured%20with%20no%20estimators%20and%20no%20long%20windows%2C%20only%20the%20range%20over%20seven%20candles.\nprior=We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%20break%2C%20with%20a%20horizon%20of%20a%20single%20candle.%20We%20expect%20it%20to%20be%20LARGER%20on%2015m%20and%201h%2C%20where%20the%20book%20of%20resting%20orders%20is%20significant%20relative%20to%20typical%20size%2C%20and%20to%20degrade%20or%20disappear%20on%204h%2C%20where%20a%20candle%20aggregates%20too%20many%20hands%20for%20any%20exploitable%20imbalance%20to%20be%20left.%20If%20the%20edge%20grew%20with%20the%20timeframe%20we%20would%20be%20measuring%20trend%2C%20not%20range%20contraction%2C%20and%20the%20hypothesis%20would%20be%20refuted%20even%20if%20the%20number%20were%20good.\nparams_json=%7B%22horizon_bars%22%3A%221%22%2C%22nr_window%22%3A%227%22%7D\nparams_sha256=fceb444464576b4255370e825443b91feae8d9e01a17a5f65d19461cd813edc5\ncode_text=def%20_nr7_breakout%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20min7%20%3D%20talib.MIN%28tr%2C%207%29%0A%20%20%20%20is_nr7%20%3D%20np.where%28np.isnan%28tr%29%20%7C%20np.isnan%28min7%29%2C%20np.nan%2C%20%28tr%20%3C%3D%20min7%29.astype%28float%29%29%0A%20%20%20%20nr7_prev%20%3D%20_shift%28is_nr7%2C%201%29%0A%20%20%20%20hi_prev%2C%20lo_prev%20%3D%20_shift%28h%2C%201%29%2C%20_shift%28l%2C%201%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28nr7_prev%29%20%7C%20np.isnan%28hi_prev%29%20%7C%20np.isnan%28lo_prev%29%29%20%26%20%28nr7_prev%20%3D%3D%201.0%29%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3E%20hi_prev%29%5D%20%3D%201%0A%20%20%20%20out%5Bok%20%26%20%28c%20%3C%20lo_prev%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=7298dbbaf99546e89376c7649404a9f68443e23905ac404e9cc5ad9c02e5071b\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":101,"row_hash":"6fe9c1d9ff45d60cb51d3bd7f76c1c050e48434ead5304b9128f0c7651a77a4c","body":"wavelab-journal-chain\nv=3\nseq=101\nprev=44a4f5d2903f0de9a6df7b287a7ea032693f195c9dc8089700ea28c4d7413275\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.rs_vol_pct_high_carry\nprereg_seq=2\nfamily=volatility\ntitle=Follow%20the%203-candle%20push%20in%20extreme%20volatility\nrationale=The%20opposite%20reading%20of%20the%20same%20state%3A%20in%20the%20top%20decile%20of%20realised%20volatility%2C%20forced%20liquidation%20is%20reflexive.%20Each%20liquidation%20moves%20price%20towards%20the%20next%20cluster%20of%20collateral%2C%20which%20liquidates%20in%20turn%3B%20the%20book%20empties%20out%20in%20the%20direction%20of%20the%20move%20and%20market%20makers%20pull%20their%20quotes%20instead%20of%20absorbing.%20Under%20that%20mechanism%2C%20the%20excess%20volatility%20is%20itself%20the%20signal%20that%20the%20cascade%20is%20still%20alive%2C%20and%20continuation%20dominates%20the%20retracement%20over%20a%20horizon%20of%20a%20few%20candles.\nprior=We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%203-candle%20move%2C%20but%20a%20SMALL%20one%20in%20net%20terms%2C%20because%20it%20trades%20exactly%20when%20spread%20and%20slippage%20are%20at%20their%20worst%3A%20it%20is%20a%20prediction%20that%20can%20be%20right%20in%20sign%20and%20still%20not%20survive%20costs%2C%20and%20that%20is%20how%20it%20must%20be%20evaluated.%20We%20expect%20it%20to%20fail%20at%20capitulation%20highs%2C%20where%20the%20last%20candle%20of%20the%20top%20decile%20is%20precisely%20the%20turn.%20It%20is%20the%20exact%20complement%20of%20%60rs_vol_pct_high_fade%60%3A%20registering%20them%20together%20makes%20it%20impossible%20to%20choose%20the%20sign%20after%20looking.\nparams_json=%7B%22impulse_bars%22%3A%223%22%2C%22percentile_window%22%3A%22252%22%2C%22rs_window%22%3A%2224%22%2C%22threshold%22%3A%220.90000000%22%7D\nparams_sha256=ae7c785e6f03ce73e37013f1d0de50b5bc23f29805b3e63443f7e637470fb39c\ncode_text=def%20_rs_vol_pct_high_carry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28_rs_vol%28s%2C%2024%29%2C%20252%29%0A%20%20%20%20prev%20%3D%20_shift%28c%2C%203%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20hot%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28prev%29%20%26%20%28rank%20%3E%200.90%29%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3E%20prev%29%5D%20%3D%201%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3C%20prev%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=270b6c223e0765595af3320b3c9050cc9ab02457b3279efdccf48e86d012bfec\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":102,"row_hash":"2cbe0283e81aa3251a9a99e4b298a1908d5125f1d08ecb387f790e49926d9f80","body":"wavelab-journal-chain\nv=3\nseq=102\nprev=6fe9c1d9ff45d60cb51d3bd7f76c1c050e48434ead5304b9128f0c7651a77a4c\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.rs_vol_pct_high_fade\nprereg_seq=2\nfamily=volatility\ntitle=Fade%20the%203-candle%20push%20in%20extreme%20volatility\nrationale=In%20the%20top%20decile%20of%20realised%20volatility%2C%20the%20move%20of%20the%20last%203%20candles%20is%20dominated%20by%20forced%20liquidations%3A%20the%20exchange%27s%20risk%20engine%20sells%20%28or%20buys%29%20at%20market%20without%20looking%20at%20the%20price%2C%20and%20whoever%20provides%20liquidity%20against%20that%20cascade%20demands%20a%20premium.%20If%20that%20premium%20is%20the%20large%20part%20of%20the%20displacement%2C%20price%20comes%20back%20once%20the%20cascade%20exhausts%20the%20available%20collateral%2C%20and%20the%20liquidity%20provider%20pockets%20the%20retracement.%20This%20hypothesis%20bets%20that%20the%20excess%20is%20a%20liquidity%20premium%2C%20not%20information.\nprior=We%20expect%20a%20positive%20edge%20from%20fading%20the%203-candle%20move.%20We%20expect%20it%20to%20FAIL%2C%20with%20a%20clearly%20negative%20edge%2C%20if%20high%20volatility%20in%20BTC%20is%20informative%20rather%20than%20mechanical%3A%20in%20March%202020%20or%20in%20the%20May%202021%20deleveraging%20the%20cascade%20ran%20for%20days.%20Since%20it%20is%20registered%20alongside%20its%20exact%20complement%20%60rs_vol_pct_high_carry%60%2C%20they%20cannot%20both%20win%3B%20if%20both%20come%20out%20indistinguishable%20from%20zero%2C%20the%20top%20volatility%20decile%20simply%20contains%20no%20directional%20signal%20and%20both%20must%20be%20published%20as%20failures.\nparams_json=%7B%22impulse_bars%22%3A%223%22%2C%22percentile_window%22%3A%22252%22%2C%22rs_window%22%3A%2224%22%2C%22threshold%22%3A%220.90000000%22%7D\nparams_sha256=ae7c785e6f03ce73e37013f1d0de50b5bc23f29805b3e63443f7e637470fb39c\ncode_text=def%20_rs_vol_pct_high_fade%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28_rs_vol%28s%2C%2024%29%2C%20252%29%0A%20%20%20%20prev%20%3D%20_shift%28c%2C%203%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20hot%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28prev%29%20%26%20%28rank%20%3E%200.90%29%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3E%20prev%29%5D%20%3D%20-1%0A%20%20%20%20out%5Bhot%20%26%20%28c%20%3C%20prev%29%5D%20%3D%201%0A%20%20%20%20return%20out%0A\ncode_sha256=f6aab84d4b405b35ca021b7b80a582d4c046775e0ed95dbb7e70cb80fb208d61\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":103,"row_hash":"8ff34f3eb043e292fe1a6dee8c1d16806935544c4f6b43c1723972d7dfec1e3b","body":"wavelab-journal-chain\nv=3\nseq=103\nprev=2cbe0283e81aa3251a9a99e4b298a1908d5125f1d08ecb387f790e49926d9f80\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.rs_vol_pct_low_carry\nprereg_seq=2\nfamily=volatility\ntitle=Quiet%20RS%20volatility%2C%20follow%20the%20EMA-55\nrationale=Rogers-Satchell%20realised%20volatility%20over%2024%20candles%2C%20placed%20in%20its%20252-period%20rolling%20percentile%2C%20measures%20whether%20the%20market%20is%20quiet%20RELATIVE%20TO%20ITSELF%20rather%20than%20relative%20to%20an%20absolute%20threshold%20that%20BTC%27s%20price%20inflation%20would%20render%20obsolete.%20With%20volatility%20in%20the%20bottom%20quintile%2C%20whoever%20is%20positioned%20is%20not%20being%20shaken%20out%20by%20noise%3A%20the%20cost%20of%20holding%20a%20trend%20position%20falls%2C%20forced%20liquidations%20stop%20and%20the%20drift%20accumulates%20without%20interruption.%20We%20give%20the%20direction%20with%20price%20against%20the%20EMA-55%2C%20deliberately%20trivial%2C%20because%20what%20is%20being%20tested%20here%20is%20the%20volatility%20GATE%2C%20not%20the%20trend%20detector.\nprior=We%20expect%20a%20positive%20edge%20while%20volatility%20is%20in%20the%20low%20quintile%2C%20and%20for%20that%20edge%20to%20be%20GREATER%20than%20that%20of%20the%20same%20direction%20rule%20unfiltered.%20We%20expect%20it%20to%20fail%20in%20two%20specific%20places%3A%20%28a%29%20after%20a%20structural%20fall%20in%20the%20level%20of%20volatility%20%28a%20prolonged%20range%29%2C%20where%20the%20percentile%20stays%20pinned%20at%20the%20bottom%20and%20the%20signal%20trades%20a%20range%20with%20no%20trend%3B%20%28b%29%20on%201d%2C%20where%20252%20candles%20are%20a%20whole%20year%20and%20the%20percentile%20drags%20an%20old%20regime%20along%20with%20it.%20If%20the%20edge%20were%20equal%20to%20or%20smaller%20than%20that%20of%20the%20unfiltered%20EMA-55%2C%20the%20volatility%20gate%20adds%20nothing.%20AUDIT%20NOTE%20%282026-09-08%29%3A%20that%20unfiltered%20arm%20was%20not%20registered%2C%20so%20neither%20this%20hypothesis%27s%20falsification%20criterion%20nor%20%60bbw_pct_low_carry%60%27s%20could%20be%20run%3B%20it%20has%20been%20registered%20as%20%60volatility.ema55_side_unfiltered%60%20and%20that%20is%20what%20both%20must%20be%20measured%20against.\nparams_json=%7B%22ema_direction%22%3A%2255%22%2C%22percentile_window%22%3A%22252%22%2C%22rs_window%22%3A%2224%22%2C%22threshold%22%3A%220.20000000%22%7D\nparams_sha256=4024ca4476bc02757f2ec758ccaa008f2804eccf3317a0e5eb99d9bd28fb09b5\ncode_text=def%20_rs_vol_pct_low_carry%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_%2C%20_%2C%20_%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20rank%20%3D%20_rolling_rank%28_rs_vol%28s%2C%2024%29%2C%20252%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2055%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20quiet%20%3D%20~np.isnan%28rank%29%20%26%20~np.isnan%28ema%29%20%26%20%28rank%20%3C%200.20%29%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3E%20ema%29%5D%20%3D%201%0A%20%20%20%20out%5Bquiet%20%26%20%28c%20%3C%20ema%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=2835757cf2328138b59caaa3819780ade88c2f643e253d4cd7d292d90b9156e4\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=300\neffective_from_ms=1790242821226\n"} {"seq":104,"row_hash":"e90bf6a0067aebd40f96daa28d06076f8f5a4f3cec7b5a0f91d9c5ba2f24d26f","body":"wavelab-journal-chain\nv=3\nseq=104\nprev=8ff34f3eb043e292fe1a6dee8c1d16806935544c4f6b43c1723972d7dfec1e3b\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.squeeze_bb_kc_release\nprereg_seq=2\nfamily=volatility\ntitle=Bollinger%20inside%20the%20Keltner%2C%20trade%20the%20release\nrationale=When%20the%20Bollinger%20bands%20%2820%2C%202%CF%83%29%20fit%20inside%20the%20Keltner%20channel%20%28EMA-20%20%C2%B1%201.5%C2%B7ATR-20%29%2C%20the%20dispersion%20of%20closes%20has%20sunk%20below%20the%20true%20range%3A%20the%20market%20is%20trading%20in%20a%20handkerchief%20while%20there%20is%20still%20intra-candle%20travel.%20That%20state%20is%20manufactured%20by%20market%20makers%20and%20volatility%20sellers%20who%20narrow%20spreads%20and%20accumulate%20short%20gamma%2C%20and%20by%20range%20traders%20who%20place%20stops%20just%20outside%20the%20handkerchief.%20When%20price%20leaves%2C%20those%20same%20participants%20have%20to%20hedge%20in%20the%20direction%20of%20the%20move%20and%20the%20stops%20execute%20at%20market%2C%20so%20the%20flow%20that%20follows%20the%20break%20is%20forced%2C%20not%20discretionary.\nprior=We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%20break%20relative%20to%20the%2020-period%20moving%20average%2C%20concentrated%20in%20the%20first%20candles%20after%20the%20release.%20We%20expect%20it%20to%20FAIL%2C%20with%20a%20negative%20edge%2C%20when%20the%20compression%20happens%20inside%20a%20wide%20higher-order%20range%20%28a%20false%20break%20that%20reverts%20to%20the%20middle%29%20and%20on%2015m%2C%20where%20the%20%27squeeze%27%20is%20often%20an%20overnight%20liquidity%20hole%20rather%20than%20an%20accumulation%20of%20positioning.%20If%20the%20edge%20turned%20out%20to%20be%20indistinguishable%20from%20zero%20on%20all%20three%20timeframes%2C%20the%20short-gamma%20mechanism%20is%20not%20operating%20in%20BTC%20at%20candle%20resolution.\nparams_json=%7B%22bb_period%22%3A%2220%22%2C%22bb_sigma%22%3A%222.00000000%22%2C%22kc_atr%22%3A%2220%22%2C%22kc_mult%22%3A%221.50000000%22%2C%22kc_period%22%3A%2220%22%7D\nparams_sha256=a52c3a7d4fa40d0f639d31403554936dd37d32be601afabe37460c7921801466\ncode_text=def%20_squeeze_release%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20_o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20up%2C%20mid%2C%20lo%20%3D%20talib.BBANDS%28c%2C%2020%2C%202.0%2C%202.0%2C%200%29%0A%20%20%20%20ema%20%3D%20talib.EMA%28c%2C%2020%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2020%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28up%29%20%7C%20np.isnan%28lo%29%20%7C%20np.isnan%28mid%29%20%7C%20np.isnan%28ema%29%20%7C%20np.isnan%28atr%29%29%0A%0A%20%20%20%20sq%20%3D%20np.zeros%28c.size%2C%20dtype%3Dbool%29%0A%20%20%20%20kc_up%20%3D%20ema%20%2B%201.5%20%2A%20atr%0A%20%20%20%20kc_lo%20%3D%20ema%20-%201.5%20%2A%20atr%0A%20%20%20%20sq%5Bok%5D%20%3D%20%28up%5Bok%5D%20%3C%20kc_up%5Bok%5D%29%20%26%20%28lo%5Bok%5D%20%3E%20kc_lo%5Bok%5D%29%0A%0A%20%20%20%20prev_sq%20%3D%20np.zeros%28c.size%2C%20dtype%3Dbool%29%0A%20%20%20%20prev_sq%5B1%3A%5D%20%3D%20sq%5B%3A-1%5D%0A%20%20%20%20release%20%3D%20prev_sq%20%26%20~sq%20%26%20ok%0A%0A%20%20%20%20entry%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20entry%5Brelease%20%26%20%28c%20%3E%20mid%29%5D%20%3D%201%0A%20%20%20%20entry%5Brelease%20%26%20%28c%20%3C%20mid%29%5D%20%3D%20-1%0A%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20cur%20%3D%200%0A%20%20%20%20for%20i%20in%20range%28c.size%29%3A%0A%20%20%20%20%20%20%20%20if%20cur%20%3D%3D%201%20and%20%28sq%5Bi%5D%20or%20%28ok%5Bi%5D%20and%20c%5Bi%5D%20%3C%20mid%5Bi%5D%29%29%20or%20cur%20%3D%3D%20-1%20and%20%28sq%5Bi%5D%20or%20%28ok%5Bi%5D%20and%20c%5Bi%5D%20%3E%20mid%5Bi%5D%29%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%200%0A%20%20%20%20%20%20%20%20e%20%3D%20int%28entry%5Bi%5D%29%0A%20%20%20%20%20%20%20%20if%20e%20%21%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20cur%20%3D%20e%0A%20%20%20%20%20%20%20%20out%5Bi%5D%20%3D%20cur%0A%20%20%20%20return%20out%0A\ncode_sha256=a192f51ef98fdef03844107ee92d3f0b89a40eb147e4d9fcc36d1fdcfba276d9\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%221d%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"} {"seq":105,"row_hash":"cee54f7e6e8fdf59fbe75810704eeb3d74455b02ac50c41c9d398203b435c46a","body":"wavelab-journal-chain\nv=3\nseq=105\nprev=e90bf6a0067aebd40f96daa28d06076f8f5a4f3cec7b5a0f91d9c5ba2f24d26f\nkind=strategy_binding\nwritten_ms=1790242761226\nwriter_id=genesis\nengine_sha=deb9545\nprovenance=clean\nclock_source=systemd-timesyncd%3Atime.google.com\nclock_skew_ms=0\nschema_sha256=8c88969017eaf875e7e4727790b7a27456bd808cac94e8f9a5b59b3d973ff425\nstrategy_id=volatility.wide_range_thrust\nprereg_seq=2\nfamily=volatility\ntitle=Wide%20candle%20out%20of%20a%20quiet%20base\nrationale=Range%20expansion%20AFTER%20contraction%2C%20which%20is%20the%20direct%20formulation%20of%20%27big%20moves%20are%20born%20in%20quiet%20periods%27%3A%20we%20require%20the%20previous%20candle%27s%20ATR-14%20to%20have%20been%20below%20its%20100-candle%20median%20%28contraction%29%20and%20the%20current%20true%20range%20to%20exceed%20twice%20that%20ATR%20%28expansion%29.%20A%20candle%20like%20that%2C%20coming%20out%20of%20a%20quiet%20base%2C%20is%20not%20produced%20by%20dispersed%20retail%20flow%3A%20it%20is%20produced%20by%20a%20large%20participant%20who%20needs%20to%20execute%20and%20accepts%20paying%20the%20range%2C%20or%20by%20a%20cluster%20of%20stops%20being%20triggered.%20The%20direction%20is%20given%20by%20the%20candle%27s%20body%2C%20close%20against%20open%2C%20because%20that%20is%20what%20reveals%20who%20won%20the%20exchange.\nprior=We%20expect%20a%20positive%20edge%20in%20the%20direction%20of%20the%20body%2C%20with%20a%20horizon%20of%20one%20candle.%20We%20expect%20it%20to%20FAIL%20clearly%20when%20the%20thrust%20is%20a%20reaction%20to%20a%20one-off%20news%20item%20that%20is%20entirely%20retraced%20over%20the%20following%20candles%20%28a%20typical%20pattern%20in%20BTC%20with%20regulatory%20announcements%29%2C%20and%20on%201d%2C%20where%20an%20expansion%20candle%20is%20usually%20already%20the%20end%20of%20the%20move%20and%20not%20its%20beginning.%20If%20the%20edge%20were%20consistently%20negative%2C%20the%20correct%20mechanism%20would%20be%20exhaustion%20and%20not%20the%20start%20of%20an%20expansion.\nparams_json=%7B%22atr_period%22%3A%2214%22%2C%22expansion_mult%22%3A%222.00000000%22%2C%22horizon_bars%22%3A%221%22%2C%22median_window%22%3A%22100%22%7D\nparams_sha256=92a66a811e6a7147bc86e30c3dd94df7bb51a17233c87f38de240e3308f4cfe5\ncode_text=def%20_wide_range_thrust%28s%3A%20Series%29%20-%3E%20np.ndarray%3A%0A%20%20%20%20o%2C%20h%2C%20l%2C%20c%20%3D%20_ohlc%28s%29%0A%20%20%20%20tr%20%3D%20talib.TRANGE%28h%2C%20l%2C%20c%29%0A%20%20%20%20atr%20%3D%20talib.ATR%28h%2C%20l%2C%20c%2C%2014%29%0A%20%20%20%20atr_prev%20%3D%20_shift%28atr%2C%201%29%0A%20%20%20%20rank_prev%20%3D%20_shift%28_rolling_rank%28atr%2C%20100%29%2C%201%29%0A%20%20%20%20out%20%3D%20np.zeros%28c.size%2C%20dtype%3Dnp.int8%29%0A%20%20%20%20ok%20%3D%20~%28np.isnan%28tr%29%20%7C%20np.isnan%28atr_prev%29%20%7C%20np.isnan%28rank_prev%29%29%0A%20%20%20%20thrust%20%3D%20ok%20%26%20%28rank_prev%20%3C%200.50%29%20%26%20%28tr%20%3E%202.0%20%2A%20atr_prev%29%0A%20%20%20%20out%5Bthrust%20%26%20%28c%20%3E%20o%29%5D%20%3D%201%0A%20%20%20%20out%5Bthrust%20%26%20%28c%20%3C%20o%29%5D%20%3D%20-1%0A%20%20%20%20return%20out%0A\ncode_sha256=0a12287f73e536a2264f8511de9a2153bc531f8d35dbaf35dae4473dc50f226f\ncode_source_uri=src%2Fwavelab%2Fhypotheses%2Fvolatility.py\nruntime_json=%7B%22numpy%22%3A%222.5.3%22%2C%22platform%22%3A%22linux-x86_64%22%2C%22python%22%3A%223.13%22%2C%22ta-lib%22%3A%220.7.1%22%2C%22ta-lib-c%22%3A%220.7.1%22%7D\nsymbols_json=%5B%22BTCUSDT%22%5D\ntimeframes_json=%5B%2215m%22%2C%221h%22%2C%224h%22%5D\nmin_warmup=200\neffective_from_ms=1790242821226\n"}