mplfinance
mplfinance copied to clipboard
PNF return_calculated_values --> miny / maxy not correct
I have noticed the miny / maxy might not be correct in the return_calculated_values of PNF (maybe in renko as well?)
The returned values:
miny 137.33999633789065 maxy 181.83999633789065
The chart:
Further, how is minx and maxx to be interpreted, as the x-achis is a timeline, but the values are decimal? minx -0.9777777777777777 maxx 44.977777777777774
minx
,maxx
to be interpreted as the "column number" that is furthest to the left and furthest to right, respectively, on the x-axis. (In your example, the actual first column may be plotted at approximately 0.0, the x-axis starts at -0.97). The actual dates (for the columns) are returned as ['pnf_dates' ]
in the calculated values dict, and thus the minx date and maxx date would be the first and last elements of that list.
will look into the miny
,maxy
issue.
Another issue, which I now relate to this observation is, that if i plot as tight_layout, then it doesn't plot the complete range. I guess this is an resulting error from the wrong miny and maxy:
tight_layout = true
tight_layout = false
hmm. yes, that's a problem. the type of matplotlib axis objects that mplfinance uses do not support matplotlib's tight_layout, therefore mplfinance internally implements its own tight_layout, and obviously the existing algorithm doesn't work correctly for pnf and renko plots. as you mentioned, this probably related (whole or in part) to the calculation of min and max y.
I am unable to reproduce the maxy
,miny
and tight_layout issue
. Perhaps it is data related. Can you please post your data as a csv file, and code, to reproduce the above plots?
Please find attached the code and the data. Sorry, could not figure out how to provide the code in a proper way than as text file