Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dindex not initialized after update to 0.14.5 #88

Closed
vpalvesalan opened this issue Jun 28, 2018 · 4 comments
Closed

dindex not initialized after update to 0.14.5 #88

vpalvesalan opened this issue Jun 28, 2018 · 4 comments

Comments

@vpalvesalan
Copy link

When installing quantstrat install_github("braverock/quantstrat"). I get the two following notes:

Note: no visible binding for '<<-' assignment to '.strategy'
Note: no visible binding for '<<-' assignment to 'hold'

I do not know what exactly it means but I am not getting simple strategy to work. It apparently does not record any transaction.
When I run demo("bbands", ask=FALSE) I get an err:

Error in chart.Posn(portfolio.st, Symbol = symbol, Dates = "2017-01-01::2018-06-24", :
no transactions/positions to chart

In fact, no transaction shows up:
getTxns(strat.st, "IBM")

            Txn.Qty Txn.Price Txn.Fees Txn.Value Txn.Avg.Cost Net.Txn.Realized.PL

1950-01-01 0 0 0 0 0 0

I am using Ubuntu 18.04 LTS and the following settings sessionInfo():

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] LC_CTYPE=pt_BR.UTF-8 LC_NUMERIC=C LC_TIME=pt_BR.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=pt_BR.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=pt_BR.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] quantstrat_0.14.5 foreach_1.4.4 blotter_0.14.2
[4] PerformanceAnalytics_1.5.2.2 FinancialInstrument_1.3.0 quantmod_0.4-13
[7] TTR_0.23-3 xts_0.10-2 zoo_1.8-2

loaded via a namespace (and not attached):
[1] quadprog_1.5-5 lattice_0.20-35 codetools_0.2-15 MASS_7.3-49 grid_3.4.4
[6] curl_3.2 boot_1.3-20 iterators_1.0.9 tools_3.4.4 yaml_2.1.19
[11] compiler_3.4.4

@braverock
Copy link
Owner

The no visible binding note isn't relevant here. It is an issue that breaks 'hold' functionality, but that isn't your problem.

Since you have no transactions, something else is wrong. For example, do you have data, or did yahoo not return anything?

Do you see the demo creating transactions? If not, are there any other warnings or errors? What is in the order books?

You may need to provide the entire output of running the demo.

@braverock braverock changed the title Note: no visible binding for '<<-' assignment to '.strategy' dindex not initialized after update to 0.14.5 Jun 28, 2018
@braverock
Copy link
Owner

braverock commented Jun 28, 2018

Commit 1172e98#diff-83dcc9f5b43a526c5d7e25badbb43930

removed calls to next that R CMD check called by travis-CI was complaining about.

It looks like I removed one too many. After that, initialization of the dimension reduction index (dindex) in applyRules could fail.

fixed in commit 7b3a46f by restoring one of the calls to next()

braverock added a commit that referenced this issue Jun 28, 2018
after fixing #88, bump version and date so that we can tell which versions should be working versus broken version 0.14.5
@braverock
Copy link
Owner

@vpalvesalan I'm certain the issue is fixed now. Sorry for the trouble. Please reinstall, and the problem should disappear for you in quantstrat v0.14.6

@vpalvesalan
Copy link
Author

Thank you @braverock for the fix. It works perfectly now, both the demo and other codes of my own, where I was getting the same err. Thank you very much for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants