Questions from Beginners MQL5 MT5 MetaTrader 5 - page 102

 
kedr275: Yes, I am interested in the position, I will formulate the question differently, is it possible to make a decision to open a position based on the price, i.e. first we ask for a price, then we make a decision, then we execute.
On what price do you want to base your decision to open a position? Imagine that (a) you have no position yet, (b) you have decided on a price and (c) you are deciding to open a position (which you do not yet have). What price (price of what exactly) are you going to ask for?
 
Yedelkin:
What price are you going to rely on when deciding to open a position? Imagine: (a) you don't have a position yet, (b) you decide to rely on a price and (c) decide to open a position (which you don't have yet). What price (price of what exactly) are you going to ask for?
For example, to request the current price of any pair, as long as the price is up to date, to make a decision. There is a moment between the changes of the price and it is visible in the GUI, when you open a new order window.
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
kedr275: For example, to request the current price/quotes of any pair, as long as the price is current, make a decision, there is a moment between the changes of quotes and it is noticeable when working through the GUI when opening a new order window.

Now I see. Yes, in this case the answer is yes. For example, using SymbolInfoDouble() and identifiers SYMBOL_BID, SYMBOL_ASK we can obtain the current "best buy/sell" offers for the selected symbol. Another question is to what extent these "current" values will remain "current" at the moment of making a decision and sending a trade request. But this question is not even asked :)

 

Hello! I just recently started working with MQL5 and I'm facing the following problem: I'm trying to implement a strategy that analyses plotted charts, in particular trend lines and channels. When I try to test the strategy on historical data with visualization mode enabled, everything works almost fine, except for the fact that if I change the speed with the corresponding slider, I get different results with different positions. I've decided that this is fine, given the fact that (please correct me if I'm wrong) the handlers ignore events if they are already occupied. Consequently, as the speed increases, so does the flow of events for the handlers, which most of them simply ignore. However, this is extremely inconvenient, because if I set a "normal" speed, I would have to wait for hours, days or even months for testing to finish, which is completely unacceptable. Further, if we disable the visualization mode, something strange happens, namely, the Expert Advisor behaves as if it is not developing any charts at all, though I thought that even in this mode they must "develop" (though they cannot be seen anywhere) and they may be handled in the same way as when testing with enabled visualization or in "real time", i.e. using such functions as ObjectGetValueByTime, etc. So, I am wondering if there is any way to normalize the tester with visualization mode, so that it works the same regardless of speed, and also, is it possible to do graph analysis when visualization mode is turned off? Thanks in advance.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Информация об исторических данных по инструменту
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Информация об исторических данных по инструменту
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Информация об исторических данных по инструменту - Документация по MQL5
 

I'm getting a bit confused.

IN MQL4

MarketInfo(Symbol(),MODE_TICKVALUE) shows the value of 1 pip in the currency of deposit for 1 lot.

Is SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE) the same in MQL5?

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте - Документация по MQL5
 
JohnyPipa:

I'm getting a bit confused.

IN MQL4

MarketInfo(Symbol(),MODE_TICKVALUE) shows the value of 1 pip in the currency of deposit for 1 lot.

Is SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE) the same in MQL5?

Did you check it?
 
Has anyone seen a line drawn from the meridian of one candle to the meridian of another in indicators or "Include"?
 
Lester:
Has anyone seen a line drawn from the meridian of one candle to the meridian of another in indicators or "Include"?
https://www.mql5.com/ru/code/249?source=terminal5_codebase
Линейно регрессионный канал
Линейно регрессионный канал
  • votes: 8
  • 2011.01.07
  • Vladimir Mikhailov
  • www.mql5.com
Индикатор строит канал по уравнению линейной регрессии y=b+a*x.
 
Good health to all!!! I have a question for you: how do you delay the triggering of pending orders and stop loss? I have a very good idea to place a stop loss in such a way that the price of a pending order does not exceed one second. Andrey Sapunov from RBC.TV advised to make such a delay. I have never encountered such a solution in MT5. It may be elementary, but I am a programmer with no knowledge. Please help me, if you are able :-))
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
chipo:
Good health to all!!! This is a question who has solved: how to create a delay in the triggering of pending orders and stop loss. It is a very good idea to place a stop loss in such a way that the order does not intercept pending orders. Andrey Sapunov from RBC.TV advised to make such a delay. I have never encountered such a solution in MT5. It may be elementary, but I am a programmer with no knowledge. Please help me :-))


If a pending order/stopplot/stackprofit is sent to a broker, it means that the order is in the broker's database and is waiting for its price to be reached.

You cannot set an execution delay for an order.

If you want a delay, you will have to give up the pending orders/stops/stakeprofits. And replace all of these with market orders.

So you have to constantly monitor the current symbol price and once it reaches the required level + you wait for the delay - and only then make a decision to open a market order or not.

As a result you will have what you want - delayed execution or non-opening if the price bounces, but in the worst case you will have a bad execution price for a market order. Probably worse than what you would get if you placed a pending order.

Reason: