How can I get the Free Balance while a pisition is open?
You didn't use any money to open the first position. You used some Free Margin.
you might want to refer to this and to understand some basic important trading terms
Thanks for this post! It was very clarifying. But I think I misspoke. I need the free margin.
The problem is that after I buy something (on the backtest) using less then money set in "Deposit" the value of AccountInfoDouble(ACCOUNT_MARGIN_FREE) is still the same value of AccountInfoDouble(ACCOUNT_BALANCE).
Shouldn`t it be the value of Balance - Required Margin (like your post said)?
Only after the position is closed the AccountInfoDouble(ACCOUNT_MARGIN_FREE) value changes.
Hi guys, i`m developing an EA and I need to know how much money I have available to open more positions.
The idea is, if I have already a position open, I would like to know how much money do I have left to buy other stocks.
I`m using, inside OnTick the AccountInfoDouble() method.
While the first position is open, ACCOUNT_BALANCE shows the initial balance, meanwhile ACCOUNT_EQUITY and ACCOUNT_MARGIN_FREE shows the value of ACCOUNT_BALANCE plus the current profit/loss.
I would like to know how much money I have free (ACCOUNT_BALANCE minus the money I used to open the first position).
Someone know how can I obtain this information?