How To Use For loop

Please I am a newbie in coding. I am trying to write a code for my EA to only take two trade. And I am confuse on how to write it. The books says OrderTotal returns the total number of open trade on a chart. 
Can I write.

if ( Total ==OrderTotal) Total=<2
For (I= 0 ; I=<OrderTotal ; I++)
iMA= argument for moving average.