Professional Documents
Culture Documents
//| CloseAll-PL.mq4 |
//| |
//+------------------------------------------------------------------+
double myProfit=0;
int EnableClose=0;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
myProfit=CalcProfit();
ShowInit();
CloseAll();
//----
return(0);
}
//+------------------------------------------------------------------+
return;
} // #function of CloseAll
void ShowInit() {
return;
}
double CalcProfit() {
double _sum=0;
int _total=OrdersTotal(); // number of lots
_sum=AccountProfit();
return(_sum);