Is FreezeLevel is always lesser than StopLevel?

 

No  FreezeLevel is not always less than StopLevel.

They’re independent broker/server limits:

  • StopLevel: the minimum distance (in points) you must keep when setting SL/TP or pending prices.

  • FreezeLevel: a “no-touch zone” near the current price where you cannot modify/cancel/close an order.

Either one can be 0, they can be equal, or FreezeLevel can be greater than StopLevel (and vice versa). In EAs, it’s common to treat the effective safety distance as max(StopLevel, FreezeLevel) when deciding whether a modify is allowed.

[Deleted]  
Andreas Smigadis #:

No  FreezeLevel is not always less than StopLevel.

They’re independent broker/server limits:

  • StopLevel: the minimum distance (in points) you must keep when setting SL/TP or pending prices.

  • FreezeLevel: a “no-touch zone” near the current price where you cannot modify/cancel/close an order.

Either one can be 0, they can be equal, or FreezeLevel can be greater than StopLevel (and vice versa). In EAs, it’s common to treat the effective safety distance as max(StopLevel, FreezeLevel) when deciding whether a modify is allowed.

int gMinPointLevel = MathMax(MathMax(MarketInfo(Symbol(), MODE_STOPLEVEL)+2, MarketInfo(Symbol(), MODE_FREEZELEVEL)+2), MarketInfo(Symbol(), MODE_SPREAD)+2);


Is this correct, i am including spread so Modify/SL/TP will not fall in middle of Ask and Bid price to avoid error and order rejection. 
 
Shanmugi #:


Is this correct, i am including spread so Modify/SL/TP will not fall in middle of Ask and Bid price to avoid error and order rejection. 

MODE_SPREAD should not be part of that MathMax() for stop validation.

The broker checks SL/TP distance against StopLevel (and modification eligibility against FreezeLevel) and, crucially, against the correct price side

  • BUY stops are validated from Bid

  • SELL stops are validated from Ask

So use..

minPts = MathMax(MODE_STOPLEVEL, MODE_FREEZELEVEL) + buffer;

 and then compute SL/TP from Bid/Ask as appropriate.

Including spread can over inflate distances and won’t fix the real cause of rejections.