title: Hourly Data using Bloomberg .Net API
body: <p>I am struggling with the logic to get hourly OPEN, HIGH, LOW and LAST_PRICE snapshot from Bloomberg using .Net API 3.0. I have googled it many times but with no luck! Any help on this will be much appreciated.</p>
  
  <p>I am trying to find equivalent of following VBA BDH function in Bloomberg .Net API (C#). </p>
  
  <pre><code>BDH(B5,C6:F6,TODAY()-30,"","BarTp=T","BarSz=120","days=T","Dir=V","Dts=S",,"Quot‌​e=C","UseDPDF=Y","Sort=D",,"cols=5;rows=271") 
  </code></pre>
  
  <p>where B5 is security name and C6:F6 contain OPEN, HIGH, LOW and LAST_PRICE fields. I have tried Intraday Bar request but it does not return same values as returned by this BDH function. Also, Historical Data request does not have HOURLY interval option, it starts from DAILY interval. </p>
  
  <p>Following is the code which I have tried so far: </p>
  
  <pre><code>BBService refDataService = session.GetService("//blp/refdata"); 
  BBRequest request = refDataService.CreateRequest("IntradayBarRequest"); 
  request.Set("security", "SPX INDEX"); 
  request.Set("eventType", "TRADE"); 
  request.Set("interval", 120); // bar interval in minutes
  request.Set("startDateTime", new BBDateTime(2012, 08, 11, 07, 30, 0, 0)); 
  request.Set("endDateTime", new BBDateTime(2012, 08, 20, 18, 30, 0, 0)); 
  session.SendRequest(request, null);
  </code></pre>