
    %g                         d  Z d ZdZ e e          \  ZZ ee                                          Z ee                                          Z e	de            e	de            eee           dS )c                    i }i }t          | d          5 }d }|D ]}|                                }|dk    rd}|dk    rd}(|r|                    d          \  }}t          |                    d          d                   }t          |                    d          d                   }|dk    r|||<   |dk    r|||<   	 d d d            n# 1 swxY w Y   ||fS )	NrzBids:bidszAsks:asksz, z:    )openstripsplitfloat)filenamer   r   filecurrent_sectionlinepricequantitys           /var/www/html/data/total.pyread_orderbook_from_filer      sD   DD	h		 + 	+ 	+D::<<Dw"("( +"&**T"2"2xekk$//233 !5!5a!899"f,,"*DKK$.."*DK	++ + + + + + + + + + + + + + +  :s   B/CCCc                 N   t          |                                           dz  t          fd|                                 D                       }t          fd|                                D                       }t	          d|           t	          d|           d S )Ng?c              3   4   K   | ]\  }}|z
  k    |V  d S N .0r   r   highest_bid_price	thresholds      r   	<genexpr>z3print_bids_asks_within_5_percent.<locals>.<genexpr>   E       &e &e$UHUFWZcFc=c=c=c=c=c=c&e &e    c              3   4   K   | ]\  }}|z   k    |V  d S r   r   r   s      r   r   z3print_bids_asks_within_5_percent.<locals>.<genexpr>   r   r   z$Total Bids within 5% of Highest Bid:z$Total Asks within 5% of Highest Bid:)maxkeyssumitemsprint)	bids_data	asks_datatotal_bids_within_thresholdtotal_asks_within_thresholdr   r   s       @@r    print_bids_asks_within_5_percentr(      s    INN,,--((I"% &e &e &e &e &e(1(9(9&e &e &e #e #e"% &e &e &e &e &e(1(9(9&e &e &e #e #e 

02MNNN	
02MNNNNNr   zorderbook.txtzTotal Bids:zTotal Asks:N)
r   r(   orderbook_filenamer$   r%   r!   values
total_bids
total_asksr#   r   r   r   <module>r-      s     ,	O 	O 	O % //0BCC 	9 S!!##$$
S!!##$$
 mZ       mZ          I 6 6 6 6 6r   