Skip to content
All library documents

A Script for Submitting Market and Pending Orders with Protective Levels

Article MQL5 code base

Summary

The document describes a script for placing buy or sell market orders and buy or sell limit and stop orders. It lets the user specify stop loss and take profit distances in pips, avoiding the need to calculate decimal price adjustments manually. Slippage and lot size are also configurable for market orders; pending orders require the desired entry price, and a trailing stop can be added optionally.

After execution, the script reports whether the order was submitted or provides an error code and category. These messages offer basic feedback about submission, but the document gives no implementation details, broker compatibility information, or evidence about execution quality. It also does not explain how the script handles position sizing, rejected orders beyond reporting an error, or whether attached protective levels are guaranteed by a broker.

Key ideas

  • The script supports buy and sell market orders as well as limit and stop pending orders.
  • Users enter stop loss and take profit distances in pips instead of manually adjusting decimal prices.
  • Market order inputs include slippage and lot size, while pending orders require an entry price.
  • A trailing stop is optional, and execution produces a success or error message.
  • The document provides no evidence about broker compatibility or execution quality.

Tags

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