
    j^                    4    d Z ddlmZ ddlZdZdZddZd	dZy)
z?Causal multi-timescale companions for the dense MLP experiment.    )annotationsN)

stoch_normosc_normm3_momentum_normvwap_div_normoi_roc_normusdt_d_norm
basis_normcvd_norm	rvol_normbb_pct_b_norm)      c                 Z    t         D  cg c]  } t        D ]	  }|  d|   c}} S c c}} w )N_ema)TEMPORAL_BASE_COLSTEMPORAL_SPANS)columnspans     K/Users/jameslopez/projects/TradingBot25/strategies/mlp_temporal_features.pytemporal_feature_colsr      s0    0B^0Bf~tvhd4&!~!0B^^^s   'c                Z   t         D cg c]  }|| j                  vs| }}|rt        d|       t               }t         D ]`  }t	        j
                  | |   d      j                  d      }t        D ],  }|j                  |dd      j                         | | d| <   . b |S c c}w )	zFAdd past-and-current-only EMA summaries and return their column names.z8Cannot build temporal features; missing source columns: coerce)errorsg        F   )r   adjustmin_periodsr   )
r   columns
ValueErrorr   pd
to_numericfillnar   ewmmean)dfr   missingr   valuesr   s         r   inject_temporal_featuresr(      s    $6S$6&&

:Rv$6GSST[S\]^^#%G$r&z(;BB3G"D(.

UXY
(Z(_(_(aB&dV$% # % N Ts
   B(B()return	list[str])r%   zpd.DataFramer)   r*   )	__doc__
__future__r   pandasr    r   r   r   r(        r   <module>r0      s(    E "  
 _
r/   