bfolkens / py-market-profile

A library to calculate Market Profile (aka Volume Profile) for financial data from a Pandas DataFrame.
Other
356 stars 122 forks source link

Some questions about parameters #15

Closed Ben0ni closed 2 years ago

Ben0ni commented 2 years ago

Hi, I feed confused about the parameter row_size. self.row_size = kwargs.pop('row_size', self.tick_size * self.prices_per_row)

If I want 24 row_size, I use the following code: mp = MarketProfile(test_data, row_size=24, mode='vol') However, sometimes the results will be 25 rows or 26 rows. Also, I think if I give a number for row_size, the tick_size and prices_per_row will not affect the result.

Could you help me to solve that? Thank you very much.

pukanc commented 2 years ago

Hello @Ben0ni ,

Did you manage to find a solution?

Thank you :)

Ben0ni commented 2 years ago

@pukanc No, I still don't know how to fix it.

bfolkens commented 2 years ago

@Ben0ni - Yes, the row_size parameter defaults to tick_size * prices_per_row if not set. Also, the row_size is more of a hint than an absolute, since the row is determined by ceil(x / row_size) * row_size - so depending on how the quantization works out you might end up on either side.