Questions from Beginners MQL5 MT5 MetaTrader 5 - page 364

 
Vasiliy Sokolov:

Obviously, the method you presented is a transit method. The error is probably not in it. It is not clear from the data presented what is going on. There could be several possibilities:

  • Incorrect chart identifier (which is what the 4101 error says).
  • Too frequent queries;
  • Incorrect other parameters (event IDs for example).

Judging by the level of code you wrote, we can say that the error can be anywhere and anytime.
 

Hello Gentlemen traders, who has the elliot wave analyzer3 program? The problem is that i can't load quotes history from mt4 to elliot wave analyzer!

i can't load quotes from mt4 and elliot wave analyzer !

 

Here's the system

Where else can I get 4MB of RAM?

I mean, I reboot the PC, disable the antivirus, start the terminal and the tester, when testing the robot, says 4 MB is not enough.

Previously, with browsers and antivirus, it said it was 17 MB short.

 
Roman Shiredchenko:

Here's the system

Where else can I get 4MB of RAM?

I mean, I reboot the PC, disable the antivirus, start the terminal and the tester, when testing the robot, says 4 MB is not enough.

Previously, with browsers and antivirus, it said it was 17 MB short.

Do other bloopers in the Expert Advisor bother you at all? If you remove them, you will have enough memory for everything.

Still, you should buy more memory, 2GB is ridiculous these days...

 
Vitalie Postolache:

Aren't the other bloopers in the EA embarrassing at all? If you remove them, there's enough memory for everything.

Still, I should buy some more memory, 2Gb is ridiculous these days...

Thank you. :-) About the bloopers -.

"2015.04.21 16:48:06.526 (SBRF-6.15,H1) Not all data of MA is calculated. Error 4806. [ SBPR-6.15 ].

Should I pay attention to this?-no"

 
Vitalie Postolache:

Aren't the other bloopers in the EA embarrassing at all? If you remove them, there's enough memory for everything.

Still, I should buy some more memory, 2Gb is ridiculous these days...

It's not really that funny. I took an old laptop with 2 gig of RAM to the countryside, put it, for fun, Win7 64bit, and nothing works. I power it off only at night on weekends, and sometimes on Friday through Saturday I power it on too. My phone has 2 terminals MT4 and Skype. I do run Mozilla from time to time.

 
Vasiliy Sokolov:

Obviously the method you presented is a transit method. The error is probably not in it. It is not clear from the data presented what is going on. There could be several possibilities:

  • Incorrect chart identifier (which is what the 4101 error says).
  • Too frequent queries;
  • Incorrect other parameters (event identifiers, for example).

Judging by the level of code you wrote, you can say that an error may be anywhere and anyplace.

This piece of code was taken from the official site in the article about custom chart events. I cannot judge about the "writing level" of the code in such sources.

- the chart identifier is specified correctly (as you can tell from the absence of error 4101)

- what do you mean by frequent requests is not clear to me, what do you mean, could you please explain?

- The entire algorithm has been running correctly for 24 hours and sometimes one of these errors occurs for unknown reasons. Assuming the parameters are wrong, do these errors have anything to do with event ID?

Let me remind you that there is a list of errors that can be caught:

ERR_CHART_NO_REPLY

4102

Chart does not respond

ERR_CHART_NO_EXPERT

4104

Chart does not have an expert that can handle the event

ERR_INTERNAL_ERROR

4001

Unexpected internal error


Once again, let me remind you that everything works without errors for quite a long time, for unknown reasons errors sometimes occur. And thank you for your reply.

 
dariamap:

...

...

Can you post a finished example reproducing this error? Battle sources are not needed, prepare as simple an example as possible to demonstrate this error.
 

Good day to all.

How to correctly prepare a trade request

//-----OrderSend:
double MyOrderSend(
   string   symbol,               // символ
   ENUM_ORDER_TYPE cmd,           // торговая операция
   double   volume,               // количество лотов
   double   price,                // цена
   int      slippage,             // проскальзывание
   double   stoploss,             // stop loss
   double   takeprofit,           // take profit
  // ENUM_ORDER_TYPE_FILLING
    int fill_type = SYMBOL_FILLING_FOK, // 
   string   comment=NULL,         // комментарий
   int      magic=0,              // идентификатор
   datetime expiration=0,         // срок истечения ордера
   color    arrow_color=clrNONE   // цвет
               )
  {
  //--- готовим запрос
   MqlTradeRequest request={0};
   request.action=TRADE_ACTION_DEAL;            // открывать по рынку
   request.magic=magic;                         // ORDER_MAGIC
   request.symbol=symbol;                       // инструмент
   request.volume=volume;                       // объем в лотах
   request.price=price;                         // цена для открытия
   request.sl=stoploss;                         // Stop Loss
   request.tp=takeprofit;                       // Take Profit   
   request.deviation=slippage;                  // проскальзывание
   request.type=cmd;                            // тип  ордера
   request.fill_type=SYMBOL_FILLING_FOK;                 // Тип ордера по исполнению
   request.expiration=expiration;               // срок истечения ордера 
   request.comment=comment;                     // комментарий
 
//--- отправим торговый приказ
   MqlTradeResult result={0};
   if (OrderSend(request,result))
   return(result.price);
   else
   return(0);
  }
//-----OrderSend

because when I put an expo on a chart, I get the following error

Perhaps we need to explicitly specify the policy for filling a market order...

Thank you for your help.

 
Roman Shiredchenko:

Good day to all.

How to correctly prepare a trade request

because when I put an expo on a chart, I get the following error

Perhaps we need to explicitly specify the policy for filling a market order...

Thank you for your help.

Carefully read the names of fields in the trade request structure. The fill_type should be replaced with type_filling. SYMBOL_FILLING_FOK should be replaced with ORDER_FILLING_FOK.

P/S/ Better use the CTrade trade class. It allows you to place orders without filling tedious trade structure.

Reason: