I have a very basic question: say I have a buy position and I close it with
trade.PositionClose(_Symbol);
Is it safe to say that PositionSelect(_Symbol) will be false immediately after that?
I ask because I have developed an EA that has the following basic structure:
if(PositionSelect(_Symbol) == true)
{
// Check for closing criteria
}
if(PositionSelect(_Symbol) == false)
{
// Check for entry criteria
}
This is run only once per candle, and in many cases both the exit criterion and a new entry criterion will be satisfied. So if PositionSelect(_Symbol) doesn't immediately change to false after closing a trade, the new trade will not be opened.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I have a very basic question: say I have a buy position and I close it with
trade.PositionClose(_Symbol);Is it safe to say that PositionSelect(_Symbol) will be false immediately after that?
I ask because I have developed an EA that has the following basic structure:
This is run only once per candle, and in many cases both the exit criterion and a new entry criterion will be satisfied. So if PositionSelect(_Symbol) doesn't immediately change to false after closing a trade, the new trade will not be opened.
==