How to read all of the current positions in my trading account, using MQL4 ?

To add comments, please log in or register
YOX
18
YOX  

How to read all of the current positions in my trading account, using MQL4 , not MQL5 ?

Thanks very much!

Kenneth Parling
8601
Kenneth Parling  
YOX:

How to read all of the current positions in my trading account, using MQL4 , not MQL5 ?

Thanks very much!

to view all current ongoing positions in your MT4 terminal select tab Trade using Terminal Ctrl+T

trades

Ehsan Tarakemeh
1690
Ehsan Tarakemeh  
YOX:

How to read all of the current positions in my trading account, using MQL4 , not MQL5 ?

Thanks very much!

Use OrdersTotal and OrderSelect functions to iterate through all positions. Check the type of orders using the OrderType function.
YOX
18
YOX  

Thanks for your reply, but I mean using programming language ( MQL4 ) in MetaEditor, such as  PositionGetDouble() in MQL5.

Kenneth Parling:

to view all current ongoing positions in your MT4 terminal select tab Trade using Terminal Ctrl+T


Kenneth Parling
8601
Kenneth Parling  
YOX:

Thanks for your reply, but I mean using programming language ( MQL4 ) in MetaEditor, such as  PositionGetDouble() in MQL5.

Sorry...miss understood ;)

YOX
18
YOX  

It's OK... I didn't make it clear :)

Kenneth Parling:

Sorry...miss understood ;)

YOX
18
YOX  

Thank you. I’ll try it first. :)

Ehsan Tarakemeh:
Use OrdersTotal and OrderSelect functions to iterate through all positions. Check the type of orders using the OrderType function.
William Roeder
20207
William Roeder  
YOX: How to read all of the current positions in my trading account, using MQL4 , not MQL5 ?
  1. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. Do you really want to read all positions? Or only the EAs positions? Or only the EAs positions on the current chart symbol?
    Using OrdersTotal (or OrdersHistoryTotal) directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
              Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum
              MagicNumber: "Magic" Identifier of the Order - MQL4 Articles

YOX
18
YOX  

Thanks for your reply. Its my first question in the forum. When I link to forum of www.mql4.com, it tends to mql5 forum, so...
I just wanna read the current holding positions, not history, not pending orders. Ehsan Tarakemeh (#4)'s answer is great. Using OrdersTotal, OrderSelect function, OrderType could solve it.


William Roeder:
  1. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. Do you really want to read all positions? Or only the EAs positions? Or only the EAs positions on the current chart symbol?

To add comments, please log in or register