Hey guys,
I got an EA which is entering orders with a size based on the Equity amount and I would like to have it have it enter order based on the Balance amount instead. The used code to enter orders is
if (AutoLot)
{
double pv = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_VALUE)/SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_SIZE);
lot = NormalizeDouble(AccountEquity() / EquityDivider, DecimalPoints);
if (lot > LotMax) NormalizeDouble(AccountEquity() / EquityDivider / LotMax, DecimalPoints);
if (lot < MarketInfo(Symbol(), MODE_MINLOT)) lot = MarketInfo(Symbol(), MODE_MINLOT);
if (lot > MarketInfo(Symbol(), MODE_MAXLOT)) lot = MarketInfo(Symbol(), MODE_MAXLOT);
}
Do you think that if I replace the word Equity with balance that it will use the Blance amount going forward?
Thanks!
1st try to post your codes by using the SRC button
then,
replace all the AccountEquity()
by: AccountBalance()
That's all
in order to get deep proffessional help, open a job in freelance section and hire a coder

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey guys,
I got an EA which is entering orders with a size based on the Equity amount and I would like to have it have it enter order based on the Balance amount instead. The used code to enter orders is
if (AutoLot)
{
double pv = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_VALUE)/SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_SIZE);
lot = NormalizeDouble(AccountEquity() / EquityDivider, DecimalPoints);
if (lot > LotMax) NormalizeDouble(AccountEquity() / EquityDivider / LotMax, DecimalPoints);
if (lot < MarketInfo(Symbol(), MODE_MINLOT)) lot = MarketInfo(Symbol(), MODE_MINLOT);
if (lot > MarketInfo(Symbol(), MODE_MAXLOT)) lot = MarketInfo(Symbol(), MODE_MAXLOT);
}
Do you think that if I replace the word Equity with balance that it will use the Blance amount going forward?
Thanks!