I believe Capital is only used for simulation purposes. I believe the counterpart in live trading would be Balance or Equity. See this page.

I've found it also helps to include debug statements like this, right near where you set the Margin:
Code:
if(is(TRADEMODE) && Lots>=1) printf("\n%s %s; OptF %.3f; Margin $%.2f; Lots %i",Asset,direction,OptimalFShort,(OptimalFShort*riskCapital),Lots);