Profit Question

 

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!

 
double OrderProfit( )
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.