-
Notifications
You must be signed in to change notification settings - Fork 4
Addressing comments from previous PR. #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Addressing comments from previous PR. #8
Conversation
…More robust code. Refactored and properly passing tests.
Romazes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- update to .net 10
- What about reconnection logic? Did you test when the internet disconnects/reconnects?
- You need create test cases of subscribe/unsubscribe when you create
DataBentoProviderinstance. (NOT classDataBentoRawLiveClientexplicitly)- Look at the screen below.
- You need add TestCases to SymbolMapper.
| public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos); | ||
|
|
||
| [Name("open")] | ||
| public long RawOpen { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify these initializations of properties?
private decimal _open;
[Name("open")]
public decimal Open { get => _open; set => _open = value * PriceScaling.PriceScaleFactor; }
| public long RawClose { get; set; } | ||
|
|
||
| [Ignore] | ||
| public decimal Open => RawOpen == long.MaxValue ? 0m : RawOpen * PriceScaling.PriceScaleFactor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- When is the condition true? Can you add an explanation and example of csv's raw data?
- If the condition doesn't work, please remove it.
- It looks so ambiguous, with public properties like
OpenvsRawOpen.
| [Name("ts_event")] | ||
| public long TimestampNanos { get; set; } | ||
|
|
||
| public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Did it miss
[Ignore]attribute? - Please, rename to
TimestampUtc. - Please, add xml proof that exactly UTC as https://databento.com/docs/standards-and-conventions/common-fields-enums-types#time-zone?historical=python&live=python&reference=raw
| [Name("ts_event")] | ||
| public long TimestampNanos { get; set; } | ||
|
|
||
| public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Did it miss
[Ignore]attribute? - Please, rename to
TimestampUtc. - Please, add xml proof that exactly UTC as https://databento.com/docs/standards-and-conventions/common-fields-enums-types#time-zone?historical=python&live=python&reference=raw
| [Name("ts_event")] | ||
| public long TimestampNanos { get; set; } | ||
|
|
||
| public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Did it miss
[Ignore]attribute? - Please, rename to
TimestampUtc. - Please, add xml proof that exactly UTC as https://databento.com/docs/standards-and-conventions/common-fields-enums-types#time-zone?historical=python&live=python&reference=raw
| /// <param name="market">The market</param> | ||
| /// <param name="expirationDate">Expiration date of the security(if applicable)</param> | ||
| /// <returns>A new Lean Symbol instance</returns> | ||
| public Symbol GetLeanSymbol(string brokerageSymbol, SecurityType securityType, string market, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use this method at all.
| /// </summary> | ||
| /// <param name="databentoSymbol">The databento symbol</param> | ||
| /// <returns>The corresponding Lean symbol</returns> | ||
| public Symbol GetLeanSymbol(string databentoSymbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// </summary> | ||
| /// <param name="brokerageSymbol">The brokerage symbol</param> | ||
| /// <returns>A new Lean Symbol instance</returns> | ||
| public Symbol GetLeanSymbolForFuture(string brokerageSymbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use GetLeanSymbol(...) instead of this. You can pass not all parameters to GetLeanSymbol
| } | ||
|
|
||
| // ignore futures spreads | ||
| if (brokerageSymbol.Contains("-")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="..\models\*.cs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Folder instead Compile
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>


Addressed the comments made on PR 3 from Roman.
I use Task.Run() due to the message loop being blocking. If I don't use Task.Run() then the message flow to DataBento and the app flow is not correct.