accoount balance history

 

how to get the account balance of the last 10 trades?


thank you

 

Hello friend,

View/Terminal/Account History. Right click. then custom period

 

thank you for your answer.  Now how can I get that information in metaeditor?  I know accountbalance() but its only the current balance can I get the past history of my accountbalance() for the last 10 trades?


thank you.

 

Hello friend,

I'm not sure I understand correctly, you know your balance and equity before the first order is placed, right?

AccountBalance()
AccountEquity()
AccountProfit()

So record[] balance before the first order is made. After you place the first order record the equity[] and repeat the process.

Sorry not sure if that helped, or total waste of time.

 
Daniel Bouchard:

thank you for your answer.  Now how can I get that information in metaeditor?  I know accountbalance() but its only the current balance can I get the past history of my accountbalance() for the last 10 trades?


thank you.

I think you can't have for AccountBalance() for history trades. The solution might be every you put an order, put your balance in comment. Then to check your "AccountBalance()" history, just read the their OrderComment()
 
GrumpyDuckMan:

Hello friend,

I'm not sure I understand correctly, you know your balance and equity before the first order is placed, right?

So record[] balance before the first order is made. After you place the first order record the equity[] and repeat the process.

Sorry not sure if that helped, or total waste of time.

thanks,  how do you record AccountBalance()?
 
Adiasa:
I think you can't have for AccountBalance() for history trades. The solution might be every you put an order, put your balance in comment. Then to check your "AccountBalance()" history, just read the their OrderComment()

how do youput your account balance in the comment?

 
Daniel Bouchard:

how do youput your account balance in the comment?

string  symbol = "EURUSD";
int     cmd = OP_BUY;
double  lot = 0.1;
double  price = MarketInfo(symbol, MODE_ASK);
int     slippage = 5;
double  stoploss = 0; // determine your sl
double  takeprofit = 0; // determine your tp
string  comment = DoubleToString(AccountBalance(),2);
int     magic = 0; // determine your magic number

OrderSend(symbol, cmd, lot, price slippage, stoploss, takeprofit, comment, magic);

with this code ( please try it ) you will have your current balance on comment

 
Adiasa:

with this code ( please try it ) you will have your current balance on comment

ok now account balance should be stored in comment? now can I have the account balance of the last 10 trades  with ordercomment(10)?
 
Daniel Bouchard:
ok now account balance should be stored in comment? now can I have the account balance of the last 10 trades  with ordercomment(10)?
I think so. But orderComment() is string, and the balance should be in double, so you have to use StringToDouble()
 
so doubletostring(1) now means the accountbalance at the end of the last trade?