joshuaulrich / joshuaulrich/quantmod
Error when zooming chart on chart.Posn
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 906
- Forks
- 233
- PR merge metrics
- No merged PRs in 30d
Description
Ok finally found time to create reproducible example on this error which I seem to encounter randomly. On most periods zoom_Chart works but sometimes I get this error:
> Error in plot.window(c(1, 61), c(NaN, NaN)) : need finite 'ylim' values
> In addition: Warning messages:
> 1: In min(x) : no non-missing arguments to min; returning Inf
> 2: In max(x) : no non-missing arguments to max; returning -Inf
And here is my reproducible example:
```
library(blotter);
currency("USD");
stock("SPY",currency="USD",multiplier=1);
initDate <- '2006-01-01';
startDate <- '2006-01-01';
endDate <- '2016-03-16';
initEq <- 10000;
Sys.setenv(TZ = "UTC");
getSymbols('SPY', from=startDate, to=endDate, index.class="POSIXct", adjust=T)
addTxn("TEST", Symbol='SPY', TxnDate=startDate, TxnPrice=SPY[1,]$SPY.Close, TxnQty = 100, TxnFees=0, verbose = TRUE)
chart.Posn("TEST", Symbol = 'SPY')
zoom_Chart("2008-01::2008-03")
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the supplied R example with chart.Posn("TEST", Symbol = 'SPY') and zoom_Chart("2008-01::2008-03") to reproduce the non-finite ylim error. Trace those entry points to determine why the selected period has no finite values, then verify that zooming this period completes without the error or warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100