Position type allowing MQL4 EA

 
how to write a check in the code of the mql4 advisor "Only Short" and "Only Long" so as not to get errors 4110 or 4111.