burakoner / OKEx.Net

Open source .Net API wrapper for the @OKEx V5 Rest API and V5 Websocket API
MIT License
86 stars 48 forks source link

Can't get list of deals sequentially #87

Closed dfh45h45h45h closed 1 year ago

dfh45h45h45h commented 1 year ago

I can’t get deals sequentially moving into the past, although the same code with the after argument works great for getting the history of candles, here’s a screenshot of the answer Screenshot_1

long? new_time = null;
            for (int i = 0; i < 3; i++)
            {

                var trade_11 = api.GetOrderArchive(OkexInstrumentType.Swap, after: new_time, limit: 3);
                Show_Mess("call-1 " + trade_11.Data.ToArray().Length + " time gets - " + new_time);
                foreach (var item in trade_11.Data)
                {
                    var unix_time = item.CreateTime.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
                    new_time = (long?)unix_time;
                    Show_Mess(Convert.ToString(item.FillTime + " | " + unix_time + " | " + new_time)); // gets string line textBox form
                } 
            }