How to know if the stop price has been reached in StopLimit Orders

Suminda Dharmasena
36

I believe a StopLimit order has 2 components

  • Stop price and
  • Limit price

I want to know if the stop price has been reached or not.

If it has, what elements of the orders has changed. E.g.

  • Can the StopLimit be modified and how? As this is not a limit order should I update the price? When accessing the order properties what change from before?
  • Can the TP be changes?
  • Can the SL be changed?
  • Are there restriction on what and when changes or cancellation of the order can be done?
Also what are the restrictions on StopLimit orders due to:
  • Stop Level restrictions
  • Freeze Level restrictions

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Carl Schreiber
Moderator
13172
Carl Schreiber  
Suminda Dharmasena:

I believe a StopLimit order has 2 components

  • Stop price and
  • Limit price

I want to know if the stop price has been reached or not.

If it has, what elements of the orders has changed. E.g.

  • Can the StopLimit be modified and how? As this is not a limit order should I update the price? When accessing the order properties what change from before?
  • Can the TP be changes?
  • Can the SL be changed?
  • Are there restriction on what and when changes or cancellation of the order can be done?
Also what are the restrictions on StopLimit orders due to:
  • Stop Level restrictions
  • Freeze Level restrictions

Do you know this: https://www.metatrader5.com/en/mobile-trading/iphone/help/trade/general_concept/order_types?

A Buy-Stop-Limit-Order becomes a Buy-Limit-Order if the higher price is reached.

You can change any (pending) order as long it hasen't become a position.

Check the way you manage all that by OrderSend().

Types of Orders - Trading Principles - MetaTrader 5 iPhone/iPad Help
Types of Orders - Trading Principles - MetaTrader 5 iPhone/iPad Help
  • www.metatrader5.com
The MetaTrader 5 mobile platform allows users to prepare and issue requests for the broker to execute trading operations. In addition, the platform...
Suminda Dharmasena
36
Suminda Dharmasena  
Carl Schreiber #:

Do you know this: https://www.metatrader5.com/en/mobile-trading/iphone/help/trade/general_concept/order_types?

A Buy-Stop-Limit-Order becomes a Buy-Limit-Order if the higher price is reached.

You can change any (pending) order as long it hasen't become a position.

Check the way you manage all that by OrderSend().

Many thanks for the reply.

If I am to understand correctly if I call something like the following after the Open Price has been reached:

OrderSelect(ticket);
const ENUM_ORDER_TYPE WhatIsTheTypeNow = (ENUM_ORDER_TYPE)OrderGetInteger(ORDER_TYPE);
double IsThisTheOriginalStopLimit = OrderGetDouble(ORDER_PRICE_OPEN);
double IsItZeroNow = OrderGetDouble(ORDER_PRICE_STOPLIMIT);

On a StopLimit order once the initial Open Price has been reached, then:

  • Order type above will change to ORDER_TYPE_*_LIMIT
  • Open price will change to the original StopLimit price and
  • Stop limit price will become zero?
Or will the resulting limit order be a new order? If so how can the can the original or resulting order be found given one of the tickets?
Dominik Egert
1236
Dominik Egert  
I am interested in this as well.

Deals, orders and positions are matched by POSITION_ID. This is unique as far as I know.

Can you please share your findings?

Regards
Alain Verleyen
42815

What's the purpose of this topic ? Laziness ?

Just try it and you will get your answers. Eventually reading the documentation could also be useful.

Dominik Egert
1236
Dominik Egert  
Yes, laziness. . .
Suminda Dharmasena
36
Suminda Dharmasena  
Alain Verleyen #:

What's the purpose of this topic ? Laziness ?

Just try it and you will get your answers. Eventually reading the documentation could also be useful.

Want to know how are the finer points on how each type of order is officially handled in MT/MQL especially StopLimits as documentation on them is very sparse.

When you try out something and figure it out this may rely on something undocumented. Also there is a risk of drawing wrong conclusion with what is observed by tinkering.  If there is a bug in the system then the conclusion from tinkering would be wrong.

Anyway anything to do what Market Micro structure and now orders are handled in the system should be better documented.