Script or EA to restrict no of manual open positions

 

Can anyone help with this request pls. 

Is there any MQL5 script or EA which can be used to restrict no of manual open positions for an account at a given time. For eg. 4 open positions at a time. 

Thanks in advance for your help. 

Reason: