Skip to content
All library documents

Preparing Symbol-Aware Market Orders with Stops and Filling Rules

Article MQL5 code base

Summary

The document outlines a trade-opening function for a trading platform. It says the function derives an opening price, take-profit levels, and a stop-loss from user parameters and symbol information, then assembles a trade request containing details such as instrument, volume, order type, slippage, comment, and identifier. It submits that request and reads the returned result.

Two supporting routines address broker constraints. One selects an order-filling mode based on the symbol’s permitted policy, while another calculates a minimum trade distance using the symbol’s stop and freeze levels, keeping it within specified bounds. These details highlight that order submission needs to account for instrument-specific execution rules. The document offers only a functional overview: it provides no source implementation, examples of broker responses, evidence of execution quality, or discussion of how prices and risk parameters should be chosen. Traders would need to check the actual code and platform behavior before relying on it.

Key ideas

  • The opening routine calculates trade prices and risk levels from user inputs and symbol data.
  • It packages order details into a platform trade request and submits it.
  • The filling mode should conform to the instrument’s supported policy.
  • Minimum trade distance calculations account for stop and freeze restrictions.
  • The overview does not provide performance or execution-quality evidence.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.