Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 795
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Set the display colour to clrNONE.
So you can only output the buffer, but not the variable separately?
So you can only output a buffer, but not a variable separately?
Thank you for answering.
So what I understand is to create a buffer, then fill it with
with RSI values and then feed this buffer withiMAOnArray().
Has anyone did this for EA and it will be displayed when testing EA in the subwindow?
Usually EA tests through iCustom are sluggish.
Took the code from the example in https://www.mql5.com/ru/docs/strings/stringadd and pasted it into the script. The result is the same in MQL4 and MQL5:
I thought StringAdd() and StringConcatenate() should run faster than "+". Why it is not so?
iCustom usually slows down the Expert Advisor's tests.
it's not true, usually it's vice versa, because the allocation of memory for the indicator buffers is done by the terminal, not by the MQL script, usually these problems are the problem of non-optimal calculation in the indicator, many newbies on one indicator call - tick, calculate the entire length of historical data
If you have understood the basics of MQL, read the articles, it's all written.
https://www.mql5.com/ru/articles/4602
Who has done this for an EA and it will be displayed when testing the EA in a subwindow?
no one has, read what is the difference between an EA and an indicator, who has indicator buffers and who does not, who has trading functions and who does....
ZZY: a subwindow can only create an indicator. If you create a subwindow, then you can add graphical objects to this subwindow using the Expert Advisorhttps://www.mql5.com/ru/docs/constants/objectconstants/enum_object
ZSYZZ: subwindow can be obtained by applying a template, there was a topic a couple of months ago, but I think you have a problem with other things so far
this is not true, usually it's vice versa, because the allocation of memory for the indicator buffers is done by the terminal, not by the MQL script, usually these problems are the problem of non-optimal calculation in the indicator, many newbies on one indicator call - tick, they calculate the entire length of historical data
If you have understood the basics of MQL, read the articles, it's been written for a long time.
https://www.mql5.com/ru/articles/4602
no one has, read what is the difference between an Expert Advisor and an indicator, who has indicator buffers and who does not, who has trading functions and who does ....
ZZY: a subwindow can only create an indicator, if you create a subwindow, then you can add graphical objects to this subwindow using the Expert Advisorhttps://www.mql5.com/ru/docs/constants/objectconstants/enum_object
ZSYZZ: subwindow can be obtained by applying a template, was a topic a couple of months ago, but I think you have a problem with something else so far
Sorry. Maybe I didn't phrase it right but
I don't mean to use it for testing, but I don't mean to run it.
As for visualization on the indicator chart during testing, if you use
When you use built-in indicator functions they are drawn on the chart in the process of testing
That's exactly what I mean.
But if you use some kind of custom indicator calculation code that is integrated in the EA code, then this indicator
will not be displayed in the process of testing the EA.
As for iCustom, when you use it in the process of testing the EA will be displayed on the chart
any indicator and the code of the indicator can be compiled with the EA into one ex4 but I don't need it.
I just wanted to know if there is a way to bypass iCustom in this matter, but if not, it's not a problem either.
Thank you very much for the comprehensive reply.
Artem posted an indicator template here, here is the part fromOnCalculate
I am using it but I have one question)
Why do I uselimit=rates_total-1 for full history calculation andnotlimit=rates_total?
Why islimit=rates_total-1 used for full history calculation andnotlimit=rates_total?
Try to check it, you will be immediately "out of range " - numbering of bars from zero to ... Total -1 , a common situation in programming - numbering starts with 0. As an obvious example, declare array double x[5] and try to write something in the last element x[5] = 100;
ZS: answering the question you haven't asked yet.... OrderTotal() also numbers from zero to OrderTotal()-1 ;)
ZS: answering a question that hasn't been asked yet.... OrderTotal() too numbering from zero to OrderTotal()-1 ;)
The question arose by the way, now I can't win an averaging on the array, though I do in five, but in what theme to write, I do not know, let it be here.
The indicator calculates the open-close difference and builds МА on it. I have chosen MA=2 for debugging but using SimpleMAOnBuffer and iMAOnArray I get unexplainable line shifts and iMAOnArray shows zero value on the last bar.
I have a related question, I am still struggling with array averaging, although I am doing it in 5, but I don't know what subject to write it in, let it be here.
I have a feeling that in MQL5 the indicator buffers and time series are "unfolded" in the opposite way, by default the leftmost bar in MT5 is bar 0 and in MT4 the rightmost bar is bar 0 and the indicator buffers have the same numeration
ZS: alas, I don't want to get involved with MT5, MT4 is enough for me to check my ideas, I only look at preparations in MT5, and if I write something using MT5 I never show it to anybody )))