{"action":"created","issue":{"url":"https://api.github.com/repos/jbkunst/highcharter/issues/194","repository_url":"https://api.github.com/repos/jbkunst/highcharter","labels_url":"https://api.github.com/repos/jbkunst/highcharter/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/jbkunst/highcharter/issues/194/comments","events_url":"https://api.github.com/repos/jbkunst/highcharter/issues/194/events","html_url":"https://github.com/jbkunst/highcharter/issues/194","id":180611446,"number":194,"title":"Question:  How to disable aggregation while plotting 1 minute OHLC charts","user":{"login":"SamoPP","id":4817398,"avatar_url":"https://avatars.githubusercontent.com/u/4817398?v=3","gravatar_id":"","url":"https://api.github.com/users/SamoPP","html_url":"https://github.com/SamoPP","followers_url":"https://api.github.com/users/SamoPP/followers","following_url":"https://api.github.com/users/SamoPP/following{/other_user}","gists_url":"https://api.github.com/users/SamoPP/gists{/gist_id}","starred_url":"https://api.github.com/users/SamoPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamoPP/subscriptions","organizations_url":"https://api.github.com/users/SamoPP/orgs","repos_url":"https://api.github.com/users/SamoPP/repos","events_url":"https://api.github.com/users/SamoPP/events{/privacy}","received_events_url":"https://api.github.com/users/SamoPP/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-03T10:48:44Z","updated_at":"2016-10-03T14:00:59Z","closed_at":null,"body":"I am trying to chart 1 minute OHLC bars data using highchartr. The issue is that I do not want to have aggregations, I want to see 1 minute bars exactly as they are in the data for every minute. (of course displayed at first in the top pane for 1, 2, ... days only). How can one disable aggregations and set up the chart s that just one (or a couple) days at the end of 1 minute time series are shown?\r\n\r\nBelow please find reproducible example of what I am trying to do. First I download 1 min bars data from Google. Then I plot it using quantmod and then using highchartr. Quantmod has no \"aggregation\" built in so the data is displayed correctly. I have no idea on how to make sure using highchartr that there is no aggergation on the chart and that initially you only display 1 or 2 or N days of 1 minute bars (not aggregated).\r\n\r\n\r\n    # Based on https://github.com/systematicinvestor/SIT/blob/master/R/data.r\r\ngetSymbol.intraday.google <- function(Symbol,\r\n                                      interval=60, # 60 seconds\r\n                                      period=\"1d\",\r\n                                      Exchange=NULL\r\n) {\r\n  # download Key Statistics from yahoo\r\n  url <- \"\"\r\n  if (!is.null(Exchange)) {\r\n    url <- paste('http://www.google.com/finance/getprices?q=', Symbol,\r\n                 '&x=', Exchange,\r\n                 '&i=', interval,\r\n                 '&p=', period,\r\n                 '&f=', 'd,o,h,l,c,v', sep='')\r\n  } else {\r\n    url <- paste('http://www.google.com/finance/getprices?q=', Symbol,\r\n                 '&i=', interval,\r\n                 '&p=', period,\r\n                 '&f=', 'd,o,h,l,c,v', sep='')\r\n  }\r\n  \r\n  tt <- tempfile()\r\n  on.exit(unlink(tt), add=TRUE)\r\n  \r\n  download.file(url, tt, method=\"auto\", mode=\"wb\", quiet=TRUE)\r\n  \r\n  #fileContent <- readChar(tt, file.info(tt)$size)\r\n  \r\n  #out <- fread(url, skip=7, stringsAsFactors=FALSE, verbose=TRUE)\r\n  out <- fread(tt, skip=7, stringsAsFactors=FALSE)\r\n  \r\n  if(ncol(out) < 5) {\r\n    cat('Error getting data from', url, '\\n')\r\n    return(NULL)\r\n  }\r\n\r\n  colnames(out) <- c(\"Date\", \"Close\", \"High\", \"Low\", \"Open\", \"Volume\")\r\n  \r\n  # date logic\r\n  date <- out$Date\r\n  date.index <- substr(out$Date, 1, 1) == 'a'\r\n  date <- as.double(gsub('a', '', date))\r\n  temp <- NA*date\r\n  temp[date.index] <- date[date.index]\r\n  \r\n  temp1 <- !is.na(temp)\r\n  # in case y starts with NA\r\n  temp1[1] <- TRUE\r\n  temp <- temp[cummax((1:length(temp))*temp1 )]\r\n  \r\n  date <- temp + date*interval\r\n  date[date.index] <- temp[date.index]\r\n  class(date) <- c(\"POSIXt\", \"POSIXct\")\r\n  \r\n  date <- date - (as.double(format(date[1], '%H')) - 9)*60*60\r\n  \r\n  ret <- xts(out[, -1, with=FALSE], order.by=date)\r\n  \r\n  ret <- ret[, c(\"Open\", \"High\", \"Low\", \"Close\", \"Volume\")]\r\n  colnames(ret) <- paste(Symbol, colnames(ret), sep=\".\")\r\n  \r\n  return(ret)\r\n  \r\n}\r\n\r\nlibrary(quantmod)\r\nlibrary(data.table)\r\nlibrary(highcharter)\r\n\r\nSPY <- getSymbol.intraday.google(\"SPY\", 60, \"30d\")\r\nhead(SPY)\r\ntail(SPY)\r\n\r\nsubset <- \"2016-09\"\r\nchart_Series(SPY, subset=subset)\r\nadd_Vo()\r\n\r\nSPY.SMA.10 <- SMA(Cl(SPY), n=10)\r\nSPY.SMA.200 <- SMA(Cl(SPY), n=200)\r\nSPY.RSI.14 <- RSI(Cl(SPY), n=14)\r\nSPY.RSI.SellLevel <- xts(rep(70, NROW(SPY)), index(SPY))\r\nSPY.RSI.BuyLevel <- xts(rep(30, NROW(SPY)), index(SPY))\r\n\r\nhighchart() %>%\r\n  # create axis :)\r\n  hc_yAxis_multiples(\r\n    list(title = list(text = NULL), height = \"45%\", top = \"0%\"),\r\n    list(title = list(text = NULL), height = \"25%\", top = \"47.5%\", opposite = TRUE),\r\n    list(title = list(text = NULL), height = \"25%\", top = \"75%\")\r\n  ) %>%\r\n  # series :D\r\n  hc_add_series_ohlc(SPY, yAxis = 0, name = \"SPY\") %>%\r\n  hc_add_series_xts(SPY.SMA.10, yAxis = 0, name = \"Fast MA\") %>%\r\n  hc_add_series_xts(SPY.SMA.200, yAxis = 0, name = \"Slow MA\") %>%\r\n  hc_add_series_xts(SPY$SPY.Volume, color = \"gray\", yAxis = 1, name = \"Volume\", type = \"column\") %>%\r\n  hc_add_series_xts(SPY.RSI.14, yAxis = 2, name = \"Osciallator\") %>%\r\n  hc_add_series_xts(SPY.RSI.SellLevel, color = \"red\", yAxis = 2, name = \"Sell level\", enableMouseTracking = FALSE) %>%\r\n  hc_add_series_xts(SPY.RSI.BuyLevel, color = \"blue\", yAxis = 2, name = \"Buy level\", enableMouseTracking = FALSE) %>%\r\n  # I <3 themes\r\n  hc_add_theme(hc_theme_smpl())"},"comment":{"url":"https://api.github.com/repos/jbkunst/highcharter/issues/comments/251113301","html_url":"https://github.com/jbkunst/highcharter/issues/194#issuecomment-251113301","issue_url":"https://api.github.com/repos/jbkunst/highcharter/issues/194","id":251113301,"user":{"login":"SamoPP","id":4817398,"avatar_url":"https://avatars.githubusercontent.com/u/4817398?v=3","gravatar_id":"","url":"https://api.github.com/users/SamoPP","html_url":"https://github.com/SamoPP","followers_url":"https://api.github.com/users/SamoPP/followers","following_url":"https://api.github.com/users/SamoPP/following{/other_user}","gists_url":"https://api.github.com/users/SamoPP/gists{/gist_id}","starred_url":"https://api.github.com/users/SamoPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamoPP/subscriptions","organizations_url":"https://api.github.com/users/SamoPP/orgs","repos_url":"https://api.github.com/users/SamoPP/repos","events_url":"https://api.github.com/users/SamoPP/events{/privacy}","received_events_url":"https://api.github.com/users/SamoPP/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T14:00:59Z","updated_at":"2016-10-03T14:00:59Z","body":"So there is no way to fix \"bar size\" or \"bar width\" to 1 minute (for example)? Since I want to use this to potentially zoom in and out to look at several days of one minute data (for example I would look at this morning and then want to look for past three days and bar width should stay the same (1 min)..."}}
{"actor":{"display_login":"SamoPP"}}