Is there a way to add together the profit of each trade, ( I only have one open position at a time), so that I can determine the total profit gained. I would like to add a feature to my EA, of increasing the lot size, based on the amount of gain in profit. In other words, for every increase of a 1000 pips of profit, an increase of 0.10 in lot size, traded.
Returns the net profit value (without swaps or
commissions) for the selected order. For open positions, it is the current
unrealized profit. For closed orders, it is the fixed profit.
Returns profit
for the currently selected order.
Note: The order must be previously selected
by the OrderSelect() function.
double AccountProfit(
)
Returns profit value of the current account.
Sample:
Print("Account profit ", AccountProfit());
If you wanna work in pips and history. Then study OrderSelect & Select_By_History.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Is there a way to add together the profit of each trade, ( I only have one open position at a time), so that I can determine the total profit gained. I would like to add a feature to my EA, of increasing the lot size, based on the amount of gain in profit. In other words, for every increase of a 1000 pips of profit, an increase of 0.10 in lot size, traded.
Thanks!