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

 

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

Thanks very much!

 
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

 
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.
 

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


 
YOX:

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

Sorry...miss understood ;)

 

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

Kenneth Parling:

Sorry...miss understood ;)

 

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.
 
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

 

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?