Change lots when OrderClose

 

Hi,

First, i'm sorry for my poor english, and i'm a newbie in MQL4.

I'm making an EA, and I want to change the lot when an order is closed, depending of the order type, and the result (win or loss).I change the variable when closing, but the next order doesn't take the changed value, it takes the initial value of the variable. Thanx to your help.

 

Make sure you put the variable outside of all functions, preferably the top.

int theVariable = 69;

start()
{
   theVariable = 785;

   Comment(theVariable); //the value will show 785
}