Orders cancelled - not sure why

Orders cancelled - not sure why

I created a bot that enters stop limit orders with an expiry, but many of the orders are cancelled before their expiry time. I am not sure why this is happening.

I created some sample code that demonstrates the problem locally for me:

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class ProblemBot : Robot
    {
        private int _campaignId;
        private Random _random;

        [Parameter(DefaultValue = 1.0)]
        public double RiskPercent { get; set; }

        [Parameter(DefaultValue = 1000)]
        public int TradeSizeIncrement { get; set; }

        protected override void OnStart()
        {
            PendingOrders.Cancelled += PendingOrders_Cancelled;
            _random = new Random();
        }

        private void PendingOrders_Cancelled(PendingOrderCancelledEventArgs args)
        {
            Print("Order {0} (expires {1}) cancelled: {2}", args.PendingOrder.Label, args.PendingOrder.ExpirationTime, args.Reason);
        }

        protected override void OnBar()
        {
            var index = CurrentBar - 1;
            if (IsSignal())
            {
                _campaignId += 1;
                var high = MarketSeries.High[index];
                var low = MarketSeries.Low[index];
                var rangePips = (high - low) / Symbol.PipSize;
                var size = RoundDown(100 * RiskPercent * Account.Balance / rangePips);
                var interval = new TimeSpan(0, 12, 0, 0);
                var expiry = MarketSeries.OpenTime[CurrentBar].AddMilliseconds(-1) + interval;

                PlaceEntryOrder(TradeType.Buy, size, high, 1, _campaignId + "L0", rangePips, rangePips, expiry);
                PlaceEntryOrder(TradeType.Sell, size, low, 1, _campaignId + "S0", rangePips, rangePips, expiry);
            }
        }

        private TradeResult PlaceEntryOrder(TradeType side, double size, double trigger, double limitPips, string label, double islPips, double? takeProfitPips, DateTime expiry)
        {
            var res = PlaceStopLimitOrder(side, Symbol, size, trigger, limitPips, label, islPips, takeProfitPips, expiry);

            if (res.IsSuccessful)
                Print("Created {0} entry order {1}, size: {2}, trigger: {3}, expires: {4}", side, label, size, trigger, expiry);
            else
            {
                Print("Failed to create order {0}: {1}", label, res.Error);
            }

            return res;
        }

        private double RoundDown(double n, int mod = 2)
        {
            return mod * Math.Floor(n / (mod * TradeSizeIncrement)) * TradeSizeIncrement;
        }

        private bool IsSignal()
        {
            return _random.NextDouble() > 0.95;
        }

        private int CurrentBar
        {
            get { return MarketSeries.Close.Count - 1; }
        }
    }
}

Here's the tail end of a sample log output running against GBPUSD 12h, showing several examples of orders that are getting cancelled before they expire:

bot log output

Any clues?