Questions from Beginners MQL5 MT5 MetaTrader 5 - page 166

 
how do I control the sounds in mt4? change or reduce their volume?
 

Hi all, Happy New Year!!!

How do I close a conditional order correctly?

I have tried to connect

#include<Trade\Trade.mqh>
//--- объект для проведения торговых операций
CTrade  trade;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- зададим MagicNumber для идентификации своих ордеров
   int MagicNumber=123456;
   trade.SetExpertMagicNumber(MagicNumber);
//--- установим допустимое проскальзывание в пунктах при совершении покупки/продажи
   int deviation=100;
   trade.SetDeviationInPoints(deviation);
//--- режим заполнения ордера
   trade.SetTypeFilling(ORDER_FILLING_RETURN);
//--- режим логирования
   trade.LogLevel(1); // лучше не вызывать этот метод вообще, класс сам выставит оптимальный режим
//--- какую функцию использовать для торговли: true - OrderSendAsync(), false - OrderSend()
trade.SetAsyncMode(true);
//---
   return(0);
  }
placed in the EA code
#include<Trade\Trade.mqh>
 
if(Buy_close)
   {
   if(!trade.PositionClose(_Symbol))
     {
      //--- сообщим о неудаче
      Print("Метод PositionClose() потерпел неудачу. Код возврата=",trade.ResultRetcode(),
            ". Описание кода: ",trade.ResultRetcodeDescription());
           
     }
   else
     {
      Print("Метод PositionClose() выполнен успешно. Код возврата=",trade.ResultRetcode(),
            " (",trade.ResultRetcodeDescription(),")");
            Print("сигнал равняется=",signal_s); 
     }
    }

Orders close, but error 10006 and a bunch of error messages appear: PositionClose() method failed. Return code=10006. Code description: rejected.

How to fix it? Perhaps there is an easier way to close a trade by condition?

 
forexman77:

Hi all, Happy New Year!!!

How do I close a conditional order correctly?

I have tried to connect

Orders close, but error 10006 and a bunch of error messages appear: PositionClose() method failed. Return code=10006. Code description: rejected.

How to fix it? Perhaps there is an easier way to close a trade by condition?

// #include<Trade\Trade.mqh> - это не надо второй раз писать в советнике, достаточно один раз перед входными параметрами

if(Buy_close)
   {
   if(!trade.PositionClose(_Symbol))
     {
      //--- сообщим о неудаче
      Print("Метод PositionClose() потерпел неудачу. Код возврата=",trade.ResultRetcode(),
            ". Описание кода: ",trade.ResultRetcodeDescription());
      return; // добавлена запись
     }
   else
     {
      Print("Метод PositionClose() выполнен успешно. Код возврата=",trade.ResultRetcode(),
            " (",trade.ResultRetcodeDescription(),")");
      Print("сигнал равняется=",signal_s);
      return; // добавлена запись
     }
   }
 
trora:
how do I control the sounds in mt4? change or decrease their volume?
With the Windows volume control
 
artmedia70:
Windows volume control

the answer is wrong.

interested in controlling sound files in the terminal itself.

where is the volume control and the option to change the sound at an event

 
trora:

the answer is wrong.

I'm interested in controlling the sound files in the terminal itself.

where is the volume control and the ability to change the sound at an event

The question is wrong. What is the question, is the answer. It is clear and concise. This is not the right forum.
 
artmedia70:
The question is wrong. What is the question, is the answer. It is clear and concise. This is not the right forum.

please do not flatter - if you have nothing to say.

I don't think the difference in sound organisation between mt4 and mt5 is that significant and fundamentally different.

I am specifically interested in how to add a sound to an event - in this case, to close a deal at takeout or by hand.

 

The answer is correct. The MT4/MT5 tools are not able to adjust the volume.

Learn to ask the right questions.

 
artmedia70:
Windows volume control
sandex:

. It is not possible to adjust the volume with the MT4/MT5 tools.


all different answers, isn't it?

A sound file itself has a certain volume - at the same sound level on the windows it may sound quieter or louder.

If you can't change the volume in the terminal, you'll have to use the sound editor to change the volume. (this should be the correct answer)

on this question--"how to add a sound to an event--in this case, closing a deal" any thoughts? wanted to make a sound of dropping coins...

 
trora:

...( that should be the correct answer)...

So you've been calling for the right answer all along? If yes, then why ask?
Reason: