I have tried with a static var and added +1 but the problem is it only adds 1 lot when the condition happens. If the condition happens again it doesn't add another lot so it always sits at a max of 2.

How do I use the close trades without a loop?

I am trying the following:

for(closed_trades) //for(all_trades)
{
if (Equity[0] < max_equity[0])
Count++;
else
Count=1; //doesn't reset the entire counter to 1 and the countr carries on from the last Count++
}

I am using Count as Lots now for enterLong(Count) and enterShort(Count);

Now it increments but I can't get it to reset to 1 and start all over.

See the attached output of trade log lots, Count lots (loop) and Max Lots (Static Var).

Surely there must be an easier way?

Thanks for teh help!

Attached Files
Lots.JPG (17 downloads)
Count.JPG (15 downloads)
MaxLots.JPG (15 downloads)