Get open positions with the ability to filter by symbol or ticket. There are three call options.
Call without parameters. Return open positions for all symbols.
Call specifying a symbol open positions should be received for.
Call specifying a group of symbols open positions should be received for.
Call specifying a position ticket.
[in] Symbol name. Optional named parameter. If a symbol is specified, the ticket parameter is ignored.
[in] The filter for arranging a group of necessary symbols. Optional named parameter. If the group is specified, the function returns only positions meeting a specified criteria for a symbol name.
[in] Position ticket (POSITION_TICKET). Optional named parameter.
Return info in the form of a named tuple structure (namedtuple). Return None in case of an error. The info on the error can be obtained using last_error().
The group parameter may contain several comma separated conditions. A condition can be set as a mask using '*'. The logical negation symbol '!' can be used for an exclusion. All conditions are applied sequentially, which means conditions of including to a group should be specified first followed by an exclusion condition. For example, group="*, !EUR" means that positions for all symbols should be selected first and the ones containing "EUR" in symbol names should be excluded afterwards.