OrdersTotal return 0

 

Hi guy

before you all yelling @ me to search i did that

i always used OrdersTotal to get Opened Orders! "of course not pending ones"


but on V2398 when i try to get that i always get 0 returns i checked with older version it works just fine! tried with MT4 work fine what's going on!



2020.05.04 05:08:38.647

void OnStart()
  {
      Print("OrdersTotal:",OrdersTotal()," PositionsTotal:",PositionsTotal());
   
  }


(AUDNZD,H1) OrdersTotal:0 PositionsTotal:2


Files:
orderstotal.png  11 kb
 

Meh seems MQL5 changed it purpose w.o updating the HELP file



int PositionsTotal();

Returns the number of current orders.

int  OrdersTotal();


please fix help file!

 
Amirfakhredin Ghanbari:

Meh seems MQL5 changed it purpose w.o updating the HELP file


Returns the number of current orders.

int  OrdersTotal();


please fix help file!

Note

Do not confuse current pending orders with positions, which are also displayed on the "Trade" tab of the "Toolbox" of the client terminal. An order is a request to conduct a transaction, while a position is a result of one or more deals.

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Requests to execute trade operations are formalized as orders. Each order has a variety of properties for reading. Information on them can be obtained using functions Position identifier that is set to an order as soon as it is executed. Each executed order results in a deal that opens or modifies an already existing position. The...
 
Fernando Morales:

Note

Do not confuse current pending orders with positions, which are also displayed on the "Trade" tab of the "Toolbox" of the client terminal. An order is a request to conduct a transaction, while a position is a result of one or more deals.

as i mentioned there is no pending orders! did you checked the Screen shot i sent!

i guess you didnt

 
Amirfakhredin Ghanbari:

as i mentioned there is no pending orders! did you checked the Screen shot i sent!

i guess you didnt

You should change your tone with people trying to help you.

And beside that you are completely wrong. Read the documentation again and make your mind. You have 2 positions and 0 orders, all is correct.

Additionally you posted on a wrong section, what your topic has to do with Technical Indicators ?

MQL5 forum: Technical Indicators
MQL5 forum: Technical Indicators
  • www.mql5.com
Questions about the development of technical indicators in the MQL5 language
 
Alain Verleyen:

You should change your tone with people trying to help you.

And beside that you are completely wrong. Read the documentation again and make your mind. You have 2 positions and 0 orders, all is correct.

Additionally you posted on a wrong section, what your topic has to do with Technical Indicators ?

yup you are right sometimes drive me crazy MQL5 builtin helpfile seems outdated for some reason but online version is correct

indicator? i think i put it in ea section
 
Amirfakhredin Ghanbari: indicator? i think i put it in ea section

Think again; you created it in the indicators section. A moderator has been moved it to the EA section.

Reason: