Errors, bugs, questions - page 342

 
Urain:

The easiest solution for MQ would be to give the function parameters

arrays instead of variables, which exist as parameters now. The solution of course is one-sided as there is no way to transfer data between EAs anyway, but still it's better than nothing.

Even better would be something like this

void SendData(const int handle,const long &lparam[],const double &dparam[],const string &sparam[])
void GetData(const int handle,const long &lparam[],const double &dparam[],const string &sparam[])

To be able to send to a specific recipient and receive from a specific sender. And not just send for some chart. And make the handle public. Well, something like that.

 

There is such a task: the indicator window should be removed and restored from the Expert Advisor. But the calculated data remains constant.

A simple solution is to create an indicator for calculating data (let's call it "Calculate") and an indicator for displaying data in a separate window, let's call it "Plot". The "Plot" indicator is called by iCustom("Calculate"), but the Expert Advisor is also called before by iCustom("Calculate"). They are called with the same parameters. I've mentioned somewhere that two indicators with the same parameters are not created in one chart, they create additional handle that refers to the main handle of the already started indicator process.

Hence, the question: after the Plot has been removed from an EA and added again, will the Calculate indicator launched in the Plot be calculated again, or will it just take the calculated data of the Calculate indicator launched in the EA?

 
Urain:

I've mentioned somewhere that two indicators with the same parameters are not created in one chart, but only an additional handle is created which refers to the main handle of an already running indicator process.

MQL5 Reference Guide / Technical Indicators / Functions for working with technical indicators:

"All functions like iMA, iAC, iMACD, iIchimoku, etc., create a copy of the appropriate technical indicator in the global cache of the client terminal. If a copy of the indicator with these parameters already exists, a new copy is not created, but the counter of references to this copy is incremented.

These functions return the handle of the corresponding indicator copy. Using this handle, you can subsequently retrieve data calculated by the corresponding indicator..."

"Note. Multiple calls of the indicator function with the same parameters within one mql5-program will not increase the reference counter many times, the counter will be increased only once by 1. . ..".

 
Yedelkin:

MQL5 Reference Guide / Technical Indicators / Functions for working with technical indicators:

...

"Note. Multiple access to the indicator function with the same parameters within one mql5-program does not lead to multiple increase of the indicator counter, the counter will be increased only once by 1. ...".

Yes, that's exactly it. Thanks for the tip.

I do not understand exactly this line. Is it possible to consider the indicator launched in the Expert Advisor as one program or is it meant to be two programs?

If the first assumption is made, then everything is OK. But if the compiler treats them as different programs, then there is a problem.

 
Urain:

Can the indicator running in the EA be considered as one programme, or is it meant to be two programmes?

1. The Handbook says:"All functions like iMA, iAC, iMACD, iIchimoku, etc., create a copy of corresponding technical indicator in global cache of client terminal".

I read it as (referring to your question):"All functions, like iMA, iAC, iMACD, iIchimoku , etc.are called from a particular mql5-program andcreate a copy of the appropriate technical indicator in the global cache of the client terminal". Therefore, the common phrase"EA E runs indicator I" means that EA E calls function I, which creates a copy of the indicator in the client terminal global cache and causes EA E to receive the handle of that copy.

2. if "EA E calls indicator function I", then it means that it calls indicator function "within one mql5 program".

 
I downloaded 420 build from herehttps://www.mql5.com/ru/forum/23/page11 but it actually installs 412. Am I having a problem or did they forget to change themetaquotes.net file?
Список изменений в билдах MetaTrader 5 Client Terminal
Список изменений в билдах MetaTrader 5 Client Terminal
  • www.mql5.com
Автоматическое обновление доступно через систему LiveUpdate:.
 
Yedelkin:

1. The Reference Manual says:"All functions like iMA, iAC, iMACD, iIchimoku, etc., create a copy of the relevant technical indicator in the global cache of the client terminal".

I read it as (referring to your question):"All functions, like iMA, iAC, iMACD, iIchimoku, etc. are called from a particular mql5-program and create a copy of the appropriate technical indicator in the global cache of the client terminal". Therefore, the common phrase"EA E runs indicator I" means that EA E calls function I, which creates a copy of the indicator in the client terminal global cache and causes EA E to receive the handle of that copy.

2) If "EA E calls indicator function I", then we are talking about calling the indicator function "within a single mql5 program".

I got it. The key phrase here is"in the client terminal's global cache".

If so, then everything is OK. One more question has been clarified.

 
a483483:
I download the 420 build from herehttps://www.mql5.com/ru/forum/23/page11 but it actually installs the 412th. I have a problem or inmetaquotes.net file forgot to change ?

So wait and it should update itself to the latest version.

SZS just leave the terminal running and mind your own business, after a while you will see in the terminal message that downloaded such and such a version and ask to restart the terminal.

 

Good afternoon!

After upgrading to 420 release I started to test my EA and noticed that it started "losing" for some reason. I analyzed my trades and noticed that stop loss is triggered at non-existent prices. For example, I set stop loss at 1.06520 on EURUSD, but it works, although the maximal price is 1.05920. When I look further, I see a lot of such deals. Take Profit is triggered by the same principle (at non-existing prices) - the delta is the same - 600 points. In the tester on the chart the up and down arrows "hang" in the air, far from bars.

A screenshot is attached.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5
Files:
eurusd.jpg  235 kb
 
Kairoser:

Good afternoon!

After upgrading to 420 release I started to test my EA and noticed that it started "losing" for some reason. I analyzed my trades and noticed that stop loss is triggered at non-existent prices. For example, I set stop loss at 1.06520 on EURUSD, but it works, although the maximal price is 1.05920. When I look further, I see a lot of such deals. Take Profit is triggered by the same principle (at non-existing prices) - the delta is the same - 600 points. In the tester on the chart the up and down arrows "hang" in the air, far from bars.

A screenshot is attached.

Try to test your EA on MQ server. Alpari may still have the old problem with incorrect historical data.
Reason: