If this function is used to get information about the last tick, it is better to useSymbolInfoTick(). It's quite possible that there hasn't been any quote for this symbol since the time the terminal connected to the trading account. In this case, the requested value will be undefined.
2. It is better to take the spread as a difference between Ask and Bid.
3. Level of freeze: look for the maximum valueout of three (SYMBOL_TRADE_FREEZE_LEVEL, SYMBOL_TRADE_STOPS_LEVEL and calculated spread) and multiply by three and you will be happy.
Point 3 was deduced in practice when working with KodoBase (and the validator in both KodoBase and Market is the same).
2. Возвращает true или false в зависимости от успешности выполнения функции. В случае успеха значение свойства помещается в приемную переменную, передаваемую по ссылке последним параметром. Если функция используется для получения информации о последнем тике, то лучше использовать SymbolInfoTick(). Вполне возможно, что по данному символу с...
If this function is used to get information about the last tick, it is better to useSymbolInfoTick(). It's quite possible that there hasn't been any quote for this symbol since the time the terminal connected to the trading account. In this case, the requested value will be undefined.
2. It is better to take the spread as a difference between Ask and Bid.
3. Level of freeze: look for the maximum valueout of three (SYMBOL_TRADE_FREEZE_LEVEL, SYMBOL_TRADE_STOPS_LEVEL and calculated spread) and multiply by three and you will be happy.
Point 3 was deduced in practice when working with KodoBase (and the validator in both KodoBase and Market is the same).
Thank you very much! I will make some changes now and try it.
Торговля осуществляется посредством отправки с помощью функции OrderSend() приказов на открытие позиций, а также приказов на установку, модификацию и удаление отложенных ордеров. Каждый торговый приказ содержит указание на тип запрашиваемой торговой операции. Торговые операции описаны в перечислении ENUM_TRADE_REQUEST_ACTIONS...
Why go to all that trouble? Use the CTrade trading class.
Unfortunately this has been around since MT4. It was easier to adapt it.
I don't know about CTrade, but it seems that everywhere where you have to specify a symbol, it is present in parameters passed to the method. And it's not present in method OrderDelete(const ulong ticket), so it won't work. We should fill in the request.symbol somewhere beforehand.
Unfortunately, this has been around since MT4. It was easier to adapt.
About CTrade - I didn't understand it, but it seems that everywhere where you need to specify a symbol, it is in the parameters passed to the method. And it's not present in method OrderDelete(const ulong ticket), so it won't work. We have to fill in the request.symbol somewhere.
What won't work? This is a trade class: it sets, modifies and deletes REMOTE ORDERS, and opens, modifies and closes POISONS.
Absolutely everything works. And everything is written in one line by any trade command.
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.
There you go:
Another important thing is how you update prices (and do you update them at all?). The spread - how do you get it?
So, for future reference:
1.SymbolInfoDouble
Point 3 was deduced in practice when working with KodoBase (and the validator in both KodoBase and Market is the same).So, for future reference:
1.SymbolInfoDouble
Point 3 was deduced in practice when working with KodoBase (and the validator in both KodoBase and Market is the same).Thank you very much! I will make some changes now and try it.
Thank you very much! I'll make the changes now and give it a try.
Yes, the result will be interesting.
Yes, the result will be interesting.
Problem solved! It turned out to be very simple, in order to delete an order it is necessary to fill in:request.symbol
I haven't found any structured information on what data should be passed to request depending on trade type. And I used examplehttps://www.mql5.com/ru/docs/constants/tradingconstants/enum_trade_request_actions.
It's not there.
I checked many variants with freezing. In my case single size was enough.
Problem solved! It turned out to be very simple, in order to delete an order it is necessary to fill inrequest.symbol.
I haven't found any structured information about what data should be passed to request depending on the type of trade operation. And I used example https://www.mql5.com/ru/docs/constants/tradingconstants/enum_trade_request_actions.
It's not there.
I checked many variants with freezing. In my case, single size was enough.
Why do you need such complications? Use the trade class CTrade.
Why go to all that trouble? Use the CTrade trading class.
Unfortunately this has been around since MT4. It was easier to adapt it.
I don't know about CTrade, but it seems that everywhere where you have to specify a symbol, it is present in parameters passed to the method. And it's not present in method OrderDelete(const ulong ticket), so it won't work. We should fill in the request.symbol somewhere beforehand.
Unfortunately, this has been around since MT4. It was easier to adapt.
About CTrade - I didn't understand it, but it seems that everywhere where you need to specify a symbol, it is in the parameters passed to the method. And it's not present in method OrderDelete(const ulong ticket), so it won't work. We have to fill in the request.symbol somewhere.
What won't work? This is a trade class: it sets, modifies and deletes REMOTE ORDERS, and opens, modifies and closes POISONS.
Absolutely everything works. And everything is written in one line by any trade command.
CTrade
What won't work then? It's a trading class: sets, modifies and deletes REMOTE ORDERS, opens, modifies and closes POISONS.
Absolutely everything works. And everything is written in one line by any trade command.
CTrade
So I just don't understand at what point m_request.symbol is filled
Anyway, problem solved. Thanks again so much for your help!
So I just don't understand at what point m_request.symbol is filled in
Anyway, problem solved. Thanks again so much for your help!
Take a debugger throughCTrade and you'll see where the symbol went :)