Navigation

    Quantiacs Community

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

    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
    • Why number financial instruments is different from my expectation ?

      Hi !
      I have a question about the statics of strategy in contest.

      My strategy invests 10 instruments ranked by the mean Sharpe Ratio, top5 long and down5 short. However, the statics says that number financial instrument is 87.

      What is the cause of the result ?

      Best regards,

      posted in Support
      C
      cyan.gloom
    • How to change 'iopub_data_rate_limit'

      Hi, I have a question about --NotebookApp.iopub_data_rate_limit`.

      when I run the cell below,

      !pip install torch 
      import torch
      from torch import nn, optim
      

      Screenshot (22).png

      How Can I change 'iopub_data_rate_limit' ?

      Best regards,

      posted in Support
      C
      cyan.gloom
    • RE: Why Sharp ratios is not inverted ?

      @support
      Thanks a lot !

      posted in Strategy help
      C
      cyan.gloom
    • Why Sharp ratios is not inverted ?

      Hi,
      I'm so confused with this subtitle.

      def simple_strategy(data):
          close = data.sel(field='close')
          open = data.sel(field='open')
          is_liquid = data.sel(field='is_liquid')
          rtrn = close / open 
          rtrn_d = rtrn.quantile(0.05, dim='asset')
          rtrn_u = rtrn.quantile(0.95, dim='asset')
          strategy_1 = xr.where(rtrn > rtrn_u,1,0) 
          strategy_2 = xr.where(rtrn < rtrn_d,-1,0)
          weights = strategy_1 + strategy_2
          weights = weights * is_liquid
          weights = weights / abs(weights).sum('asset')
          return weights
      
      weights = simple_strategy(data)
      
      qnout.write(weights)
      weights = qnout.clean(weights, data, "stocks_nasdaq100")
      qnout.check(weights, data, "stocks_nasdaq100")
      

      If I changed the position like 1 to -1, -1 to 1, Sharp ratios does not invert.

      Why?

      Best regards,

      posted in Strategy help
      C
      cyan.gloom
    • RE: combinations of strategy

      @support
      Thanks
      I got it !

      posted in Strategy help
      C
      cyan.gloom
    • combinations of strategy

      Hi,

      I'd like to get to know how to write the code to combine some strategy.
      For example, I have 5 strategies which is different assets pair and time. How can I submit 5 strategies as a strategy??

      Best regards,

      posted in Strategy help
      C
      cyan.gloom
    • RE: Why .interpolate_na dosen't work well ?

      @antinomy

      I got it !
      Thanks a lot !!

      posted in Support
      C
      cyan.gloom
    • RE: Why .interpolate_na dosen't work well ?

      @support

      After I applied .dropna() to 'it', some information related with the time from '2005-06-01' is deleted regardless of interpolating nan.

      What make this happen do you think ?

      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