Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. gjhernandezp
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 8
    • Best 2
    • Groups 0
    • Blog

    gjhernandezp

    @gjhernandezp

    2
    Reputation
    5
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    gjhernandezp Follow

    Best posts made by gjhernandezp

    • RE: Alpha Default Value of EMA function

      @support But alpha should not be between 0 and 1 and 2(n+1) is larger than one, is maybe 2/(n+1)?

      posted in Strategy help
      G
      gjhernandezp
    • RE: Colab new error 'EntryPoints' object has no attribute 'get'

      It seems that is a problem with the newer 0.20.2 version of xarray in Coab because I have the same problem running the Xarray Turorial from http://gallery.pangeo.io/repos/pangeo-data/pangeo-tutorial-gallery/xarray.html#Table-of-contents

      I added to before any other cell

      !pip uninstall xarray -y
      !pip install xarray==0.19.0

      And is working now.

      posted in Support
      G
      gjhernandezp

    Latest posts made by gjhernandezp

    • RE: Some top S&P 500 companies are not available?

      Thanks 🙏

      posted in Support
      G
      gjhernandezp
    • Some top S&P 500 companies are not available?

      Many tickers like JPM LLY BKR.B that correspond to top S&P 500 Companies by Weight https://www.slickcharts.com/sp500 are not avaiblabe in the data

      data = qndata.stocks.load_spx_data(tail = 365 * 5)
      d = data.asset.to_pandas().to_dict()
      d['NAS:JPM']


      KeyError Traceback (most recent call last)
      Cell In[14], line 1
      ----> 1 d['NAS:JPM']

      KeyError: 'NAS:JPM'


      This companies are not quoted in NASDAQ but they are quoated in NYSE,

      Are this companies avaliable for the contest?

      posted in Support
      G
      gjhernandezp
    • Local Development Error Ubuntu : AttributeError: module 'collections' has no attribute 'Iterable'

      File ~/anaconda3/envs/qntdev/lib/python3.10/site-packages/progressbar/bar.py:50
      46 except Exception:
      47 pass
      ---> 50 class ProgressBarBase(collections.Iterable, ProgressBarMixinBase):
      51 pass
      54 class DefaultFdMixin(ProgressBarMixinBase):

      AttributeError: module 'collections' has no attribute 'Iterable'

      posted in Support
      G
      gjhernandezp
    • Three questions about the qnbt.backtest_ml used in Machine Learning on a Rolling Basis example.

      The questions are about the qnbt.backtest_ml used in Machine Learning on a Rolling Basis example from https://quantiacs.com/documentation/en/examples/q18_machine_learning_on_a_rolling_basis.html

      weights = qnbt.backtest_ml(
      train = train_model,
      predict = predict_weights,
      train_period = 2 *365, # the data length for training in calendar days
      retrain_interval = 10 *365, # how often we have to retrain models (calendar days)
      retrain_interval_after_submit = 1, # how often retrain models after submission during evaluation (calendar days)
      predict_each_day = False, # Is it necessary to call prediction for every day during backtesting?
      # Set it to True if you suspect that get_features is looking forward.
      competition_type = "stocks_nasdaq100", # competition type
      lookback_period = 365, # how many calendar days are needed by the predict function to generate the output
      start_date = "2005-01-01", # backtest start date
      analyze = True,
      build_plots = True # do you need the chart?
      )

      Questions

      1. It seems that the models are trained in the train_period of the final data and that trained models are used in all the chunks of data, is that correct ?

      2. Is the re-training after every retrain_interval done with incremental learning of the type that the fitting that partial_fit does (see following link) ?

      https://datascience.stackexchange.com/questions/68599/incremental-learning-with-sklearn-warm-start-partial-fit-fit?

      1. How can i provide qnbt.backtest_ml with and already trained model have the model trained with incremental learning every retrain_interval (would train_period = 0 and have train_model retruning the trained models work for this)
      posted in Support
      G
      gjhernandezp
    • RE: Alpha Default Value of EMA function

      @support But alpha should not be between 0 and 1 and 2(n+1) is larger than one, is maybe 2/(n+1)?

      posted in Strategy help
      G
      gjhernandezp
    • RE: Colab new error 'EntryPoints' object has no attribute 'get'

      It seems that is a problem with the newer 0.20.2 version of xarray in Coab because I have the same problem running the Xarray Turorial from http://gallery.pangeo.io/repos/pangeo-data/pangeo-tutorial-gallery/xarray.html#Table-of-contents

      I added to before any other cell

      !pip uninstall xarray -y
      !pip install xarray==0.19.0

      And is working now.

      posted in Support
      G
      gjhernandezp
    • Colab new error 'EntryPoints' object has no attribute 'get'

      I was running strategies from Colab whitout any problem but now I am getting this error even in the example form

      • https://quantiacs.com/documentation/en/user_guide/local_development.html#google-colab-support
      • https://quantiacs.com/documentation/en/_static/colab.ipynb

      =================

      import xarray as xr

      import qnt.stats as qnstats
      import qnt.data as qndata
      import qnt.output as qnout
      import qnt.ta as qnta
      import qnt.backtester as qnbt
      import qnt.graph as qngraph

      def load_data(period):
      return qndata.stocks.load_ndx_data(tail=period)

      def strategy(data):
      close = data.sel(field="close")
      is_liquid = data.sel(field="is_liquid")
      sma_slow = qnta.sma(close, 200).isel(time=-1)
      sma_fast = qnta.sma(close, 20).isel(time=-1)
      weights = xr.where(sma_slow < sma_fast, 1, -1)
      weights = weights * is_liquid
      return weights

      weights = qnbt.backtest(
      competition_type = "stocks_nasdaq100",
      load_data = load_data,
      lookback_period = 365*4,
      start_date = "2006-01-01",
      strategy = strategy,
      analyze = True,
      build_plots = True
      )

      ===============

      Run last pass...
      Load data...

      AttributeError Traceback (most recent call last)
      <ipython-input-5-ef8fa45745b7> in <module>
      32 strategy = strategy,
      33 analyze = True,
      ---> 34 build_plots = True
      35 )

      9 frames
      /usr/local/lib/python3.7/dist-packages/xarray/backends/plugins.py in list_engines()
      103 @functools.lru_cache(maxsize=1)
      104 def list_engines():
      --> 105 entrypoints = entry_points().get("xarray.backends", ())
      106 return build_engines(entrypoints)
      107

      AttributeError: 'EntryPoints' object has no attribute 'get'

      posted in Support
      G
      gjhernandezp
    • External information

      Can we use external information like: fundamentals, news or twits from Yahoo Finance, Google Finance, Twitter, Stocktwits using scraper or librareis https://pypi.org/project/yfinance/ or https://github.com/Aljgutier/Pyquant ?

      posted in Strategy help
      G
      gjhernandezp
    • Documentation
    • About
    • Career
    • My account
    • Privacy policy
    • Terms and Conditions
    • Cookies policy
    Home
    Copyright © 2014 - 2021 Quantiacs LLC.
    Powered by NodeBB | Contributors