Skip to content

Commit

Permalink
Prepare release 7.1.0-beta2 of SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegRa committed Apr 7, 2024
1 parent 2ec1dec commit cb251fa
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 53 deletions.
24 changes: 13 additions & 11 deletions Alpaca.Markets.Tests/AlpacaTradingClientTest.Positions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public async Task ExerciseOptionsPositionBySymbolAsyncWorks()
Assert.True(await mock.Client.ExerciseOptionsPositionBySymbolAsync(Stock));
}

#pragma warning disable IDE0079 // Remove unnecessary suppression
[SuppressMessage("ReSharper", "StringLiteralTypo")]
#pragma warning restore IDE0079 // Remove unnecessary suppression
private static JObject createPosition() =>
new(
new JProperty("unrealized_intraday_plpc", ProfitLossPercent),
Expand Down Expand Up @@ -145,17 +147,17 @@ private static void validatePosition(

Assert.NotEqual(Guid.Empty, position.AssetId);

Assert.True(position.AssetChangePercent != 0M);
Assert.True(position.AverageEntryPrice != 0M);
Assert.True(position.AssetCurrentPrice!= 0M);
Assert.True(position.AssetLastPrice != 0M);
Assert.True(position.MarketValue != 0M);
Assert.True(position.CostBasis != 0M);

Assert.True(position.UnrealizedProfitLoss != 0M);
Assert.True(position.UnrealizedProfitLossPercent != 0M);
Assert.True(position.IntradayUnrealizedProfitLoss != 0M);
Assert.True(position.IntradayUnrealizedProfitLossPercent != 0M);
Assert.NotEqual(0M, position.AssetChangePercent);
Assert.NotEqual(0M, position.AverageEntryPrice);
Assert.NotEqual(0M, position.AssetCurrentPrice);
Assert.NotEqual(0M, position.AssetLastPrice);
Assert.NotEqual(0M, position.MarketValue);
Assert.NotEqual(0M, position.CostBasis);

Assert.NotEqual(0M, position.UnrealizedProfitLoss);
Assert.NotEqual(0M, position.UnrealizedProfitLossPercent);
Assert.NotEqual(0M, position.IntradayUnrealizedProfitLoss);
Assert.NotEqual(0M, position.IntradayUnrealizedProfitLossPercent);
}

private static JArray getDeletePositionsResponse() =>
Expand Down
23 changes: 7 additions & 16 deletions Alpaca.Markets/Alpaca.Markets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,17 @@
</PropertyGroup>

<PropertyGroup>
<AssemblyVersion>7.1.0.0</AssemblyVersion>
<FileVersion>7.1.0.0</FileVersion>
<Version>7.1.0-beta1</Version>
<AssemblyVersion>7.1.0.1</AssemblyVersion>
<FileVersion>7.1.0.1</FileVersion>
<Version>7.1.0-beta2</Version>
</PropertyGroup>

<PropertyGroup>
<PackageReleaseNotes>
- Added the new `IAccount.OptionApprovedLevel` and `IAccount.OptionTradingLevel` properties.
- Added the new `IAccountConfiguration.MaxOptionTradingLevel` property.
- Added the new 'AssetType.UsOption` enumeration member.
- Added the new 'OptionTradingLevel` enumeration.
- Added the new `IOptionContract` interface and two related enums: `OptionType` and `OptionStyle`.
- Added the new `IAlpacaTradingClient.GetOptionContractByIdAsync` and `IAlpacaTradingClient.GetOptionContractBySymbolAsync` methods.
- Added the new `IAlpacaTradingClient.ListOptionContractsAsync` method and related `OptionContractsRequest` class.
- Added the new `IAlpacaOptionDataClient` interface and related factory methods and configuration class.
- Added the new `IAlpacaOptionDataClient.ListLatestQuotesAsync` and `IAlpacaOptionDataClient.ListLatestTradesAsync` methods.
- Added the new `IAlpacaOptionDataClient.ListSnapshotsAsync` and `IAlpacaOptionDataClient.GetOptionChainAsync` methods.
- Added the new `IAlpacaOptionDataClient.ListExchangesAsync` method for metadata requesting.
- The `IAlpacaOptionDataClient` interface extended with the `IHistoricalTradesClient` and `IHistoricalBarsClient` interfaces.
- The new `HistoricalOptionTradesRequest` and `HistoricalOptionBarsRequest` classes were added.
- The `OptionsContractRequest.UnderlyingSymbol` mandatory property was replaced with the `OptionsContractRequest.UnderlyingSymbols` optional property.
- The `IAlpacaTradingClient` interface was extended with the `ExerciseOptionsContractByIdAsync` and `ExerciseOptionsContractBySymbolAsync` methods.
- The `IAlpacaTradingClient.ListOptionContractAsync` method now uses a same pagination logic as historical data.
- The `OptionFeed` enum added and now it can be specified for latest/snapshot requests.
</PackageReleaseNotes>
<Description>C# SDK for Alpaca Trade API https://docs.alpaca.markets/</Description>
<RepositoryUrl>https://github.com/alpacahq/alpaca-trade-api-csharp</RepositoryUrl>
Expand Down
8 changes: 0 additions & 8 deletions Alpaca.Markets/Helpers/HttpClientExtensions.Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

internal static partial class HttpClientExtensions
{
public static Task<Boolean> TryPostAsync(
this HttpClient httpClient,
UriBuilder uriBuilder,
RateLimitHandler rateLimitHandler,
CancellationToken cancellationToken) =>
callAndReturnSuccessCodeAsync(
httpClient, HttpMethod.Post, uriBuilder.Uri, rateLimitHandler, cancellationToken);

public static Task<Boolean> TryPostAsync(
this HttpClient httpClient,
String endpointUri,
Expand Down
18 changes: 18 additions & 0 deletions Alpaca.Markets/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ Alpaca.Markets.IAlpacaTradingClient.DeleteAssetFromWatchListByNameAsync(Alpaca.M
Alpaca.Markets.IAlpacaTradingClient.DeletePositionAsync(Alpaca.Markets.DeletePositionRequest! request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Alpaca.Markets.IOrder!>!
Alpaca.Markets.IAlpacaTradingClient.DeleteWatchListByIdAsync(System.Guid watchListId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<bool>!
Alpaca.Markets.IAlpacaTradingClient.DeleteWatchListByNameAsync(string! name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<bool>!
Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid contractId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<bool>!
Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(string! symbol, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<bool>!
Alpaca.Markets.IAlpacaTradingClient.GetAccountAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Alpaca.Markets.IAccount!>!
Alpaca.Markets.IAlpacaTradingClient.GetAccountConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Alpaca.Markets.IAccountConfiguration!>!
Alpaca.Markets.IAlpacaTradingClient.GetAnnouncementAsync(System.Guid announcementId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Alpaca.Markets.IAnnouncement!>!
Expand Down Expand Up @@ -921,6 +923,11 @@ Alpaca.Markets.LatestMarketDataRequest.Feed.get -> Alpaca.Markets.MarketDataFeed
Alpaca.Markets.LatestMarketDataRequest.Feed.set -> void
Alpaca.Markets.LatestMarketDataRequest.LatestMarketDataRequest(string! symbol) -> void
Alpaca.Markets.LatestMarketDataRequest.Symbol.get -> string!
Alpaca.Markets.LatestOptionsDataRequest
Alpaca.Markets.LatestOptionsDataRequest.LatestOptionsDataRequest(System.Collections.Generic.IEnumerable<string!>! symbols) -> void
Alpaca.Markets.LatestOptionsDataRequest.OptionsFeed.get -> Alpaca.Markets.OptionsFeed?
Alpaca.Markets.LatestOptionsDataRequest.OptionsFeed.set -> void
Alpaca.Markets.LatestOptionsDataRequest.Symbols.get -> System.Collections.Generic.IReadOnlyCollection<string!>!
Alpaca.Markets.LatestOrderBooksRequest
Alpaca.Markets.LatestOrderBooksRequest.Exchanges.get -> System.Collections.Generic.IReadOnlyCollection<Alpaca.Markets.CryptoExchange>!
Alpaca.Markets.LatestOrderBooksRequest.LatestOrderBooksRequest(System.Collections.Generic.IEnumerable<string!>! symbols) -> void
Expand Down Expand Up @@ -1015,6 +1022,11 @@ Alpaca.Markets.OpenClose.OpenClose() -> void
Alpaca.Markets.OpenClose.OpenEst.get -> System.DateTimeOffset
Alpaca.Markets.OpenClose.OpenEst.init -> void
Alpaca.Markets.OpenClose.ToInterval() -> Alpaca.Markets.Interval<System.DateTime>
Alpaca.Markets.OptionChainRequest
Alpaca.Markets.OptionChainRequest.OptionChainRequest(string! underlyingSymbol) -> void
Alpaca.Markets.OptionChainRequest.OptionsFeed.get -> Alpaca.Markets.OptionsFeed?
Alpaca.Markets.OptionChainRequest.OptionsFeed.set -> void
Alpaca.Markets.OptionChainRequest.UnderlyingSymbol.get -> string!
Alpaca.Markets.OptionContractsRequest
Alpaca.Markets.OptionContractsRequest.AssetStatus.get -> Alpaca.Markets.AssetStatus?
Alpaca.Markets.OptionContractsRequest.AssetStatus.set -> void
Expand All @@ -1024,7 +1036,9 @@ Alpaca.Markets.OptionContractsRequest.ExpirationDateGreaterThanOrEqualTo.get ->
Alpaca.Markets.OptionContractsRequest.ExpirationDateGreaterThanOrEqualTo.set -> void
Alpaca.Markets.OptionContractsRequest.ExpirationDateLessThanOrEqualTo.get -> System.DateOnly?
Alpaca.Markets.OptionContractsRequest.ExpirationDateLessThanOrEqualTo.set -> void
Alpaca.Markets.OptionContractsRequest.OptionContractsRequest() -> void
Alpaca.Markets.OptionContractsRequest.OptionContractsRequest(string! underlyingSymbol) -> void
Alpaca.Markets.OptionContractsRequest.OptionContractsRequest(System.Collections.Generic.IEnumerable<string!>! underlyingSymbols) -> void
Alpaca.Markets.OptionContractsRequest.OptionStyle.get -> Alpaca.Markets.OptionStyle?
Alpaca.Markets.OptionContractsRequest.OptionStyle.set -> void
Alpaca.Markets.OptionContractsRequest.OptionType.get -> Alpaca.Markets.OptionType?
Expand All @@ -1036,6 +1050,10 @@ Alpaca.Markets.OptionContractsRequest.StrikePriceGreaterThanOrEqualTo.get -> dec
Alpaca.Markets.OptionContractsRequest.StrikePriceGreaterThanOrEqualTo.set -> void
Alpaca.Markets.OptionContractsRequest.StrikePriceLessThanOrEqualTo.get -> decimal?
Alpaca.Markets.OptionContractsRequest.StrikePriceLessThanOrEqualTo.set -> void
Alpaca.Markets.OptionContractsRequest.UnderlyingSymbols.get -> System.Collections.Generic.IReadOnlyCollection<string!>!
Alpaca.Markets.OptionsFeed
Alpaca.Markets.OptionsFeed.Indicative = 1 -> Alpaca.Markets.OptionsFeed
Alpaca.Markets.OptionsFeed.Opra = 0 -> Alpaca.Markets.OptionsFeed
Alpaca.Markets.OptionsTradingLevel
Alpaca.Markets.OptionsTradingLevel.CoveredCallCashSecuredPut = 1 -> Alpaca.Markets.OptionsTradingLevel
Alpaca.Markets.OptionsTradingLevel.Disabled = 0 -> Alpaca.Markets.OptionsTradingLevel
Expand Down
18 changes: 0 additions & 18 deletions Alpaca.Markets/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
#nullable enable
Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid contractId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<bool>!
Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(string! symbol, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<bool>!
Alpaca.Markets.LatestOptionsDataRequest
Alpaca.Markets.LatestOptionsDataRequest.LatestOptionsDataRequest(System.Collections.Generic.IEnumerable<string!>! symbols) -> void
Alpaca.Markets.LatestOptionsDataRequest.OptionsFeed.get -> Alpaca.Markets.OptionsFeed?
Alpaca.Markets.LatestOptionsDataRequest.OptionsFeed.set -> void
Alpaca.Markets.LatestOptionsDataRequest.Symbols.get -> System.Collections.Generic.IReadOnlyCollection<string!>!
Alpaca.Markets.OptionChainRequest
Alpaca.Markets.OptionChainRequest.OptionChainRequest(string! underlyingSymbol) -> void
Alpaca.Markets.OptionChainRequest.OptionsFeed.get -> Alpaca.Markets.OptionsFeed?
Alpaca.Markets.OptionChainRequest.OptionsFeed.set -> void
Alpaca.Markets.OptionChainRequest.UnderlyingSymbol.get -> string!
Alpaca.Markets.OptionContractsRequest.OptionContractsRequest() -> void
Alpaca.Markets.OptionContractsRequest.OptionContractsRequest(System.Collections.Generic.IEnumerable<string!>! underlyingSymbols) -> void
Alpaca.Markets.OptionContractsRequest.UnderlyingSymbols.get -> System.Collections.Generic.IReadOnlyCollection<string!>!
Alpaca.Markets.OptionsFeed
Alpaca.Markets.OptionsFeed.Indicative = 1 -> Alpaca.Markets.OptionsFeed
Alpaca.Markets.OptionsFeed.Opra = 0 -> Alpaca.Markets.OptionsFeed

0 comments on commit cb251fa

Please sign in to comment.