Download MetaTrader 5
To add comments, please log in or register
How to use MQL5.community messages editor? Find out in the article!
wadi2014
116
wadi2014 2014.03.23 16:16 
Hello I want to ask how to get initial deposit of an account to calculate some values in my EA
Alain Verleyen
Moderator
28536
Alain Verleyen 2014.03.23 17:29  
fx2013:
Hello I want to ask how to get initial deposit of an account to calculate some values in my EA

AccountBalance
qjol
3243
qjol 2014.03.23 22:05  
if (OrderType() == 6) //deposit
calculate your values
Keith Watford
Moderator
7888
Keith Watford 2014.03.24 01:21  

How is that helpful ??

OrderType only has a value of 0 to 5

qjol 2014.03.23 23:05 #

if (OrderType() == 6) //deposit
calculate your values

GreenMoney
379
GreenMoney 2014.03.24 01:42  
GumRai:

. . .

OrderType only has a value of 0 to 5

Correct. However, there seems to be (at least in b509) two undocumented enumerations: OrderType() == 6 means balance; and OrderType() == 7 means credit.

Keith Watford
Moderator
7888
Keith Watford 2014.03.24 03:02  
Thirteen:

Correct. However, there seems to be (at least in b509) two undocumented enumerations: OrderType() == 6 means balance; and OrderType() == 7 means credit.


I didn't know that, but still fail to see how it can be useful

if (OrderType() == 6) //deposit
calculate your values

The if can only return true or false

So how to retrieve the balance using this?

qjol
3243
qjol 2014.03.24 03:39  
i don't understand why you are arguing

have you tried the code before you say something?

let me tell you a secret even in B625 it works

for(int i = OrdersHistoryTotal() -1; i >= 0; i--)
   {
   if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))
      {
      if (OrderType() == 6)
         {
         Alert("The Deposit Was ", OrderProfit(), " ", AccountCurrency());
         }
      }
   }
wadi2014
116
wadi2014 2014.03.24 04:07  
qjol:
i don't understand why you are arguing

have you tried the code before you say something?

let me tell you a secret even in B625 it works




The codes works only if you make right click and chose All History in Account history, rather than, it will gives nothing, but if i need it for making calculations depends on long terms, calculations will differ .

qjol
3243
qjol 2014.03.24 04:12  
fx2013:

The codes works only if you make right click and chose All History in Account history, rather than, it will gives nothing, but if i need it for making calculations depends on long terms, calculations will differ .



this was not the issue but if you ask it's been discussed many times here is one of them here is another one

Keith Watford
Moderator
7888
Keith Watford 2014.03.24 07:30  
qjol:
i don't understand why you are arguing

have you tried the code before you say something?

let me tell you a secret even in B625 it works



Yes, I did try it and it didn't work
fx2013:

The codes works only if you make right click and chose All History in Account history, rather than, it will gives nothing, but if i need it for making calculations depends on long terms, calculations will differ .


Thanks to fx2013's reply, I enabled all history and I now see that the initial deposit actually has a ticket number and that the deposit is actually shown in the profit column and the type is shown as balance
/
To add comments, please log in or register