webull icon indicating copy to clipboard operation
webull copied to clipboard

How to calculate MACD to match Webull number?

Open Alanavai opened this issue 2 years ago • 3 comments

Hello,

I've looked at several ways to calculate the MACD indicator but the numbers seem to always be off of what Webull shows. Does anybody know of a way to get the accurate numbers?

Thanks

Alanavai avatar Jul 14 '22 13:07 Alanavai

I don't know if it will be exactly the same as webull but you can use python stock indicators:

https://daveskender.github.io/Stock.Indicators.Python/indicators/Macd/#content

When I use it, it is sometimes off by a little but I don't know why. Webull probably calculates everything slightly differently.

ICANTFINDAUSERNAMEATALL avatar Aug 10 '22 22:08 ICANTFINDAUSERNAMEATALL

The only way to really know if it’s accurate is to calculate it manually and compare. I have both code example in C#, the underlying algo for that Python package, and a manually calculated spreadsheet that you can drop in your raw quotes that might help. One side note, MACD can have convergence related errors in early warmup periods:

:hourglass: Convergence warning: The first S+P+250 periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.

Where S is slow periods and P is signal periods

DaveSkender avatar Dec 15 '22 05:12 DaveSkender

Sometimes it’s easier and more performant to just fetch the quotes from your provider API, then just use one of these PyPI or Nuget packages to compute the indicators.

DaveSkender avatar Dec 15 '22 06:12 DaveSkender