I'm trying to write a script to send orders. It works fine, except when I enter the expiration for pending orders. The broker i'm working with doesn't allow me enter an expiration less than 10 minutes. I was looking for a specific function that return the limits imposed by the broker for the expiration of pending orders. I tried to look for it on the official documentation, but I can't find it. Does anyone know if it exists?
Thank you
As far as I am aware there is no way to programmatically determine the minimum expiration for pending orders set by your broker.
Further, I'm sure the minimum 10 minutes you refer to is the normal standard for brokers.
Your only option is to check for Error 147 (ERR_TRADE_EXPIRATION_DENIED) when placing your orders, and if received, increase the expiration time until you stop receiving the error.