hi
some code:
Code:
void MoneyManagement()
{
int i,hstTotal=HistoryTotal();
int losses;
static double val1;
for(i=hstTotal-1;i>=0;i--)
{
//---- check selection result
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==fals e)
{
Print("Access to history failed with error (",GetLastError(),")");
break;
}
if(OrderProfit()>0){
val1 = 0;
break;
}
if(OrderProfit()<0) {
losses++;
val1 = val1 + orderProfit();
}
if(losses==2) {
lotMM = MathCeil(AccountFreeMargin() * 50 / 10000) / 10; // 50 risk :)
if (lotMM < 0.1) lotMM = Lots;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
}
Got it - thanks - were would one find the different html tags one can use on this forum?