cuemacro / finmarketpy

Python library for backtesting trading strategies & analyzing financial markets (formerly pythalesians)
http://www.cuemacro.com
Apache License 2.0
3.41k stars 490 forks source link

AttributeError: 'DataConstants' object has no attribute 'base_depos_tenor' #41

Open abhijitng opened 3 years ago

abhijitng commented 3 years ago

Hi Saeed,

Cuemacro is a brilliant suite of libraries. Thanks for your efforts.

I was trying out an example in (finmarketpy_examples) where I received this error:

base_depos_tenor=data_constants.base_depos_tenor, AttributeError: 'DataConstants' object has no attribute 'base_depos_tenor'

Any idea why I am receiving this error?

Thanks again, Abhi

saeedamen commented 3 years ago

Hi Abhi, I suspect you are using an old version of findatapy. If you do:

pip uninstall findatapy

And then pip install the latest version from GitHub, hopefully it should work (DataConstants now has that attribute):

pip install git+https://github.com/cuemacro/findatapy.git

Regards Saeed

abhijitng commented 3 years ago

Thanks Saeed for the prompt response. that seems to have resolved. I am now receiving below error:

Couldn't push MarketDataRequest_690abstract_curve_key-Nonebase_depos_currencies-USD_BRLbase_depos_tenor-ON_TN_SN_1W_2W_3W_1M_2M_3M_4M_6M_9M_1Y_2Y_3Y_5Ycategory-fx-forwards-marketcategory_key-backtest_fx-forwards-market_bloomberg_daily_NYCcut-NYCdata_source-bloombergenvironment-backtestexpiry_date-NaTfields-closefinish_date-2007-06-01 00:00:00freq-dailyfreq_mult-1fx_forwards_tenor-1W_1M_2M_3Mfx_vol_part-V_25R_10R_25B_10Bfx_vol_tenor-ON_1W_2W_3W_1M_2M_3M_4M_6M_9M_1Y_2Y_3Y_5Ygran_freq-None__list_threads-1push_to_cache-Trueresample-Noneresample_how-lastsplit_request_chunks-0start_date-2007-01-02 00:00:00tickers-USDBRLtrade_side-trade__vendor_fields-None__vendor_tickers-None_df to Redis: Error 10061 connecting to 127.0.0.1:6379. No connection could be made because the target machine actively refused it.

abhijitng commented 3 years ago

push_to_cache=False fixes this error.

abhijitng commented 3 years ago

fx_forwards_curve.construct_total_return_index is throwing exceptions:

Non-vectorized DateOffset being applied to Series or DatetimeIndex

would you recommend any specific version of pandas?