Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/havendv/moexiis
C# client library and OpenAPI spec for Moex IIS
https://github.com/havendv/moexiis
client csharp iis moex net5 net6 netcore netstandard openapi rest swagger
Last synced: 29 days ago
JSON representation
C# client library and OpenAPI spec for Moex IIS
- Host: GitHub
- URL: https://github.com/havendv/moexiis
- Owner: HavenDV
- License: mit
- Created: 2022-04-28T09:37:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-22T03:49:03.000Z (12 months ago)
- Last Synced: 2024-10-06T09:21:43.189Z (about 1 month ago)
- Topics: client, csharp, iis, moex, net5, net6, netcore, netstandard, openapi, rest, swagger
- Language: C#
- Homepage:
- Size: 638 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# MoexIIS
C# client library and OpenAPI spec for Moex IIS## Nuget
[![NuGet](https://img.shields.io/nuget/dt/MoexIIS.svg?style=flat-square&label=MoexIIS)](https://www.nuget.org/packages/MoexIIS/)
```
Install-Package MoexIIS
```## Usage
```cs
using MoexIIS;using var client = new HttpClient();
var api = new MoexIISApi(client);await api.AuthenticateAsync(username, password);
var values = await api.GetOpenPositionsOnFuturesAsync("si", iss_json: "extended", iss_meta: "off");
var positions = values.ElementAt(1).Futoi ?? throw new InvalidOperationException("Futoi is null.");
var yur = positions.ElementAt(0);
var fiz = positions.ElementAt(1);
var dates = values.ElementAt(1).FutoiDates ?? throw new InvalidOperationException("FutoiDates is null.");
var from = dates.ElementAt(0).From;
var till = dates.ElementAt(0).Till;Console.WriteLine($"Open positions: {from}-{till}");
Console.WriteLine($"Time: {yur.Tradetime}. Group: {yur.Clgroup}. Longs: {yur.Pos_long}/{yur.Pos_long_num}. Shorts: {-yur.Pos_short}/{yur.Pos_short_num}");
Console.WriteLine($"Time: {fiz.Tradetime}. Group: {fiz.Clgroup}. Longs: {fiz.Pos_long}/{fiz.Pos_long_num}. Shorts: {-fiz.Pos_short}/{fiz.Pos_short_num}");
```## Contacts
* [mail](mailto:[email protected])## Links
Initial OpenAPI spec from:
https://github.com/Klawru/MoexApiSwagger