I am puzzled by positions being autoclosed on Testnet futures at 00:00 UTC. I am not certain it happens every day, but it happens with sufficient regularity that it is now becoming irritating.
For example, today I had a small (.4 BTC), profitable (~100 USDT) position opened and managed through the API by my trading engine. There was realized profit (compared with the initial 10K seed) of 3K in the account (a total of 13K+). So (acknowledging that funds are imaginary) there was little maintenance margin required, and more than sufficient funds to meet the margin requirements and pay any funding fee at 00:00 - so no apparent reason to close the position. However, the position was liquated (and profit realized) but that is not what I wanted. I am exercising the trading engine and I want to monitor the decisions it makes.
The Client OrderId as it appeared in the USER_DATA_UPDATE stream was settlement_autoclose_xxx (a type that is not documented anywhere that I could find; autoclose is mentioned in the FUTURES API but not settlement_autoclose; and autoclose is supposed to be the start of a liquidation order, with no further discussion of what causes liquidation orders at Binance API Documentation).
So the question is, what is causing this behavior/where is it documented?? The behavior significantly reduces the utility of Testnet to test automation through the API for extended (longer than one day) periods.