Need expert help, incrase lot of -ve

 

Hi, I need some help regarding coding expert advisor.

Let says initial condition:

lots = 0.1

opentrades = 0

Then, how to code this:

-------------------------------------------

checking trade

if previous trade profit resulting +ve money,

opentrades is reset to zero -> opentrades = 0

the lots also reset -> lots = 0.1

if previous trade profit resulting -ve money,

opentrades will increase to 1 -> opentrades = 1

the lots also increase -> lots = 0.2

sell or buy operation coding here with new lots

checking trades

if previous trade profit resulting +ve money,

opentrades is reset to zero -> opentrades = 0

the lots also reset -> lots = 0.1

if previous trade profit resulting -ve money,

opentrades will increase -> opentrades = 2

the lots also increase -> lots = 0.3

sell or buy operation coding here with new lots

and so on...

-------------------------------------------

I know the code on these word in italic only

hope can give me guide for these programming...

Reason: