
    JSj                    Z    d dl mZ d dlmZmZ d dlmZ d dlmZ dZ	dZ
h dZddZddZdS )    )annotations)Decimal
ROUND_DOWN)OrderIntent)TrendRetestFeatures6research_v77_2_relative_strength_momentum_continuationzv77.2.0>   BTCETHLINKfeaturer   return	list[str]c                ,   g }| j         t          vr|                    d           | j        s|                    | j        pd           | j        t          d          k     r|                    d           | j        t          d          k    r|                    d           | j	        t          d          k    r|                    d           | j
        | j        k    s| j        | j
        k    r|                    d           | j        | j        k    r|                    d	           | j        t          d
          k     r|                    d           | j        dk    r|                    d           | j        t          d          k     r|                    d           | j        dk    r|                    d           | j        t          d          k    s| j        t          d          k    r|                    d           | j        | j        k    r|                    d           | j        s|                    d           | j        t          d          k     r|                    d           | j        t          d          k     r|                    d           | j        t          d          k    r|                    d           | j
        dk    r/| j        | j
        z  t          d          z
  t          d          z  nt          d          }|t          d           k    r|                    d!           | j        t          d"          k    r|                    d#           t1          t2                              |                    S )$Ncoin_not_momentum_universe)data_quality25000000weak_liquidityz0.06spread_too_wideimpact_slippage_too_hightrend_1h_not_bullishtrend_4h_not_bullish60breadth_not_supportive   not_top_two_relative_strengthz0.40momentum_not_establishedr   latest_close_not_positivez0.90z2.50momentum_overheatedbreakout_close_missingtwo_close_confirmation_missingz1.05volume_confirmation_missing52rsi_momentum_missing72rsi_overheated11009991.50too_far_above_1h_trendz0.020funding_too_crowded)coinMOMENTUM_COINSappenddata_quality_allowedextenddata_quality_reasons
volume_24hr   
spread_pctbuy_impact_1k_pctsma_1h_fastsma_1h_slow	close_15msma_4h_fastsma_4h_slowbreadth_positive_pctstrength_rankmove_1h_pctmove_15m_pctrecent_highcontinuation_closes_confirmedvolume_ratiorsi_15mfunding_rate_hourly_pctlistdictfromkeys)r   blockersdistance_above_fasts      2src/strategies/relative_strength_momentum_v77_2.pymomentum_blockersrI      s[   H|>))4555' K4I8IJJJGJ////()))GFOO++)*** 76??222333g111W5F'J]5]5].///g111.///#gdmm330111q  7888WV__,,2333q  3444gfoo--1Dwv1V1V-...G///01110 :8999gfoo--5666&&.///&&()))gngz}~g~g~7,w/BBWS\\QU\]bUcUccc  EL  MR  ES  ESWV__,,0111&)9)999-...h''(((    client_order_idstrOrderIntent | Nonec          
     *   t          |           rd S | j        }|dk    rd S t          d          }t          t          d          t	          t          d          | j        t          d          z                      }|t          d          |t          d          z  z
  z  }|||z
  t          d          z  z   }||z                      t          d	          t          
          }||z  t          d          z  }t          d!i dt          d| j
         dd| j
        ddddddddd|dd dd d|                    t          d	          t          
          d|                    t          d	          t          
          d|ddd|d |S )"Nr   10z0.65z0.75z0.80r&   r'   r)   z
0.00000001)roundingstrategy_idsymbolz
/USDC:USDCr,   sidebuyreduce_onlyF
order_typemarkettifIocsizepricetrigger_price	stop_losstake_profitrK   reason:relative_strength_two_close_momentum_continuation_researchrisk_usdestimated_notional_usd )rI   current_pricer   maxminatr_pctquantizer   r   MOMENTUM_RESEARCH_IDr,   )	r   rK   r[   notionalstop_distance_pctstopr^   rZ   ra   s	            rH   build_momentum_intentrm   9   s   !! t!Ezztt}}HGFOOS'/T[\bTcTcBc-d-deeGCLL#4wu~~#EEFD54<76??::Ku&&w|'<'<z&RRD++genn<H   ((,**** \\ U	
 E 8 E T d d -- 5 5
-KKK  (()>)>(TTT ( LK    (x! rJ   N)r   r   r   r   )r   r   rK   rL   r   rM   )
__future__r   decimalr   r   src.execution.order_intentr    src.market.trend_retest_featuresr   ri   MOMENTUM_VERSIONr-   rI   rm   rc   rJ   rH   <module>rs      s    " " " " " " ' ' ' ' ' ' ' ' 2 2 2 2 2 2 @ @ @ @ @ @O  ''')) )) )) ))X     rJ   