{"action":"created","issue":{"url":"https://api.github.com/repos/Rblp/Rblpapi/issues/47","labels_url":"https://api.github.com/repos/Rblp/Rblpapi/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/Rblp/Rblpapi/issues/47/comments","events_url":"https://api.github.com/repos/Rblp/Rblpapi/issues/47/events","html_url":"https://github.com/Rblp/Rblpapi/issues/47","id":95082999,"number":47,"title":"getBars - optionally adjust for corporate actions?","user":{"login":"joel23888","id":13341626,"avatar_url":"https://avatars.githubusercontent.com/u/13341626?v=3","gravatar_id":"","url":"https://api.github.com/users/joel23888","html_url":"https://github.com/joel23888","followers_url":"https://api.github.com/users/joel23888/followers","following_url":"https://api.github.com/users/joel23888/following{/other_user}","gists_url":"https://api.github.com/users/joel23888/gists{/gist_id}","starred_url":"https://api.github.com/users/joel23888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel23888/subscriptions","organizations_url":"https://api.github.com/users/joel23888/orgs","repos_url":"https://api.github.com/users/joel23888/repos","events_url":"https://api.github.com/users/joel23888/events{/privacy}","received_events_url":"https://api.github.com/users/joel23888/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-15T01:42:59Z","updated_at":"2015-07-15T05:09:52Z","closed_at":null,"body":"It seems the getBars function never adjusts for corporate actions like stock splits. Eg. 4661 JT Equity had a 1:4 stock split on 3/27/2015. This means unadjusted prices should have a large gap between 3/26 and 3/27 where prices fall by a factor of 4, while adjusted prices should multiply pre-3/27 prices by 0.25 to remove this gap. I find it always returns unadjusted prices, even though my BBG settings in DPDF are set to adjust and IntradayBarRequest should follow this by default according to BBG."},"comment":{"url":"https://api.github.com/repos/Rblp/Rblpapi/issues/comments/121490185","html_url":"https://github.com/Rblp/Rblpapi/issues/47#issuecomment-121490185","issue_url":"https://api.github.com/repos/Rblp/Rblpapi/issues/47","id":121490185,"user":{"login":"joel23888","id":13341626,"avatar_url":"https://avatars.githubusercontent.com/u/13341626?v=3","gravatar_id":"","url":"https://api.github.com/users/joel23888","html_url":"https://github.com/joel23888","followers_url":"https://api.github.com/users/joel23888/followers","following_url":"https://api.github.com/users/joel23888/following{/other_user}","gists_url":"https://api.github.com/users/joel23888/gists{/gist_id}","starred_url":"https://api.github.com/users/joel23888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel23888/subscriptions","organizations_url":"https://api.github.com/users/joel23888/orgs","repos_url":"https://api.github.com/users/joel23888/repos","events_url":"https://api.github.com/users/joel23888/events{/privacy}","received_events_url":"https://api.github.com/users/joel23888/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T05:09:52Z","updated_at":"2015-07-15T05:09:52Z","body":"Basic reproduction steps:\r\n1. In BBG terminal, enter DPDF GO and uncheck all boxes, be sure to save settings\r\n2. Run:\r\n```R\r\nlibrary(lubridate)\r\nlibrary(xts)\r\nlibrary(Rblpapi)\r\ncon <- blpConnect() \r\ntz <- \"Asia/Tokyo\"\r\nSys.setenv(TZ=tz)\r\nt7 <- ymd_hms(\"2015-03-26 14:00:00\", tz = tz)\r\nt8 <- ymd_hms(\"2015-03-27 10:00:00\", tz = tz)\r\nd <- getBars(\"4661 JT Equity\", eventType = \"TRADE\", barInterval = 60,\r\n               startTime = t7, endTime = t8,\r\n               returnAs = \"xts\", tz = \"Asia/Tokyo\")\r\nd\r\n```\r\nWhich returns for me:\r\n                       open    high   low close numEvents  volume\r\n2015-03-26 14:00:00 36089.7 36129.6 35930 35930      1170  216100\r\n2015-03-27 09:00:00  9137.0  9400.0  9050  9395      9002 2576700\r\n\r\nThis is expected as DPDF settings dictate no corporate actions adjustments should be made, and given the stock split I referred to before when I raised the issue, the price should divide in 4 from one day to the next (approximately).\r\n\r\n3. In BBG terminal, enter DPDF GO and check all boxes, be sure to save settings\r\n4. Rerun getBars in step 2 (under new DPDF setting), which for me returns the same result as in step 2. However, this is unexpected because DPDF dictate corporate actions adjustments should be made. The adjustment should be that price on 3/26 is multiplied by 0.25 and volume by 4, which is what I get when I view the same data  on BBG terminal using the GIT function (unrelated to \"git\").\r\n\r\nLet me know if you need more details.\r\n\r\nIf you see http://www.bloomberglabs.com/api/content/uploads/sites/2/2014/07/blpapi-developers-guide-2.54.pdf around p176 there is an option \"adjustmentFollowDPDF\", which if passed over to BBG should return adjusted data if DPDF is set to apply adjustments.\r\n"}}