Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1036
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
There:#10338
Thank you. I'll be at the computer, maybe I'll have a look.
the indicator is written in a very-very old format in MQL4, I haven't touched it for a long time, I'm not sure I remember how it was written
@zig2003 as an option, try to remove IndicatorBuffers(6) from start()
and at the top fix #property indicator_buffers 6
Igor Makanu, and after I correct the indicator what should I compare to in my Expert Advisor to programme the pivot?
each indicator consists of several indicator buffers
when you call the indicator from the Expert Advisor through iCustom(), you get the value of one buffer on a certain bar, and you can view this value in the data window Ctrl+D
what to compare depends on your TS, either the values of indicator buffers or buffer and price - there are many variants
You should first create an MA indicator, and then, when you understand it, you will call your own indicator instead of the MA
It's not that easy - just write a couple of commands and your Expert Advisor will be ready
ZS: an indicator pivot is a comparison of several values of indicator buffers, judging by your screenshot on the bar number 2 must be set near the price of buffer number 1 and the rest of the buffers will haveEMPTY_VALUE values, and on the bar №1, on the contrary, buffer №1 has the value EMPTY_VALUE , and one of 2 or 3 buffers will have the value different from EMPTY_VALUE - you should look it all in the window of data overview (move the mouse arrow on the bars and you see the buffers values)
Igor, thank you, I corrected the indicator, but the value from the buffer still did not appear. I have long ago passed that stage, everything is simple there, there are two lines - two buffers. Usually for similar indicators, which consist of one line, but with different buffers for colour, I write the code so:
But this is only if a real buffer is assigned to each colour. When you change colour on the first closed bar, the buffer value becomes greater than zero, while on the previous bar it was either equal to zero or the buffer of another colour was greater than zero. I can't get the value for the second Sell colour from this indicator and I don't know what to compare it with to catch the reversal. I've tried every buffer number. This is unfortunate, because this Mladenov's turntable, although old, but very decent trending in manual strategics.... Can someone guess how to pull the value from the second buffer and write the formula for the reversal?
Igor, thank you, I corrected the indicator, but the value from the buffer still did not appear. I have long ago passed that stage, everything is simple there, there are two lines - two buffers. Usually for similar indicators, which consist of one line but with different buffers for colour, I write the code in this way:
But this is only if a real buffer is assigned to each colour. When you change colour on the first closed bar, the buffer value becomes greater than zero, while on the previous bar it was either equal to zero or the buffer of another colour was greater than zero. I cannot get the value for the second colour from this indicator and I cannot understand what to compare it with to catch the reversal. And this is unfortunate, because this Mladenov's indicator, though old, but very well trending in manual strategics.... Can someone figure out how to write the reversal formula?
Without any indicator edits.
What does the data in the two buffers mean - in 0 and 1:
Change of direction (colour) of the line:
...
But you can also use only buffer 1:
"No value" here is EMPTY_VALUE. Or DBL_MAX - doesn't matter, it's the same thing. I.e. it's not zero, but EMPTY_VALUE.
Can anyone guess how to pull the value from the second buffer and write the pivot formula?
You don't have to guess, you should first rewrite the indicator in a normal form corresponding to the current state of MQL4
I have put the code in order a bit, but I'm not sure that there won't be errors. I don't like the source code, but I've worked with what I've got.
Here I see the values of indicator buffers of this indicator:
You don't have to guess, first you need to rewrite the indicator in a normal form corresponding to the current state of the MQL4 language
I have put the code in order a bit, but I'm not sure that there will be no errors, I don't like the source code, but I've worked with what I've got
Here I see the values of indicator buffers of this indicator:
It works without overwriting, and makes it very easy to get your data. I described it above - you just need to look at its buffer readings in the data window (Ctrl+D)
It works without rewriting and allows to receive its data very simply. I described it above - you just need to look at its buffer readings in the data window (Ctrl+D)
I wrote above that I don't remember how the IndicatorCounted() function works in old indicators, the new form of indicators with OnCalculate() is more understandable
Well, the issue seems to be solved, all right ;)