Questions from Beginners MQL5 MT5 MetaTrader 5 - page 181

 

Please advise how to increase the volume of an open position, for example, when a new signal comes in. I do not use the Trade\Trade.mqh library. The request looks like this:

 if(!PositionSelect(_Symbol))
 mrequest.action = TRADE_ACTION_DEAL;              // немедленное исполнение
      mrequest.price =  NormalizeDouble(Ask,_Digits);   // последняя цена ask
      mrequest.sl = NormalizeDouble(mrequest.price - SL*_Point,_Digits);                                   // Stop Loss
      mrequest.tp = NormalizeDouble(mrequest.price + TP*_Point,_Digits);                                // Take Profit
      mrequest.symbol = _Symbol;                        // символ
      mrequest.volume = lot1;                            // количество лотов для торговли
      mrequest.magic = Mag1;                               // Magic Number
      mrequest.type = ORDER_TYPE_BUY;                   // ордер на покупку
      mrequest.type_filling = ORDER_FILLING_FOK;        // тип исполнения ордера - все или ничего
      mrequest.deviation=10;                            // проскальзывание от текущей цены
                                        
      OrderSend(mrequest,mresult);                       // отсылаем ордер
      if(mresult.retcode==10009 || mresult.retcode==10008)
        Print("Оpen position Buy");
Or should I create a new request using TRADE_TRANSACTION_ORDER_ADD?
 

I wrote my class, put it in the include folder, created a script, wrote the path to my class, but the functions are not highlighted. If you write code using my functions, they will work, but they are not highlighted. Highlighting of standard libraries is. Please tell me what I need to do to make my functions highlighted?

Here is such class

class BaseClass
   {
    protected:
    
    public:
    
    //конструктор
    void BaseClass(){};
    
    void Fly()
      {
       Alert ("Go fly");
      }
      
    void Move()
      {
       Alert ("Go move");
      }
   };
 
trora:

situation-open order in mt4. when the time comes to close it- press X in the trade window- where is the end of the order line. how is the closing procedure carried out? what labels. deal identifiers are transmitted?

i>The understanding is needed for a bigger problem.

when an investor's account is opened, all of the manager's orders that were previously opened are copied to it.

the top priority is to find out how to copy only new orders opened and closed by the manager after attachment of the investor's account.

if you know how to do it - describe it in details.

if you know what is impossible, please explain the reasoning.

only imho: when x is clicked, the order is closed according to the order ticket.

the copier should not count trades before a certain time (e.g.: either an external variable or the time the copier was started)

 
BigfOOt:

Can you tell me what I need to do to have my functions highlighted?

You can't. The highlighting of user functions is not implemented. Try to contact Service Desk and ask them to implement it. They may do it.
 
MetaDriver:
You can't. User functions are not highlighted. Try to contact Service Desk and ask them to implement it. They might do it.
I wrote to Service Desk some time ago. They seemed to approve it.
 
Swan:

only imho: when you click on x the order is closed according to the order's ticket.

it is theoretically possible to solve this problem - copier should not consider trades before a certain time (e.g.: either an external variable or time of copier triggering)

so i want to find out (i am not a programmer, if anything) - is the ticket sent with all parameters - including number, opening time, price and volume, or only the number of an open order - which is closed?

9 it is obvious that i need a filter by time of copier execution or by time of account accession. i should just understand it myself - to be able to clearly explain it to the programmer

 
MetaDriver:
You can't. The custom function highlighting is not implemented. Try to contact Service Desk and ask them to implement it. They may do it.
I wrote my class and Expert Advisor last summer, and highlighting of my functions worked, and now it doesn't. Why did I have to delete it ...
 
BigfOOt:
Last summer I wrote my class and expert and highlighting my functions worked, but now it doesn't. Why did you have to delete it ...
Ask the service desk. It happens when something breaks with updates.
 
Good afternoon, dear friends. I am having a hard time understanding the EA's optimisation parameters. I am trying to change any of the parameters in the EA properties, for example, Max drawdown, but after changing the parameter it comes back to the default value of 70. How can I change it to, for example, 30?
 
MetaDriver:
You can't. Custom function highlighting is not implemented. Try to contact Service Desk and ask them to implement it. They might do it.
Hm, what is "highlighting of user functions"? It seems to be all there is...
Reason: