How near can I set pending order from current price?

How near can I set pending order from current price?

Is there something at symbol properties I can look at for this?

SunfireHow near can I set pending order from current price? Is there something at symbol properties I can look at for this?

```//+--------------------------------------------------------------------------------------------------------------------+
//| This function checks the minimum distance in points from current closing price for placing stop orders             |
//+--------------------------------------------------------------------------------------------------------------------+
bool CheckStopsLevel(double Price, ENUM_ORDER_TYPE Type)
{
//--- Determines last price for current symbol
double BID = SymbolInfoDouble(Symbol(), SYMBOL_BID);

//--- Result of checking
bool Check = true;

//--- Check the order type
switch(Type)
{
{
//--- Check the distance from the current price to the activation price
Check = ((Price - ASK) > StopsLevel * Point());
if(!Check)
{ERRMSG = "The distance from the current price to the order opening price is invalid.";}
}
break;
//--- SellStop pending order
case  ORDER_TYPE_SELL_STOP:
{
//--- Check the distance from the current price to the activation price
Check = ((BID - Price) > StopsLevel * Point());
if(!Check)
{ERRMSG = "The distance from the current price to the order opening price is invalid.";}
}
break;
}

//--- Verification succeeded
return(Check);
}
```
```//+--------------------------------------------------------------------------------------------------------------------+
//| This function checks the distance from opening price to activation price                                           |
//+--------------------------------------------------------------------------------------------------------------------+
bool CheckFreezeLevel(ulong TICKET)
{
//--- Determines last price for current symbol
double BID = SymbolInfoDouble(Symbol(), SYMBOL_BID);

//--- Select order for working
if(!OrderSelect(TICKET))
{
//--- Failed to select order
ERRMSG = StringFormat("Error selecting order to work, ticket ", TICKET);
return(false);
}

//--- Get the order data
double Price = OrderGetDouble(ORDER_PRICE_OPEN);
ENUM_ORDER_TYPE Type = (ENUM_ORDER_TYPE) OrderGetInteger(ORDER_TYPE);

//--- Result of checking
bool Check = true;

//--- Check the order type
switch(Type)
{
{
//--- Check the distance from the opening price to the activation price
Check = ((Price - ASK) > FreezeLevel * Point());
if(!Check)
{ERRMSG = StringFormat("Order %s #%d cannot be modified: Ask-Open=%d points < SYMBOL_TRADE_FREEZE_LEVEL=%d points ", EnumToString(Type), TICKET, int(((Price - ASK) / Point())), FreezeLevel);}
}
break;
//--- SellStop pending order
case  ORDER_TYPE_SELL_STOP:
{
//--- Check the distance from the opening price to the activation price
Check = ((BID - Price) > FreezeLevel * Point());
if(!Check)
{ERRMSG = StringFormat("Order %s #%d cannot be modified: Bid-Open=%d points < SYMBOL_TRADE_FREEZE_LEVEL=%d points ", EnumToString(Type), TICKET, int(((BID - Price) / Point())), FreezeLevel);}
}
break;
}

//--- Verification succeeded
return(Check);
}
```

Sunfire: How near can I set pending order from current price? Is there something at symbol properties I can look at for this?

You have to verify that your stops and/or pending orders abide by the Stops Level and Freeze Level conditions set by your broker's contract specifications.