Skip to content

Commit

Permalink
Feature: bump Graal SDK (#43)
Browse files Browse the repository at this point in the history
* fix: codestyle settings

* fix: some market events typo

* feat: add utils tests

* feat: add words to dictionary

* feat: bump graal sdk

* feat: add IpfType

* fix: README.md

* fix: abstract SafeHandle classes

---------

Co-authored-by: Konstantin Ivaschenko <[email protected]>
  • Loading branch information
stdcion and Konstantin Ivaschenko authored Oct 25, 2023
1 parent ed61d25 commit 5c9cb48
Show file tree
Hide file tree
Showing 39 changed files with 1,165 additions and 433 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ dotnet_naming_symbols.public_protected_static_readonly_fields_group.required_mod
dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.symbols = public_protected_static_readonly_fields_group
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.severity = warning
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.severity = none

# No other public/protected/protected_internal fields are allowed
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
Expand Down Expand Up @@ -346,7 +346,7 @@ dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = none

# No non-private instance fields are allowed
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
Expand Down Expand Up @@ -428,7 +428,7 @@ dotnet_naming_rule.parameters_rule.severity = warning
##########################################
# Whitespace and control characters in string literals should be explicit. C#11 raw literals.
dotnet_diagnostic.S2479.severity = none

dotnet_diagnostic.CA1707.severity = none
[OrderSource.cs]
generated_code = true

Expand Down
100 changes: 87 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ the [Overview](#overview) section.<br>
* [Implementation Details](#implementation-details)
* [Architectural Restrictions and Other Limitations in the Old Version](#architectural-restrictions-and-other-limitations-of-the-old-version)
- [Documentation](#documentation)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Tools](#tools)
- [Samples](#samples)
- [Current State](#current-state)

Expand All @@ -58,7 +60,7 @@ prevent us from providing a state-of-the-art technological solution.
Feature development has already stopped for the [old version](https://github.com/dxFeed/dxfeed-net-api) of dxFeed .NET
API.

We expect the new repository to go into production in Q2’2023.
We expect the new repository to go into production in Q4’2023.
At the same time, the old version will be considered deprecated, and at the end of 2024, we plan to end the service.
If you’re already our customer and have difficulty with a future transition, please contact us via
our [customer portal](https://jira.in.devexperts.com/servicedesk/customer/portal/1).
Expand Down Expand Up @@ -96,18 +98,18 @@ ready to answer any questions and help with the transition.

#### Sample Mapping

| # | Sample | Old Version | New Version |
|:--:|:----------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------|
| 1 | How to subscribe to `Quote`, `Trade`, `TradeETH`, `Order`, `SpreadOrder`, `AnalyticOrder`, `TimeAndSale` events | [dxf_events_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_events_sample) | [DxFeed.Graal.Net.Samples.DxFeedConnect](samples/DxFeedConnect) |
| 2 | How to subscribe to `Candle` event | [dxf_candle_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_candle_sample) | [DxFeed.Graal.Net.Samples.CandleSample](samples/CandleSample) |
| 3 | How to receive IPF data from URL or file | [dxf_instrument_profile_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_instrument_profile_sample) | *Q3’2023*, please see [TBD](#future-development) section |
| 4 | How to subscribe to IPF live updates | [dxf_instrument_profile_live_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_instrument_profile_live_sample) | *Q3’2023*, please see [TBD](#future-development) section |
| 5 | How to subscribe to `Order`, `SpreadOrder`, `Candle`, `TimeAndSale`, `Greeks`, `Series` snapshots | [dxf_snapshot_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_snapshot_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| 6 | How to subscribe to depth of market | [dxf_price_level_book_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_price_level_book_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| 7 | How to receive snapshots of `TimeAndSale`, `Candle`, `Series`, `Greeks` events on a given time interval without live subscription | [dxf_simple_data_retrieving_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_simple_data_retrieving_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| 8 | How to subscribe to order snapshot with incremental updates | [dxf_inc_order_snapshot_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_inc_order_snapshot_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| 9 | How to retrieve `Candle` data from the candle web service | [dxf_candle_data_retrieving_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_candle_data_retrieving_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| 10 | How to retrieve `TimeAndSale` data from the candle web service | [dxf_tns_data_retrieving_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_tns_data_retrieving_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| # | Sample | Old Version | New Version |
|:--:|:----------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------|
| 1 | How to subscribe to `Quote`, `Trade`, `TradeETH`, `Order`, `SpreadOrder`, `AnalyticOrder`, `TimeAndSale` events | [dxf_events_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_events_sample) | [DxFeed.Graal.Net.Samples.DxFeedConnect](samples/DxFeedConnect) |
| 2 | How to subscribe to `Candle` event | [dxf_candle_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_candle_sample) | [DxFeed.Graal.Net.Samples.CandleSample](samples/CandleSample) |
| 3 | How to receive IPF data from URL or file | [dxf_instrument_profile_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_instrument_profile_sample) | [DxFeed.Graal.Net.Samples.DXFeedIpfConnect](samples/DXFeedIpfConnect) |
| 4 | How to subscribe to IPF live updates | [dxf_instrument_profile_live_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_instrument_profile_live_sample) | *Q4’2023*, please see [TBD](#future-development) section |
| 5 | How to subscribe to `Order`, `SpreadOrder`, `Candle`, `TimeAndSale`, `Greeks`, `Series` snapshots | [dxf_snapshot_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_snapshot_sample) | *Q2’2024*, please see [TBD](#future-development) section |
| 6 | How to subscribe to depth of market | [dxf_price_level_book_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_price_level_book_sample) | *Q2’2024*, please see [TBD](#future-development) section |
| 7 | How to receive snapshots of `TimeAndSale`, `Candle`, `Series`, `Greeks` events on a given time interval without live subscription | [dxf_simple_data_retrieving_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_simple_data_retrieving_sample) | *Q2’2024*, please see [TBD](#future-development) section |
| 8 | How to subscribe to order snapshot with incremental updates | [dxf_inc_order_snapshot_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_inc_order_snapshot_sample) | *Q2’2024*, please see [TBD](#future-development) section |
| 9 | How to retrieve `Candle` data from the candle web service | [dxf_candle_data_retrieving_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_candle_data_retrieving_sample) | *Q4’2024*, please see [TBD](#future-development) section |
| 10 | How to retrieve `TimeAndSale` data from the candle web service | [dxf_tns_data_retrieving_sample](https://github.com/dxFeed/dxfeed-net-api/tree/master/samples/dxf_tns_data_retrieving_sample) | *Q4’2024*, please see [TBD](#future-development) section |

### Implementation Details

Expand Down Expand Up @@ -162,6 +164,72 @@ Find useful information in our self-service dxFeed Knowledge Base or .NET API do
* [Order Book reconstruction](https://kb.dxfeed.com/en/data-model/dxfeed-order-book/order-book-reconstruction.html)
* [Symbology Guide](https://kb.dxfeed.com/en/data-model/symbology-guide.html)

## Requirements

### Windows

Only x64 versions are supported.

| OS | Version | Architectures |
|---------------------------------------|----------------|---------------|
| [Windows][Windows-client] | 8, 8.1 | x64 |
| [Windows 10][Windows-client] | Version 1607+ | x64 |
| [Windows 11][Windows-client] | Version 22000+ | x64 |
| [Windows Server][Windows-Server] | 2012+ | x64 |
| [Windows Server Core][Windows-Server] | 2012+ | x64 |
| [Nano Server][Nano-Server] | Version 1809+ | x64 |

#### Requirements

* [.NET 6][.NET 6] (not required for self-contained assemblies)
* [Visual C++ Redistributable for Visual Studio 2015][vc_redist]

[Windows-client]: https://www.microsoft.com/windows/

[Windows-Server]: https://learn.microsoft.com/windows-server/

[Nano-Server]: https://learn.microsoft.com/windows-server/get-started/getting-started-with-nano-server

[vc_redist]: [https://aka.ms/vs/17/release/vc_redist.x64.exe]

### Linux

Only x64 versions are supported.

#### Requirements

* [.NET 6][.NET 6] (not required for self-contained assemblies)

#### Libc compatibility

- [glibc][glibc]: 2.35+ (from Ubuntu 22.04)
- [musl][musl]: temporarily unsupported

#### Libpthread compatibility

A symlink on libpthread.so, libpthread.so.0, or libcoreclr.so must exist.

[glibc]: https://www.gnu.org/software/libc/

[musl]: https://musl.libc.org/

### macOS

| OS | Version | Architectures |
|----------------|---------|---------------|
| [macOS][macOS] | 10.15+ | x64 |
| [macOS][macOS] | 11+ | Arm64 |

Is supported in the Rosetta 2 x64 emulator.

[macOS]: https://support.apple.com/macos

#### Requirements

* [.NET 6][.NET 6] (not required for self-contained assemblies)

[.NET 6]: [https://dotnet.microsoft.com/en-us/download/dotnet/6.0]

## Installation

Add this [package source](https://dxfeed.jfrog.io/artifactory/api/nuget/v3/nuget-open) to NuGet config.
Expand Down Expand Up @@ -238,6 +306,12 @@ require .NET installation)
* [LatencyTest](https://github.com/dxFeed/dxfeed-graal-net-api/blob/main/src/DxFeed.Graal.Net.Tools/LatencyTest/LatencyTestTool.cs)
connects to the specified address(es) and calculates latency.

To run tools on macOs, it may be necessary to unquarantine them:

```
sudo /usr/bin/xattr -r -d com.apple.quarantine <directory_with_tools>
```

## Samples

* [DxFeed.Graal.Net.Samples.ConvertTapeFile](https://github.com/dxFeed/dxfeed-graal-net-api/blob/main/samples/ConvertTapeFile/Program.cs)
Expand Down
6 changes: 4 additions & 2 deletions StyleCop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<Rule Id="SA1309" Action="None"/><!-- FieldNamesMustNotBeginWithUnderscore -->
<Rule Id="SA1108" Action="None"/><!-- BlockStatementsMustNotContainEmbeddedComments -->
<Rule Id="SA1011" Action="None"/><!-- ClosingSquareBracketsMustBeSpacedCorrectly -->
<Rule Id="SA1600" Action="None"/><!-- Elements should be documented -->
<Rule Id="SA1649" Action="None"/><!-- File name must match type name -->
<Rule Id="SA1600" Action="None"/><!-- ElementsMustBeDocumented -->
<Rule Id="SA1649" Action="None"/><!-- FileNameMustMatchTypeName -->
<Rule Id="SA1310" Action="None"/><!-- FieldNamesMustNotContainUnderscore -->
<Rule Id="SA1629" Action="None"/><!-- DocumentationTextMustEndWithAPeriod -->
</Rules>
</RuleSet>
2 changes: 2 additions & 0 deletions dxfeed-graal-net-api.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=mddqa/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=intraday/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MSFT/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=multileg/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=multiplexor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dkey/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ddxfeed/@EntryIndexedValue">True</s:Boolean>
Expand Down Expand Up @@ -65,6 +66,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=sedol/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=setspecific/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=SPDR/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tradable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unconflateable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Underlyings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Usings/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace DxFeed.Graal.Net.Api.Osub;

/// <summary>
/// Represents subscription to time-series of events.
/// Instances of this class can be used with {@link DXFeedSubscription} to specify subscription
/// Instances of this class can be used with <see cref="DXFeedSubscription"/> to specify subscription
/// for time series events from a specific time. By default, subscribing to time-series events by
/// their event symbol object, the subscription is performed to a stream of new events as they happen only.
/// <br/>
Expand All @@ -24,8 +24,6 @@ namespace DxFeed.Graal.Net.Api.Osub;
/// <typeparam name="T">The type of event symbol.</typeparam>
public class TimeSeriesSubscriptionSymbol<T> : IndexedEventSubscriptionSymbol<T>
{
// ToDo Add a constructor overload to pass fromTime as DateTimeOffset.

/// <summary>
/// Initializes a new instance of the <see cref="TimeSeriesSubscriptionSymbol{T}"/> class
/// with a specified event symbol and from time in milliseconds since Unix epoch.
Expand Down
2 changes: 1 addition & 1 deletion src/DxFeed.Graal.Net/DxFeed.Graal.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DxFeed.Graal.Native" Version="0.4.0" />
<PackageReference Include="DxFeed.Graal.Native" Version="1.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/DxFeed.Graal.Net/Events/Market/OrderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public long TimeNanos
public OrderAction Action
{
get => OrderActionExt.ValueOf(BitUtil.GetBits(Flags, ActionMask, ActionShift));
set => BitUtil.SetBits(Flags, ActionMask, ActionShift, (int)value);
set => Flags = BitUtil.SetBits(Flags, ActionMask, ActionShift, (int)value);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/DxFeed.Graal.Net/Events/Market/SpreadOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public SpreadOrder(string? eventSymbol)
/// </summary>
/// <returns>The string representation.</returns>
public override string ToString() =>
"Order{" + BaseFieldsToString() +
"SpreadOrder{" + BaseFieldsToString() +
", spreadSymbol='" + StringUtil.EncodeNullableString(SpreadSymbol) + "'" +
"}";
}
9 changes: 5 additions & 4 deletions src/DxFeed.Graal.Net/Ipf/InstrumentProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ public string ExchangeData
/// Gets or sets list of exchanges where instrument is quoted or traded.
/// Its shall use the following format:
/// <code>
/// &lt;VALUE&gt; ::= &lt;empty&gt; | &lt;LIST&gt;
/// &lt;IST&gt; ::= &lt;MIC&gt; | &lt;MIC&gt; &lt;semicolon&gt;
/// &lt;VALUE&gt; ::= &lt;empty&gt; | &lt;LIST&gt;
/// &lt;IST&gt; ::= &lt;MIC&gt; | &lt;MIC&gt; &lt;semicolon&gt;
/// </code>
/// &lt;LIST&gt; the list shall be sorted by MIC.
/// </summary>
/// <example>"ARCX;CBSX ;XNAS;XNYS".</example>
/// <example>"ARCX;CBSX;XNAS;XNYS".</example>
public string Exchanges
{
get => exchanges;
Expand Down Expand Up @@ -460,6 +460,7 @@ public string SettlementStyle
/// </code>
/// the list shall be sorted by &lt;UPPER_LIMIT&gt;.
/// </summary>
/// <example>"0.25", "0.01 3; 0.05".</example>
public string PriceIncrements
{
get => priceIncrements;
Expand All @@ -480,5 +481,5 @@ public string TradingHours
/// </summary>
/// <returns>The string representation.</returns>
public override string ToString() =>
$"{type} {symbol}";
$"{Type} {Symbol}";
}
Loading

0 comments on commit 5c9cb48

Please sign in to comment.