Skip to content

Conversation

@Joseph-Matteo-Scorsone
Copy link
Contributor

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.

…More robust code. Refactored and properly passing tests.
Copy link

@Romazes Romazes left a 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 DataBentoProvider instance. (NOT class DataBentoRawLiveClient explicitly)
    • Look at the screen below.
  • You need add TestCases to SymbolMapper.
Image

public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos);

[Name("open")]
public long RawOpen { get; set; }
Copy link

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;
Copy link

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 Open vs RawOpen.

[Name("ts_event")]
public long TimestampNanos { get; set; }

public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos);
Copy link

Choose a reason for hiding this comment

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

[Name("ts_event")]
public long TimestampNanos { get; set; }

public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos);
Copy link

Choose a reason for hiding this comment

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

[Name("ts_event")]
public long TimestampNanos { get; set; }

public DateTime Timestamp => Time.UnixNanosecondTimeStampToDateTime(TimestampNanos);
Copy link

Choose a reason for hiding this comment

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

/// <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,
Copy link

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)
Copy link

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.

Image

.

/// </summary>
/// <param name="brokerageSymbol">The brokerage symbol</param>
/// <returns>A new Lean Symbol instance</returns>
public Symbol GetLeanSymbolForFuture(string brokerageSymbol)
Copy link

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("-"))
Copy link

Choose a reason for hiding this comment

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

Image

</ItemGroup>

<ItemGroup>
<Compile Include="..\models\*.cs" />
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants