@@ -193,8 +193,8 @@ def test_public_trades_mock_populate_dataframe_with_trades__check_orderflow(
193193 assert pytest .approx (results ["delta" ]) == - 20.862
194194 assert pytest .approx (results ["min_delta" ]) == - 54.559999
195195 assert 82.842 == results ["max_delta" ]
196- assert results ["stacked_imbalances_bid" ] == [234.99 ]
197- assert results ["stacked_imbalances_ask" ] == [234.96 ]
196+ assert results ["stacked_imbalances_bid" ] == [234.97 ]
197+ assert results ["stacked_imbalances_ask" ] == [234.94 ]
198198
199199 # Repeat assertions for the last row
200200 results = df .iloc [- 1 ]
@@ -586,22 +586,22 @@ def test_stacked_imbalances_multiple_prices():
586586 # Create a sample DataFrame with known imbalances
587587 df = pd .DataFrame (
588588 {
589- 'bid_imbalance' : [True , True , True , False , False , True , True , False ],
590- 'ask_imbalance' : [False , False , True , True , True , False , False , True ]
589+ 'bid_imbalance' : [True , True , True , False , False , True , True , False , True ],
590+ 'ask_imbalance' : [False , False , True , True , True , False , False , True , True ]
591591 },
592- index = [234.95 , 234.96 , 234.97 , 234.98 , 234.99 , 235.00 , 235.01 , 235.02 ]
592+ index = [234.95 , 234.96 , 234.97 , 234.98 , 234.99 , 235.00 , 235.01 , 235.02 , 235.03 ]
593593 )
594594 # Test bid imbalances (should return prices in ascending order)
595595 bid_prices = stacked_imbalance (df , "bid" , stacked_imbalance_range = 2 , should_reverse = False )
596- assert bid_prices == [234.95 , 234.96 , 234.97 , 235.00 , 235.01 ]
596+ assert bid_prices == [234.95 , 234.96 , 235.00 ]
597597
598598 # Test ask imbalances (should return prices in descending order)
599599 ask_prices = stacked_imbalance (df , "ask" , stacked_imbalance_range = 2 , should_reverse = True )
600- assert ask_prices == [235.02 , 234.99 , 234. 98 , 234.97 ]
600+ assert ask_prices == [235.02 , 234.98 , 234.97 ]
601601
602602 # Test with higher stacked_imbalance_range
603603 bid_prices_higher = stacked_imbalance (df , "bid" , stacked_imbalance_range = 3 , should_reverse = False )
604- assert bid_prices_higher == [234.95 , 234.96 , 234.97 ]
604+ assert bid_prices_higher == [234.95 ]
605605
606606
607607
0 commit comments