
    EBj                    B    d dl mZ d dlmZ d dlmZ d
dZd
dZd
dZd	S )    )annotations)	BotConfig)calculate_position_sizereturnNonec                     t          dddddd          } t          ddd	d
|           }|j        dk    sJ t          |j        d          dk    sJ |j        dk    sJ |j        dk    sJ |j        dk    sJ d S )N     @@g      ?risk      9@      Y@      (@wallet_equity_usdcrisk_per_trade_pctposition_sizing_modemax_position_margin_pctmax_position_notional_pctmin_order_notional_usdETH      @       @coincurrent_priceleveragestop_distance_pctcfgg     @o@   goTT@g      @g      @)r   r   notional_usdround
margin_usdsizerisk_usd	capped_byr   decisions     tests/test_position_sizing.py@test_risk_based_position_size_uses_wallet_risk_and_stop_distancer(      s    
 # $"'#  C '  H  E))))$a((G3333=C####''''''    c                     t          dddddd          } t          dd	d
d|           }|j        dk    sJ |j        d	k    sJ |j        d
k    sJ |j        dk    sJ d S )Nr	   r   r
   g      $@r   r   r   ORDIg      I@r   r   g     b@
margin_cap)r   r   r   r!   r"   r$   r%   s     r'   :test_position_size_respects_margin_cap_before_live_scalingr-       s    
 # $"'#  C '  H  E))))$&&&&=C------r)   c                     t          ddd          } t          dddd| 	          }|j        dk    sJ |j        d
k    sJ |j        dk    sJ d S )Nfixedg      .@r   )r   trade_size_usdr   SOLr   r   r   r   g333333?)r   r   r   r"   r$   r%   s     r'   =test_fixed_position_size_keeps_research_sampler_compatibilityr2   8   s}    
^b
c
c
cC&  H  D((((=C((((((r)   N)r   r   )	
__future__r   configr   position_sizingr   r(   r-   r2    r)   r'   <module>r7      s    " " " " " "       3 3 3 3 3 3( ( ( (2. . . .0) ) ) ) ) )r)   