How to know the minimum expiration time for a pending order in MQL4

How to know the minimum expiration time for a pending order in MQL4

Manage alerts

Loading saved threads...

Feduz · External communityPost link
External question — Stack Overflow Stack Exchange Author: Feduz Original post: https://stackoverflow.com/questions/73908120 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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
Quote
Report
PaulB · External communityPost link
External answer — Stack Overflow Stack Exchange Author: PaulB Original post: https://stackoverflow.com/a/73960314 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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.
Quote
Report

Post Reply

Checking account access…