“Open price must be set to at least X points different than market price”

 

Hello Everyone,

Would appreciate your assistance please. I have a question and would like to firstly answer myself and provide according to my own understanding the solution which looks to me that it won't be correct one - at least it didn't help to me. I would need from you to judge if answer/solution what do you think about it and what might be more appropriate solution instead.

In New Order window, for orders Buy Stop, Sell Stop, Buy Limit, Sell Limit, I see the following warning message at the bottom "Open price must be set to at least X points different than market price" where X is quantity of points. I don't know if X is dynamic value or static. Dynamic value means that for one trading symbol the X is different than for same identical ( ! ) trading symbol next hour or next day or new week or in the past. So X varies. Static value obviously means it is all the time the same. So I repeat that I don't know if the X is dynamic or static, it might even depend on particular trading symbol. Anyway, this is NOT my question.I would like to open a pending order of either of four said types. I am not using TP SL values. Only entry price value. Please note that I want to have entry price as close as possible to the current market price so the minimum possible distance.

However, before I type entry price, I measure the quantity of points from current market price directly on chart using MIDDLE value of CROSSHAIR icon feature and I am able to type the entry price which is X points away (if Buy Stop: above, if Sell Stop: below, if Buy Limit: below, if Sell Limit: above) from market price so the price which is exactly X points away from current market price. But when I want to execute that PENDING order (either of four types I mentioned), I get ERROR MESSAGE SAYING ENTERED IS INVALID DATA so since I am only entering entry price, there must be something wrong with it. What I did next was changing (if Buy Stop: increasing, if Sell Stop: decreasing, if Buy Limit: decreasing, if Sell Limit: increasing) entry price for few micropips. The reason why just few is as I said twice, and will for the third time, that I want distance to be as close as possible between entry price of that PENDING order and current market price so please don't tell me ''enter entry price far away and you have a guarantee that error message won't occur''. I cannot and won't do this so that won't help. Changing entry price to few micropips didn't work so I decided to change it again, for another micropip. Even this didn't work. The reason why I was changing is because I thought the current market price has changed right at the time when I wanted to execute the pending order but this is not true.

To answer my own question: that error might occur due to the currently active SPREAD which may mean, as my randomely guessed solution, that the entered entry price in Add Order window for pending order (either of four types I mentioned) must be X points (message at the bottom of this window) away from current market price PLUS quantity of Spread points but even this is not true because X value already contains the current (the word ''current'' is indicating that X is most likely dynamic value) Spread, at least I think so. What else could I do to avoid Invalid Data error message in New Order window after trying to execute pending order? I doubt very much there would a MT4 (pc) tool telling me for every single symbol from Menu list (regardless of instrument type) what are four different prices (why four? because there are four type of pending orders!) with 100% guarantee to show MINIMUM possible distance between entry price on pending order and current market price. Something like this doesn't exist.

Thank you very much in advance!

 

Sorry, I didn't read your long post, but I think I got the idea.

I believe you need to put into consideration the broker's stoplevel in points which is the "X". 

Just a quick search for what is this "stoplevel" will solve the story.

Hint: MarketInfo(Symbol(),MODE_STOPLEVEL)

I wish, I'm not wrong.

 

Osama I would need you to read entire message. Its not a long post, very few sentences. I spent time working on it so I would need someone to also spend his/her/your time to read it appropriately and consider the solution. Also I don't know what is:

"Hint: MarketInfo(Symbol(),MODE_STOPLEVEL)"

Never seen anything like that. Please read my message above.

 
Tammy0: Never seen anything like that. Please read my message above.
  1. Perhaps you should read the manual.
  2. We did read your message.
  3. MarketInfo MODE_STOPLEVEL is  your "X" Minimum distance from market to stops (TP/SL) or from market to pending (limit/stop) open price.

    MODE_STOPLEVEL

    14

    Stop level in points

     

    A zero value of MODE_STOPLEVEL means either absence of any restrictions on the minimal distance for Stop Loss/Take Profit or the fact that a trade server utilizes some external mechanisms for dynamic level control, which cannot be translated in the client terminal. In the second case, GetLastError() can return error 130, because MODE_STOPLEVEL is actually "floating" here.


 
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
  • book.mql4.com
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
 
Whroeder1 what should I do with those two words and one underline symbol: "MODE_STOPLEVEL"   ?   
 
Tammy0: Whroeder1 what should I do with those two words and one underline symbol: "MODE_STOPLEVEL"   ?   
Click on them, and read the manual. Your question has been answered.
 

@Tammy0 to avoid going around in circles: the responses you are receiving are presuming you intend to write some code.

I think perhaps you are not intending to write any code.

In which case, you can manually check these values:

  • Press CTRL+U to open the Symbols window
  • Select your symbol e.g. EURUSD
  • Click Properties
  • Look at the value shown for Stops level (in my screenshot, it happens to be 0).


You can then use it in conjunction with the table I linked in my previous post:

StopLevel Minimum Distance Limitation.

A trade operation will not be performed if any of the following conditions is disrupted.

Order Type
Open PriceStopLoss (SL)TakeProfit (TP)
Buy
Modification is prohibited
Bid-SLStopLevelTP-BidStopLevel
Sell
Modification is prohibitedSL-AskStopLevelAsk-TPStopLevel
BuyLimit
Ask-OpenPriceStopLevelOpenPrice-SLStopLevelTP-OpenPriceStopLevel
SellLimit
OpenPrice-BidStopLevelSL-OpenPriceStopLevelOpenPrice-TPStopLevel
BuyStop
OpenPrice-AskStopLevelOpenPrice-SLStopLevelTP-OpenPriceStopLevel
SellStop
Bid-OpenPriceStopLevelSL-OpenPriceStopLevelOpenPrice-TPStopLevel
 

honest_knave thank you for your time and effort to type this reply. I have never spoken about coding/programming. Don't know anything about it, hence the "MODE_STOPLEVEL" was for me only two words and one symbol, no wonder I didn't know whats that. I had already known CTRL+U feature. As far as I know the ''Stops level'' line contains the same value for both type of pending orders Limit (buy, sell) and Stop (buy, sell). The problem is that the value is the same as ''X'' which is mentioned in the third paragraph of my FIRST message above. Kindly read again, if needed, the said paragraph so you can see what exactly I am referring to with ''X''.

As mentioned, both values (X, your line you mentioned on screenshot) are the same so it doesn't help me. I am still unable to add pending order for entry price located on exact minimum distance from current market price or as close as possible to it. It is still showing me that entered Entry Price is invalid. I don't use TP or SL at the moment of adding pending order so this is a proof that something still has to be wrong with entered Entry Price. Same problem for both Limit and Stop pending orders.

I am looking for tool/feature/solution to tell me which price for all four type of pending orders (limit buy, limit sell, stop buy, stop sell) do I need to use as Entry Price to be able to reach my ultimate goal: the current market price and entry price must be as close as possible together and every micropip is important. Obviously this tool/feature/solution must work for all instruments, not just currency pairs. Also custom trading symbol if broker will add any in the future. Even if having to do the work manually, I am definitely more than happy to do it. It doesn't need to me automated means automatically showing me the Entry Price. As long as I would finally get rid of those annoying error messages in New Order window (invalid entry price), it would be god. Every time I want to add pending order (whichever of four types), I am wasting literally hours on this error message and getting tired of that.

 

There shouldn't be any mystery around the nearest price you can use for your pending orders.

The only mystery would be if your broker uses a dynamic stops level (see the bottom of this post).


Example:

Current Ask Price = 1.10050

Current Bid Price = 1.10040

Stops level = 20 points

Nearest open price for Buy Limit  =  Ask - Stops Level  =  1.10050 - 20 points  =  1.10030

Nearest open price for Buy Stop  =  Ask + Stops Level  =  1.10050 + 20 points  =  1.10070

Nearest open price for Sell Limit  =  Bid + Stops Level  =  1.10040 + 20 points  =  1.10060

Nearest open price for Sell Stop  =  Bid - Stops Level  =  1.10040 - 20 points  =  1.10020


I see you talk about using the crosshairs for calculating your open price. Remember that in MT4, charts are drawn using the Bid prices. You can turn on a line to see the Ask price by pressing F8 and selecting "Show Ask Line".

You can see that the Stops level is crucial to the calculation. You find the stops level using code, or by viewing it in the symbols window.

It varies between brokers, and it can vary between instruments.

But, if you read whroeder's post carefully you will see that the value of the stops level might be dynamic:

MODE_STOPLEVEL

14

Stop level in points

 

A zero value of MODE_STOPLEVEL means either absence of any restrictions on theminimal distance for Stop Loss/Take Profitor the fact that a trade server utilizes some external mechanisms for dynamic level control, which cannot be translated in the client terminal. In the second case, GetLastError() can return error 130, because MODE_STOPLEVEL is actually "floating" here.


In this case, there is not very much you can do about it besides speaking to your broker.

 

I admit that I haven't tried those four math equations you provided and those might be appropriate solution I am looking for. Obviously I cannot test those equations now because it is saturday and trading hours are OFF but will do this first thing on monday. Is there a guarantee that those four equations will really put entry price and current market price (the horizontal lines) as close as possible (minimum possible distance) together to still avoid error in New Order window? I don't know how I haven't thought about those four equations before but they look ''promising'' and thank you again for saying them. Will try on Monday first thing in the morning.

Is there any tool to be implemented (i don't think i could call this tool ''indicator'') which shows prices using X (definition of ''X'' and where ''X'' is located is shown in third paragraph of my first message above) value in real time for any trading symbol i need, regardless of instrument type? The tool that would show those four prices instantly telling me what do i need to type in New Order window if i want to use either of four pending orders - obviously respected must be the ultimate goal (minimum distance).

Reason: