Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 532

 
Asa saas:

Please explain me the point -"Market orders cannot be closed if their StopLoss or TakeProfit values violate the FreezeLevel parameter."

Does this literally mean that a market order cannot be closed if its TakeProfit or StopLoss does not meet the FreezeLevel? I just don't quite understand how an open market order can have stops that violate the StopLevel or FreezeLevel rules? After all, if the wrong stops are set, the server will just give an error and no stops will be set.

Also please advise what else we need to know when closing a market order, when a broker uses FreezeLevel?

Just need to understand correctly what FreezeLevel is. In simple words, this is distance from order opening at which it is impossible to close the order in any way, using scripts/advisors or hands. This is the distance from the open price. Stops are not placed in this zone accordingly.

 
Asa saas:

Please explain me the point -"Market orders cannot be closed if their StopLoss or TakeProfit values violate the FreezeLevel parameter."

Does this literally mean that a market order cannot be closed if its TakeProfit or StopLoss does not meet the FreezeLevel? I just don't quite understand how an open market order can have stops that violate the StopLevel or FreezeLevel rules? After all, if the wrong stops are set, the server will just give an error and no stops will be set.

Also please advise what else we should know when closing a market order when broker uses FreezeLevel?

Freeze Level is a distance from Stop Loss or Take Profit of a market order to the current price (Bid of Buy order or Ask of Sell order) at which a market order cannot be closed. In other words, if a market order is about to close at SL or TP, it cannot be closed by other means.

Freezing is not practically used anywhere else at the moment. I can't even think of a broker with such a restriction right now.

 
Alexey Viktorov:

You just need to correctly understand what FreezeLevel is. In simple words, it is the distance from order opening within which you cannot close the order ANYWHERE, neither by scripts/advisors, nor by hands. It is from the open price. Stops are not placed in this zone accordingly.

No. Exactly from the price of anticipated closing. That is, from Stop Loss or Take Profit. Or from the opening price of a pending order, if you mean pending orders.

Общие принципы - Торговые операции - MetaTrader 5
Общие принципы - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Перед тем как приступить к изучению торговых функций платформы, необходимо создать четкое представление об основных терминах: ордер, сделка и позиция. — это распоряжение брокерской компании купить или продать финансовый инструмент. Различают два основных типа ордеров: рыночный и отложенный. Помимо них существуют специальные ордера Тейк Профит...
 
Ihor Herasko:

No. It is on the expected closing price. That is from Stop Loss or Take Profit. Or from the opening price of a pending order, if you mean pending orders.

However, the error did not give much. Shaitan got it wrong -D

 

Thank you all for the explanations! I take it that even the most kitchen brokers don't use FreezeLevel anymore, so the Freezelevel check is probably not so obligatory anymore?

 
Asa saas:

Thank you all for the explanations! I take it that even the most kitchen brokers don't use FreezeLevel anymore, and therefore the FreezeLevel check is probably not so obligatory anymore?

I already forgot when I used FreezeLevel check in my codes...

 
Ihor Herasko:

I've already forgotten when I've used FreezeLevel check in my codes...

I've never used it, because I haven't seen it anywhere in practice in 10 years

 
Vitaly Muzichenko:

I've never used it because I haven't seen it in practice anywhere in 10 years

And the marketplace demands it. Sometimes.
 
Hello all!

Need help with the strategy tester.
How can I programmatically get the testing interval, which is specified in the tester settings?
I can't get it through testerstatistics().
 
mrumskiy:
Hi there!

Need help with the strategy tester.
How can I programmatically get the testing interval, which is specified in the tester settings?
I cannot get it via testerstatistics().

There is no way to get this information through MQL. I need to access the DateTimePricker controls using WinAPI.

Reason: