@support
Thanks a lot !
Posts made by 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.
-
RE: What's is the next contest ?
@support
Thanks for your reply !
Are you planning to hold long-short stocks ? -
What's is the next contest ?
Hello,
I'm looking forward to joining the next contest.
What is the next theme ?Best regards,
-
RE: Cannot Install tookbox.git in colab
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.
-
RE: How to load data to work with Multi-backtesting_ml
Thanks for your help !
I have an error below.
What is 'state' ?
What should I give positional argument ?Best regards,
-
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,
-
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
-
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 ?
-
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,
-
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
How Can I change 'iopub_data_rate_limit' ?
Best regards,
-
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,
-
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,
-
RE: Why .interpolate_na dosen't work well ?
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 ?