daily Profit Limit

 
hi

is possible programming daily Pro fit Limit ?

z.b. if (daily Profit Limit > 19 USD ) return(0);
 
the only way i found, and it is not terribly elegant, is:

1) account history, u need to set it to today (do this every morning)
2) scan the history records and sum the realised profit
3) scan the open positions and sum the unrealised profit.

hugues
 
thanks

here my



void start()
{

double db=GlobalVariableGet("Date"); 
double d=GlobalVariableGet("A"); 

double value=AccountBalance();

if (db != DayOfWeek())
{
 GlobalVariableSet("Date",DayOfWeek());
 GlobalVariableSet("A",value);
}

if  ( value - d > 10) return(0);

...

}




alex

Reason: