braverock / quantstrat

289 stars 114 forks source link

Typo: Fixes missing '[,1]' column specification in strategy codeblock #141

Closed Ramshreyas closed 3 years ago

Ramshreyas commented 3 years ago

This is a simple typo that tripped me up (and is probably others) when following your demo code in the readme:

The column specifier is missing in the add.indicator command for ma50.

jaymon0703 commented 3 years ago

Thanks for the report @Ramshreyas. Apologies for the inconsistency. How was it tripping you up...were you getting an error or just confused by the inconsistency? There is no need to subset, as Cl() should return a single series.

Ramshreyas commented 3 years ago

Apologies @jaymon0703, I did realise that it should work for AAPL, and therefore closed the PR.

I was using it on a (quantmod compliant) crypto xts object I had created from my own library for which Cl was returning multiple columns.

jaymon0703 commented 3 years ago

Right, ok. Thanks for closing the PR. I think i will add a comment on the relevant line in the README that mentions when subsetting might be necessary.