Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Script | ClosePosition

MetaTrader Experts, Indicators, Scripts and Libraries

ClosePosition script is designed for closing open positions with the volume depending on their size.

Input parameters:

//+----------------------------------------------+
//| INPUT PARAMETERS OF THE SCRIPT               |
//+----------------------------------------------+
input double VOLUME=1.0;    // The volume of the closed position in relation to the initial
input int  DEVIATION=10;    // Price deviation
input uint RTOTAL=4;        // The number of repeats on unsuccessful transactions
input uint SLEEPTIME=1;     // Pause time in seconds between repeats
996

Best MetaTrader Indicators + Profitable Expert Advisors