alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.59k stars 375 forks source link

technical.py retrieval of price #284

Open kungouf opened 3 years ago

kungouf commented 3 years ago

Hello,

Could the price also be retrieved in the result of technical.py, as the technical has to be linked to the analytic the exact time it is corresponding to the price action?

the price + analytics (CCI for instance) can be retrieved in the same page below, if you could just include the price it would be a huge improvement, as the exact technical as to correspond to an exact time stamp and price to be relevant for analysis. so maybe adding the price would be just doing an incredible job. the timestamp would be necessary in order to generate a time series, if you could also include the information i think i could be great. i provided an example adding fields 12 (Price) and 13 (datetimestamp) both information i think are quick wins (probably small effort to provide but huge gains in function usability)

  technical_indicator    value           signal
    0               RSI(14)  39.1500             sell
    1            STOCH(9,6)  33.2340             sell
    2          STOCHRSI(14)  67.7390              buy
    3           MACD(12,26)  -0.0740             sell
    4               ADX(14)  55.1150             sell
    5           Williams %R -66.6670             sell
    6               CCI(14) -77.1409             sell
    7               ATR(14)   0.0939  less_volatility
    8        Highs/Lows(14)  -0.0199             sell
    9   Ultimate Oscillator  43.0010             sell
    10                  ROC  -6.6240             sell
    11  Bull/Bear Power(13)  -0.1590             sell
    12 Price          xxx.xx                            ?
    13 datetimestamp        dd/,,/yyyy hh:mm:ss

Many thanks and huge thumbs up to you and the project!

https://www.investing.com/commodities/crude-oil-streaming-chart

alvarobartt commented 3 years ago

Thanks, @kungouf! Then I'll try to retrieve both the price and the timestamp in which the current technical indicators have been calculated. In the following screenshot, I've highlighted the new fields to include, let me know if those as the ones you think should be included here! 🤗

imagen

kungouf commented 3 years ago

yes this would be amazing, and i think if you could add the ticker of the contract in the Panda dataframe that would be amazing! so every future has a month reference, like Mar21, but April21 has a different one etc. So if you could just add the ticker as well to recognise the month of the future so we can store the information for the time series, or if its a STOCK just the regular ticker code, that could facilitate some aspect of the analysis. Thanks for your help and contribution to the community, i think that the potential to grow into something really amazing is here :)

kungouf commented 3 years ago

these are the correct fields indeed , youre such a star Alvaro muchas gracias!

alvarobartt commented 3 years ago

Thanks a lot for your kind words @kungouf! 👍🏻 So in this case you also want me to include "Crude Oil WTI Futures - Mar 2021 (THI)"? Just clarify that and this will be included in the v1.0.3 release including also some other fixes and issues solved.

kungouf commented 3 years ago

Hi Alvaro! yes i would like the instrument name and ticker to be included (every month has a different ticker) i understand that the line "Crude Oil WTI Futures - Mar 2021 (THI)" includes a lot of information:

Thanks for your work for the community ! i think if that works it could be very interesting as i could start some serious analysis of the time series. BTW Are you also strong on technical analysis? i would be happy to share my knowledge as well

kungouf commented 3 years ago

But if it's a bit complicated , you can just add "Crude Oil WTI Futures - Mar 2021 (THI)" as it is

alvarobartt commented 3 years ago

Cool @kungouf I'll try to find a way to retrieve that information for any financial product and if that does not apply to every product I will just retrieve the plain information as name, timestamp and value, but I will still try to see how this could be done and applied to every financial product! 😄

kungouf commented 3 years ago

that sounds great thanks Alvaro for looking into! BTW do you have a rough estimation on when 1.0.3 might be released? Muchas gracias!

alvarobartt commented 3 years ago

Yes @kungouf, I'll try to release it during this week (don't know exactly the date as there some things to change 😩 so sorry for that)

kungouf commented 3 years ago

thumbs up cheers Alvaro for the great work!

kungouf commented 3 years ago

H i Alvaro , cheers for your work and release of v 1.0.3 , i downloaded the file but was the technicalpy price, datetimestamp and name of instrument can now be retrieved or this will be part of a later release? thanks

alvarobartt commented 3 years ago

Hi @kungouf! 👍🏻 Not yet, these changes will come with the next release v1.0.4, this weekend in the best-case scenario, anyway I think that either later this month or early March the new release will come including the features you proposed as well as other interesting features! But I just wanted to let you know that I'm working on this already 😄

alvarobartt commented 3 years ago

Oh, I forgot to mention that I'll be including a parameter that by default is False, which means that the extra information will not be returned because as you saw there's no clean way to include that data into the returned pandas.DataFrame due to the column names, but with this flag, you will be able to receive as output the pandas.DataFrame with the indicators, the current price and the timestamp used for the calculation of those indicators.

Hope this is useful to you! I'll give you more insights once the functionality has been developed so that you can beta test it before I release the stable version, is that OK to you @kungouf? 👍🏻

kungouf commented 3 years ago

Sure that sounds great Alvaro thanks for the update here , I will be looking forward to the next release !

PieroValdebenito commented 3 years ago

I will be waiting for the next release too 😄

kungouf commented 3 years ago

Hi Alvaro ! Hope you are doing well ! When do you think the next release with the improvement can mmbe made ? Thanks !

kungouf commented 3 years ago

You don't need to put the product name and tenor if that too complicated, I've actually got some piece of code ready and would be happy just to use the price with the technicals !

kungouf commented 3 years ago

Hello, i saw an update on the ticket, i would like to know if the price and timestamps are now both available on technical.py many thanks Alvaro!