Questions from a "dummy" - page 190

 

ENUM_POSITION_TYPE

two values. and what is returned if there are no open positions?

I use the PositionType() method from the standard library.

Okay, I get it, PositionSelect() returns false, and PositionType() returns the type of the last position selected.

 

How do I get the total number of positions for a symbol?

PositionsTotal() returns the total number of positions for all symbols.

I need to know that there are no open positions for a symbol. How can I do this correctly?

 
tor4en: How do I get the total number of positions for a symbol?

There can only be one position per tool.

tor4en : PositionsTotal() returns the total number of positions for all symbols. I need to know that there are no open positions for a symbol. How to do it correctly?
Either PositionSelect(), or organize the enumeration of existing positions using PositionsTotal() and PositionGetSymbol()
 
tor4en:

ENUM_POSITION_TYPE

two values. and what is returned if there are no open positions?

I use the PositionType() method from the standard library.

Okay, got it, PositionSelect() returns false, and PositionType() returns the type of the last position selected.

You got it right. If PositionSelect() returns false, then the PositionType() query is meaningless because no position is selected.
 

There is such a thing. It's called Fixed Chart Position

Which by default is on the left side in a corner.


Can it be set in ChartSet(Get) properties?

 
sergeev:

There is such a thing. It's called Fixed Chart Position

Which by default is on the left side in a corner.

Can it be set in ChartSet(Get) properties?

You'd better contact Service Desk with this question.
Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
Yedelkin:
Either PositionSelect() or enumerate existing positions using PositionsTotal() and PositionGetSymbol()
The PositionSelect() function has to find out why it returns false. It turns out that there's no standard method to determine that there's no position opened for a symbol?
 
tor4en: PositionSelect() should also be analyzed why it returns false.

That's exactly right. I only described the general approach, in response to the question about the possibility itself. ...And error handling - it is often encountered when calling one function or another. Routine, so to speak.

tor4en: It turns out that there is no standard method to determine that there is no open position on a symbol?

Look at the second method from the mentioned ones. An opinion was expressed here that it is universal in some way. The details were not mentioned.

 
tor4en:
PositionSelect() still needs to understand why it returns false. It turns out that there is no standard method to determine that there is no open position for a symbol?
If it returns true - there is a position, if it returns false - there is no position (no matter what the reason is)
 
advise, in mt4 there are mqt files of initial templates, and where are similar templates in 5?
Reason: