Compilation Warning

 
Whe I complied an EA, I get this warning.

Function "CloseLoosingTrades" is not referenced and will be removed from exp-file

This is the referenced code.

void CloseLoosingTrades() {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if ( (OrderSymbol()==Symbol()) && (OrderMagicNumber()==MagicfromSymbol()) && (OrderComment()==GetCommentForOrder()) ) {
if (OrderType()==OP_BUY)
if ( iFXAnalyser(240,MODE_DIV,0)<-DVLimit*Point )
OrderClose(OrderTicket(),OrderLots(),Bid,GetSlippage(),clCloseBuy);
if (OrderType()==OP_SELL)
if ( iFXAnalyser(240,MODE_DIV,0)>DVLimit*Point )
OrderClose(OrderTicket(),OrderLots(),Ask,GetSlippage(),clCloseSell);
}
}
}
}

Could someone advise how to modify code to correct the warning.

Thanks,

Wackena
 
"Not referenced" means "not called"
Reason: