Code Monkey home page Code Monkey logo

Comments (1)

twopirllc avatar twopirllc commented on May 27, 2024

Hello @ibrahimmina,

Pandas TA is focused primarily on TA Lib which is the de facto library of indicators and testing indicators against it is relatively easy. TradingView (TV) is secondary and is ubiquitous. Running TV tests are possible, but require a paid TV account and some manual work before exporting from TV.

On the other hand, all the other trading and financial data platforms like Think or Swim, Trade Station, Yahoo Finance, et al are black boxed systems where the exportation of both ohlcv and indicator values range from cumbersome to impossible. Without easily exportable data, comparing hundreds of indicator values via charts from these platforms is not only extremely slow to manually do but also error prone. Thus these platforms will not be covered on a free basis. However Pandas TA is open source so you or anyone else are welcome to modify or extend the functionality however they want and submit a pull request if they would like it included.

I have compared the output with Yahoo Finance and it seems that the numbers are mismatching

You passed all of ohlcv into ad.

stock.ta.ad(high=stock['high'], low=stock['low'], close=stock['close'],volume=stock['volume'], open_=stock['Open'])

However ad is one of the few indicators where one or more Series is option-able. In particular, ad does not require the open for it's calculation . So it is possible that Yahoo Finance also does not include open values in their calculation, only hlcv. But I don't know for sure. 🤷🏼‍♂️ So you could try excluding open like so:

stock.ta.ad(high=stock['high'], low=stock['low'], close=stock['close'], volume=stock['volume'])

Since you are calling ad from the DataFrame Extension .ta.ad(), you can simplify your code as follows:

stock.ta.ad()
# or 
stock.ta.ad(append=True)  # if you want/need to append the results to the stock DataFrame

Additionally, I noticed that you are pulling data from Polygon which may or may not be an exact copy of Yahoo Finance data. If they are different, then you are comparing apples with oranges which is common mistake.

Finally, it is good practice to read the indicator documentation, help(ta.ad), and/or view the source code and try all possible variations if the default parameters do not return as expected before submitting a Bug issue.

Kind Regards,
KJ

from pandas-ta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.