OpenBB icon indicating copy to clipboard operation
OpenBB copied to clipboard

[Bug] Stocks/Load - Last Price != Last Price

Open deeleeramone opened this issue 2 years ago • 7 comments

It seems that 'last price' is being procured from 'previous close' instead of 'last price'.

image

Screenshot 2023-01-03 at 11 52 08 AM

deeleeramone avatar Jan 03 '23 19:01 deeleeramone

Yeah this needs to be update to say "Previous Close". Although if you specify an end date, it will give the price at that point, as it gives the last price in the df, so its technically "last price you asked for"

I think this is a good first issue and will add the tag!

jmaslek avatar Jan 03 '23 20:01 jmaslek

Wouldn't it be a lot better to just get the actual last price? That would make the 1-day return accurate as well.

deeleeramone avatar Jan 03 '23 23:01 deeleeramone

Not if you specify an end date. And Getting the yf last price takes another 1.7 seconds for me me which is just slightly too irritating for my liking

This is probably at the point where there are slightly too many edge cases and it's better to nix this is favor of a function that calculates some of this info directly

jmaslek avatar Jan 03 '23 23:01 jmaslek

it really should, because loading from other sources breaks when this part fails. think, brk-a vs. brk.a

deeleeramone avatar Jan 04 '23 01:01 deeleeramone

load brk.b --source Polygon

Screenshot 2023-01-03 at 5 03 58 PM

deeleeramone avatar Jan 04 '23 01:01 deeleeramone

https://github.com/OpenBB-finance/OpenBBTerminal/blob/main/openbb_terminal/stocks/stocks_helper.py#L1069

Is that one to change "Last Price" to "Previous Close"

qmarsun avatar Jan 04 '23 17:01 qmarsun

Something is not correct in my local dev I changed that line but not seeing the changes to myself . Where can I find steps to test locally the code change

qmarsun avatar Jan 06 '23 21:01 qmarsun