how can I determine open posicions weighted average (Green line) in MT5?

 
phil09:

have any functions? any suggestion?

thanx phil

Your question isn't very clear. You can select the open position for a selected symbol with

bool  PositionSelect(string  symbol);
Then you can use others functions to get position properties. Is it what you need ?
 
angevoyageur:

Your question isn't very clear. You can select the open position for a selected symbol with

Then you can use others functions to get position properties. Is it what you need ?

not really...

in MT5 when I open multiple positions in different volume (buy or sell) I have only one open position calculated by weighted average method. On the chart indicates this a green horizontal line. 

at this time i didn't find a return value, or something like this,

it seems to i have to write a custom function :(

phil

 
phil09:

not really...

in MT5 when I open multiple positions in different volume (buy or sell) I have only one open position calculated by weighted average method. On the chart indicates this a green horizontal line.

You can't open multiple positions, you send several orders which results in 1 opened position (for 1 symbol).


at this time i didn't find a return value, or something like this,

it seems to i have to write a custom function :(

phil

Which returned value ? What information do you need ?
 

I need the green line (return) value.

pic attached:

Files:
mql5-re.png  16 kb
 
phil09:

I need the green line (return) value.

pic attached:

after using position select

you need to use position integer with POSITION_PRICE_OPEN

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Position Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Position Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Position Properties - Documentation on MQL5
Reason: