Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions QuantConnect.DataBento/DataBentoDataDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ private string MapSymbolToDataBento(Symbol symbol)
return symbol.Value;
}

/// Class for parsing trade data from Databento
/// Really used as a map from the http request to then get it in QC data structures
/// Class for parsing OHLCV bar data from Databento
/// Databento returns prices as fixed-point integers scaled by 10^9
private class DatabentoBar
{
[Name("ts_event")]
Expand All @@ -247,19 +247,23 @@ private class DatabentoBar
.AddTicks((TimestampNanos % 1_000_000_000) / 100).UtcDateTime;

[Name("open")]
public decimal Open { get; set; }
public long OpenRaw { get; set; }
public decimal Open => OpenRaw * PriceScaleFactor;

[Name("high")]
public decimal High { get; set; }
public long HighRaw { get; set; }
public decimal High => HighRaw * PriceScaleFactor;

[Name("low")]
public decimal Low { get; set; }
public long LowRaw { get; set; }
public decimal Low => LowRaw * PriceScaleFactor;

[Name("close")]
public decimal Close { get; set; }
public long CloseRaw { get; set; }
public decimal Close => CloseRaw * PriceScaleFactor;

[Name("volume")]
public decimal Volume { get; set; }
public long Volume { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Volume needs to be decimal for fractional shares

}

private class DatabentoTrade
Expand Down