Now I'm just thinking that I'm calling contractCheck , can it be because of this ? But I have only short put/call, no undelying

contractCheck (TRADE*): int
Checks if the option trade is still open. If not, it is assumed that it was expired or exercised. Open positions of the underlying are then also checked and automatically sold at market. This function can be called regularly in a for(open_trades) loop for keeping the positions between broker and strategy in sync. The GET_POSITION command must be supported by the broker API, and no other trades with the same contract type, strike, expiry, and underlying must be opened.