Alexander Bereznyak: look at the instrument properties, maybe the Stop Level is zero there, then try normalization
Yes, if the broker is A*****i, then its Stop Level is often zero. But at the same time the support team writes that we need to use 2 spreads to get the correct Stop Level. Therefore, the code which covers the largest number of cases with the Stop Level is as follows:
tickSize = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE);
ask = SymbolInfoDouble(symbol, SYMBOL_ASK);
bid = SymbolInfoDouble(symbol, SYMBOL_BID);
spread = ask - bid; // Заметьте - спред получаем не через MarketInfo, и не через SymbolInfoInteger
digits = (int) SymbolInfoInteger(symbol, SYMBOL_DIGITS);
point = SymbolInfoDouble(symbol, SYMBOL_POINT);
stopLevel = MarketInfo(symbol, MODE_STOPLEVEL) * point; // До сих пор встречаются случаи, когда SymbolInfoInteger и MarketInfo выдают разные значения. MarketInfo пока ближе к истинеif (stopLevel == 0)
{
if (!isECN) // isECN - признак ECN-счета, на котором Stop Level действительно равен 0
topLevel = NormalizeDouble(2 * spread, digits);
}
else
stopLevel = NormalizeDouble(stopLevel + tickSize, digits); // Сознательное увеличение размера Stop Level на один тик, чтобы постоянно не натыкаться на ошибку 130.
Alexander Bereznyak: Look at the tool properties, maybe the stop level is zero, then try normalisation.
The stop level there is from 20, I have a check... So it worked for me today at 10%, but damn, these errors... I don't know what's causing them... Some orders open, others don't...
Yes, if the broker is A*****i, then its Stop Level is often zero. But at the same time the support team writes that we need to use 2 spreads to get the correct Stop Level. Therefore the code, which covers the most cases with Stop Level, is as follows:
A piece from today's trade... All orders open according to exactly the same algorithm, i.e. conditions are always equal. Nevertheless, errors occur with enviable frequency. Everywhere we can see that the stop is always larger than the stop level, and the orders are always placed at a distance > than the stop level from the current price.
And on another broker's demo account not a single error during this time...
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 had this error when I didn't use normalisation. I've already written about it.
look at the instrument properties, maybe the Stop Level is zero there, then try normalization
Yes, if the broker is A*****i, then its Stop Level is often zero. But at the same time the support team writes that we need to use 2 spreads to get the correct Stop Level. Therefore, the code which covers the largest number of cases with the Stop Level is as follows:
Look at the tool properties, maybe the stop level is zero, then try normalisation.
I had this error when I didn't use normalisation. I've already written about it.
Yes, if the broker is A*****i, then its Stop Level is often zero. But at the same time the support team writes that we need to use 2 spreads to get the correct Stop Level. Therefore the code, which covers the most cases with Stop Level, is as follows:
Get out of this kitchen...
so probably or definitely
A piece from today's trade... All orders open according to exactly the same algorithm, i.e. conditions are always equal. Nevertheless, errors occur with enviable frequency. Everywhere we can see that the stop is always larger than the stop level, and the orders are always placed at a distance > than the stop level from the current price.
And on another broker's demo account not a single error during this time...