forked from DigitalRuby/ExchangeSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCancelOrderOption.cs
More file actions
31 lines (23 loc) · 781 Bytes
/
Copy pathCancelOrderOption.cs
File metadata and controls
31 lines (23 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Threading.Tasks;
using CommandLine;
using ExchangeSharpConsole.Options.Interfaces;
namespace ExchangeSharpConsole.Options
{
[Verb("cancel", HelpText = "Cancel an order in a given exchange.")]
public class CancelOrderOption : BaseOption,
IOptionPerOrderId, IOptionPerExchange, IOptionWithKey, IOptionWithMarketSymbol
{
public override async Task RunCommand()
{
using var api = await GetExchangeInstanceAsync(ExchangeName);
api.LoadAPIKeys(KeyPath);
await api.CancelOrderAsync(OrderId, api.NormalizeMarketSymbol(MarketSymbol));
Console.WriteLine("Done.");
}
public string OrderId { get; set; }
public string ExchangeName { get; set; }
public string MarketSymbol { get; set; }
public string KeyPath { get; set; }
}
}