Skip to main content

'Buy & Sell Pending Order' Block

Want to place a buy limit, buy stop, sell limit, or sell stop? Use Buy Pending Order or Sell Pending Order, set the Open Price Level, add SL/TP, OCO, expiration, and test pending orders in MT5 Visual Mode.

Summary

Use Buy Pending Order or Sell Pending Order when you want your EA to place an order at a specific price level instead of entering the market immediately.

Pending orders are useful when you want to trade only if price reaches a defined level, for example:

  • buy if price breaks above the previous candle high

  • sell if price breaks below the previous candle low

  • place an order at a moving average

  • place an order at a session high or low

  • place breakout orders above and below a range

Important: there is no separate Order Type dropdown inside the block.

You choose the correct block first:

Buy Pending Order

or:

Sell Pending Order

Then you define the Open Price Level where the pending order should be placed.

Also known as: pending order, buy limit, buy stop, sell limit, sell stop, breakout order, pending entry, order expiration, OCO order.


What is a pending order?

A pending order is an order that waits at a defined price.

It does not open a trade immediately.

The trade only opens if market price reaches the pending order level.

Example:

Current EURUSD price: 1.08500 Buy Pending Order level: 1.09000

The buy trade only opens if price reaches the pending order level.


Buy Pending Order vs Sell Pending Order

There are two separate blocks:

Buy Pending Order Sell Pending Order

Use Buy Pending Order when the future trade should be a buy.

Use Sell Pending Order when the future trade should be a sell.

The block itself defines the trade direction. The Open Price Level defines where the order is placed.


There is no “Order Type” dropdown

You do not select “Buy Limit”, “Buy Stop”, “Sell Limit”, or “Sell Stop” from a separate dropdown.

Instead, the behavior comes from:

1. Which pending order block you use 2. Where you place the Open Price Level

For example:

  • A Buy Pending Order above current price behaves like a breakout buy order.

  • A Buy Pending Order below current price behaves like a pullback buy order.

  • A Sell Pending Order below current price behaves like a breakout sell order.

  • A Sell Pending Order above current price behaves like a pullback sell order.

So if you are looking for a “buy limit order”, use the Buy Pending Order block and place the open price below the current market price.

If you are looking for a “buy stop order”, use the Buy Pending Order block and place the open price above the current market price.


Open Price Level

The Open Price Level defines where the pending order is placed.

You can use:

Option

Meaning

Ask

Current ask price

Bid

Current bid price

Mid

Midpoint between bid and ask

Custom Price

A specific price level from a source such as Candle, Indicator, Market Property, Value, Account, or Trade Info

Most pending order strategies use Custom Price.

Examples:

Buy Pending Order at previous candle high Sell Pending Order at previous candle low Buy Pending Order at Moving Average 20 Sell Pending Order at session low

Price level vs price fraction

For the Open Price Level, use a real price level.

Good examples:

Previous candle high Previous candle low Moving Average value London session high London session low

These are actual prices on the chart.

Do not confuse this with a price distance.

Example:

ATR = 25 pips

ATR is not an exact price level. ATR is a distance / price fraction.

Use ATR for stop loss or take profit distance with Custom Price Fraction, not as the Open Price Level unless your setup explicitly converts it into a real price level first.


Money Management

At the top of the block, choose how much to risk or trade.

Common options:

Option

Use when

Fixed Volume

You want to enter a fixed lot size, for example 0.01

Risk % of Equity

You want to risk a percentage of equity

Risk % of Balance

You want to risk a percentage of account balance

Risk Fixed Amount

You want to risk a fixed money amount

Martingale

You want lot size to adapt based on previous trade results

Custom Sequence

You want advanced sequence-based sizing

Some risk modes require a stop loss because the EA needs to calculate position size from the risk amount.


Stop Loss and Take Profit

You can configure stop loss and take profit inside the pending order block.

Common modes:

Mode

Use when

No Stop Loss

You intentionally do not want a stop loss

Fixed Pips

You want a fixed pip distance

Percentage of Price

You want SL/TP based on asset price percentage

Percentage of Take Profit

You want SL based on TP distance

Custom Price Level

You have an exact price, like candle low

Custom Price Fraction

You have a distance, like ATR

Example:

Buy Pending Order at Candle High ID 1 Stop Loss at Candle Low ID 1 Take Profit fixed at 100 pips

For ATR-based stop loss:

Stop Loss Mode: Custom Price Fraction Value: ATR

not Custom Price Level.


OCO Orders

OCO means One Cancels Other.

If enabled, the EA places a mirrored pending order at the same distance from current price.

If one order gets triggered, the other pending order is automatically deleted.

Use this for breakout setups where price may break either direction.

Example:

Buy Pending Order above range Sell Pending Order below range If buy triggers → sell order is deleted If sell triggers → buy order is deleted

OCO helps avoid being stuck with the opposite pending order after one side of the breakout has triggered.


Order Expiration

Order Expiration controls how long the pending order stays active.

Options include:

Option

Meaning

None

Order stays open until filled or manually/deleted by logic

Fixed Time

Order expires at a specific clock time

Relative Time

Order expires after a set number of days, hours, minutes, or seconds

Use expiration when your order is only valid for a limited time.

Example:

If you place a pending order based on a 1-hour candle, you may want it to expire after 1 hour if it is not triggered.


Example 1: Buy breakout above previous candle high

Goal:

Buy only if price breaks above the previous candle high.

Logic:

Run per Candle → Trade Rule: setup condition is true → Count Trades: buy trades = 0 → Buy Pending Order

Pending order settings:

Open Price Level: Custom Price → Candle High ID 1 Stop Loss: Custom Price Level → Candle Low ID 1 Order Expiration: Relative Time → 1 hour

Example 2: Sell breakout below previous candle low

Goal:

Sell only if price breaks below the previous candle low.

Logic:

Run per Candle → Trade Rule: setup condition is true → Count Trades: sell trades = 0 → Sell Pending Order

Pending order settings:

Open Price Level: Custom Price → Candle Low ID 1 Stop Loss: Custom Price Level → Candle High ID 1 Order Expiration: Relative Time → 1 hour

Example 3: Pullback entry at a moving average

Goal:

Only enter if price pulls back to a moving average.

Logic:

Run per Candle → Trade Rule: price is above MA20 → Count Trades: buy trades = 0 → Buy Pending Order

Pending order settings:

Open Price Level: Custom Price → Indicator → Moving Average 20 Order Expiration: Relative Time → 4 hours

This can be useful on higher timeframes where the moving average changes after each candle.


Example 4: Breakout order with OCO

Goal:

Place a breakout order on both sides of a range and cancel the opposite order after one side triggers.

Possible setup:

Buy Pending Order above range high OCO enabled Mirrored sell order below range low

If price breaks upward and triggers the buy, the mirrored sell order is automatically deleted.


When to use Delete Orders instead of expiration

Use Order Expiration when you simply want the pending order to expire after a fixed time.

Use Delete Orders when you want another logic condition to cancel the pending order.

Example:

If price reaches the invalidation level before entry → Select Trades → Delete Orders

This belongs in a separate Delete Orders guide because deleting orders requires trade-selection logic.

The usual order is:

Select Trades → Trade Rule / condition → Delete Orders

or:

Trade Rule / condition → Select Trades → Delete Orders

depending on the setup.


Common mistakes

Looking for an “Order Type” dropdown

There is no separate Order Type dropdown.

Choose Buy Pending Order or Sell Pending Order, then define the Open Price Level.


Using the wrong price source

If you want the order at the previous candle high, use:

Candle High ID 1

If you want the order at a moving average, use:

Indicator → Moving Average

If you want the order at a fixed price, use:

Value

Forgetting Count Trades

Without Count Trades, the EA may place repeated pending orders.

Recommended structure:

Trade Rule → Count Trades → Buy Pending Order / Sell Pending Order

Forgetting expiration

Pending orders can remain active if they are not triggered.

Use Order Expiration if the setup should only be valid for a specific time.


Confusing pending orders with open trades

A pending order is not an open trade yet.

Once the pending order is triggered, it becomes an open trade.

Use Delete Orders for pending orders.

Use Close Trades for open trades.


Best practices

Use pending orders when you want price to come to your level instead of entering immediately.

Place Count Trades close to the pending order block.

Use Order Expiration when the order should not stay active forever.

Use OCO for two-sided breakout setups.

Use Visual Mode in MT5 to confirm that pending orders are placed, triggered, expired, or deleted as expected.


Conclusion

Use Buy Pending Order or Sell Pending Order when you want to place an order at a defined future price.

There is no separate Order Type dropdown. The direction comes from the block you choose, and the pending order behavior comes from where you place the Open Price Level. For controlled setups, combine pending orders with Count Trades, Order Expiration, OCO, or Delete Orders logic.

Did this answer your question?