Exemplo n.º 1
0
 public override async Task RunSample()
 {
     if (await IqClientApi.ConnectAsync())
     {                // open order EurUsd in smallest period (1min)
         var exp       = DateTime.Now.AddMinutes(1);
         var buyResult = await IqClientApi.BuyAsync(ActivePair.EURUSD, 1, OrderDirection.Call, exp);
     }
 }
        public override async Task RunSample()
        {
            if (await IqClientApi.ConnectAsync())
            {
                var result = await IqClientApi.BuyAsync(ActivePair.EURUSD_OTC, 1, OrderDirection.Call, DateTimeOffset.MinValue);

                Console.WriteLine($"PositionId = {result.PositionId}");
            }
        }
Exemplo n.º 3
0
        public override async Task RunSample()
        {
            if (await IqClientApi.ConnectAsync())
            {
                while (true)
                {
                    await Task.Delay(5000);

                    var result = await IqClientApi.BuyAsync(ActivePair.EURUSD_OTC, 1, OrderDirection.Call,
                                                            DateTimeOffset.Now);

                    Console.WriteLine($"PositionId = {result.PositionId}");
                }
            }
        }