Thread: How to code?
View Single Post
  #13 (permalink)  
Old 01-06-2006, 08:53 PM
cardio cardio is offline
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
testing

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?

Last edited by cardio : 01-06-2006 at 09:21 PM.
Reply With Quote