Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. cyan.gloom
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 23
    • Best 1
    • Groups 0
    • Blog

    cyan.gloom

    @cyan.gloom

    1
    Reputation
    12
    Profile views
    23
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    cyan.gloom Follow

    Best posts made by cyan.gloom

    • How to load data to work with Multi-backtesting_ml

      Hello !
      I'd like to know how to load 2 kind of data such as 'stocks' and 'index' in order to work with Multi-backtesting_ml.

      def load_data(period):
          stocks = qndata.stocks.load_ndx_data(tail=period)
          index = qndata.index.load_data(tail=period)
          
          return stocks, index
      
      weights = qnbt.backtest_ml(
          load_data                     = load_data,
          train                         = train_model,
          predict                       = predict_weights,
          train_period                  =  15 *365,  # the data length for training in calendar days
          retrain_interval              = 1 *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                    = "2006-01-01",        # backtest start date
          analyze                       = True,
          build_plots                   = True  # do you need the chart?
      )
      

      What should I do ?

      Best regards,

      posted in Strategy help
      C
      cyan.gloom

    Latest posts made by cyan.gloom

    • RE: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager

      @support
      Thanks a lot !

      posted in Support
      C
      cyan.gloom
    • Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager

      Dear Help,

      I have an warning statement.

      `WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

      I tried to use a virtual environment but, I couldn't .

      What should I do ?

      Best regards.

      posted in Support
      C
      cyan.gloom
    • RE: What's is the next contest ?

      @support
      Thanks for your reply !
      Are you planning to hold long-short stocks ?

      posted in News and Feature Releases
      C
      cyan.gloom
    • What's is the next contest ?

      Hello,

      I'm looking forward to joining the next contest.
      What is the next theme ?

      Best regards,

      posted in News and Feature Releases
      C
      cyan.gloom
    • RE: Cannot Install tookbox.git in colab

      @support

      Concerning my previous question, I wonder if there was some progress. It would be very helpful if I can implement my strategy in the Google Colaboratory environment. I look forward to hearing from you.

      posted in Support
      C
      cyan.gloom
    • RE: How to load data to work with Multi-backtesting_ml

      @vyacheslav_b

      Thanks for your help !

      I have an error below.
      Screenshot (23).png

      What is 'state' ?
      What should I give positional argument ?

      Best regards,

      posted in Strategy help
      C
      cyan.gloom
    • How to load data to work with Multi-backtesting_ml

      Hello !
      I'd like to know how to load 2 kind of data such as 'stocks' and 'index' in order to work with Multi-backtesting_ml.

      def load_data(period):
          stocks = qndata.stocks.load_ndx_data(tail=period)
          index = qndata.index.load_data(tail=period)
          
          return stocks, index
      
      weights = qnbt.backtest_ml(
          load_data                     = load_data,
          train                         = train_model,
          predict                       = predict_weights,
          train_period                  =  15 *365,  # the data length for training in calendar days
          retrain_interval              = 1 *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                    = "2006-01-01",        # backtest start date
          analyze                       = True,
          build_plots                   = True  # do you need the chart?
      )
      

      What should I do ?

      Best regards,

      posted in Strategy help
      C
      cyan.gloom
    • Multi-pass Backtesting

      Hello !

      I'd like to rewrite this code for Multi-pass Backtesting to pass the competition filter.
      What should I do ?

      def pair_trading(data):
          pair = ['NAS:FWLT', 'NAS:PCAR']
          close = data.sel(field='close')
          price = close.sel(asset=pair).transpose('time', 'asset').fillna(0) #欠損値処理
          modelCoint = VECM(price.values, k_ar_diff=0, deterministic='na')
          res = modelCoint.fit()
          pairs_value = res.beta[0]*price.sel(asset=pair[0])+ res.beta[1]*price.sel(asset=pair[1]) #ポートフォリオ価値の作成
          diff = pairs_value.shift(time=-1) - pairs_value
          threshold = diff.std(dim='time')*2 #閾値の設定
          signal = np.sign(diff)
          
          weights = xr.zeros_like(close) #ポートフォリオウェイトの初期化
      
          for t in data.time:
              if (weights.sel(time=t)==[0,0]).any() and pairs_value.sel(time=t) >= threshold:
                  weights.loc[dict(time=t)] = [1,-1]
                  
              if (weights.sel(time=t)==[0,0]).any() and pairs_value.sel(time=t) <= -threshold:
                  weights.loc[dict(time=t)] = [-1,1]
          
              if (weights.sel(time=t)==[1,-1]).any() and signal.sel(time=t) < 0:
                  weights.loc[dict(time=t)] = [0,0]
                  
              if (weights.sel(time=t)==[-1,1]).any() and signal.sel(time=t) >= 0:
                  weights.loc[dict(time=t)] = [0,0]
      
          return weights
      

      Best regards

      posted in Strategy help
      C
      cyan.gloom
    • RE: How to change 'iopub_data_rate_limit'

      @support
      Thanks !

      posted in Support
      C
      cyan.gloom
    • RE: Cannot Install tookbox.git in colab

      I tried adding the codes below

      ! sudo apt-get install python3.7 python3.7-distutils python3-pip
      ! sudo apt-get update -y
      ! sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
      ! sudo update-alternatives --config python3 <<< '2'
      ! sudo python -m pip install --upgrade --force-reinstall pip
      

      but, I can not import 'qnt' packages.

      What shoud I do ?

      posted in Support
      C
      cyan.gloom
    • Documentation
    • About
    • Career
    • My account
    • Privacy policy
    • Terms and Conditions
    • Cookies policy
    Home
    Copyright © 2014 - 2021 Quantiacs LLC.
    Powered by NodeBB | Contributors