Help expiration parameter

 

Some functions require datetime expiration parameter. I don't really understand what is it for, example I want to create condition to open a long position:

bool CExpertSignal::CheckOpenLong(double &price,double &sl,double &tp,datetime &expiration)

Is "expiration" the time that this long position must be close? How can I set it if I don't want to close position by time?

 

Parameter 'Expiration' only for pending orders.

Generate an Expert Advisor using the MQL5 Wizard and you will see this description:

Expiration of pending orders (in bars)
 
If the pending order doesn't open by then, it will be deleted by the server.
Reason: