Skip to content

Commit

Permalink
Gateways
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiusgreat committed Jun 10, 2024
1 parent c15dd11 commit cbb46bb
Show file tree
Hide file tree
Showing 174 changed files with 1,466 additions and 2,726 deletions.
2 changes: 1 addition & 1 deletion Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Canvas.Views.Web" Version="3.1.4" />
<PackageReference Include="Estimator" Version="1.0.2" />
<PackageReference Include="MudBlazor" Version="6.19.1" />
<PackageReference Include="MudBlazor" Version="6.20.0" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 13 additions & 2 deletions Core/Domains/Gateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public interface IGateway : IDisposable
/// </summary>
IAccount Account { get; set; }

/// <summary>
/// Tape
/// </summary>
Action<StateModel<OrderModel>> OrderStream { get; set; }

/// <summary>
/// Connect
/// </summary>
Expand All @@ -42,7 +47,7 @@ public interface IGateway : IDisposable
/// Get quotes history
/// </summary>
/// <param name="message"></param>
Task<ResponseItemModel<IList<PointModel>>> GetPoints(PointMessageModel message);
Task<ResponseItemModel<IDictionary<string, PointModel>>> GetPoint(PointMessageModel message);

/// <summary>
/// Get option chains
Expand Down Expand Up @@ -73,11 +78,17 @@ public abstract class Gateway : IGateway
/// </summary>
public virtual IAccount Account { get; set; }

/// <summary>
/// Tape
/// </summary>
public virtual Action<StateModel<OrderModel>> OrderStream { get; set; }

/// <summary>
/// Constructor
/// </summary>
public Gateway()
{
OrderStream = o => { };
}

/// <summary>
Expand Down Expand Up @@ -107,7 +118,7 @@ public Gateway()
/// Get quotes history
/// </summary>
/// <param name="message"></param>
public abstract Task<ResponseItemModel<IList<PointModel>>> GetPoints(PointMessageModel message);
public abstract Task<ResponseItemModel<IDictionary<string, PointModel>>> GetPoint(PointMessageModel message);

/// <summary>
/// Get option chains
Expand Down
10 changes: 10 additions & 0 deletions Core/Models/Instruments/OptionMessageModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ public class OptionMessageModel
/// </summary>
public virtual string Name { get; set; }

/// <summary>
/// Min strike
/// </summary>
public virtual double? MinPrice { get; set; }

/// <summary>
/// Max strike
/// </summary>
public virtual double? MaxPrice { get; set; }

/// <summary>
/// End date
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions Core/Models/Instruments/OptionModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ public class OptionModel : ICloneable
/// </summary>
public virtual string Name { get; set; }

/// <summary>
/// The name of the underlying instrument
/// </summary>
public virtual string BaseName { get; set; }

/// <summary>
/// Strike price
/// </summary>
Expand Down
11 changes: 6 additions & 5 deletions Core/Models/Points/PointMessageModel.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;
using Terminal.Core.Enums;

namespace Terminal.Core.Models
{
public class PointMessageModel
{
/// <summary>
/// Symbol
/// </summary>
public virtual string Name { get; set; }

/// <summary>
/// End date
/// </summary>
Expand All @@ -24,5 +20,10 @@ public class PointMessageModel
/// Resolution
/// </summary>
public virtual ResolutionEnum? Resolution { get; set; }

/// <summary>
/// Symbol
/// </summary>
public virtual IList<string> Names { get; set; }
}
}
14 changes: 12 additions & 2 deletions Core/Models/Transactions/OrderModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ public class OrderModel : ICloneable
public virtual double? Price { get; set; }

/// <summary>
/// Side
/// Asset type
/// </summary>
public virtual OrderSideEnum? Side { get; set; }
public virtual string AssetType { get; set; }

/// <summary>
/// Custom order type
/// </summary>
public virtual string Combination { get; set; }

/// <summary>
/// Type
/// </summary>
public virtual OrderTypeEnum? Type { get; set; }

/// <summary>
/// Side
/// </summary>
public virtual OrderSideEnum? Side { get; set; }

/// <summary>
/// Time in force
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion Core/Validators/OptionValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class OptionValidator : AbstractValidator<OptionModel>
public OptionValidator()
{
RuleFor(o => o.Name).NotEmpty();
RuleFor(o => o.BaseName).NotEmpty();
RuleFor(o => o.Side).NotEmpty();
RuleFor(o => o.Strike).NotEmpty();
RuleFor(o => o.Leverage).NotEmpty();
Expand Down
Loading

0 comments on commit cbb46bb

Please sign in to comment.