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
This is how I get the current data of the moving average, is this correct?
Two questions.
1.Nothing about not associating the indicator buffer number with the indicator. Since there is one indicator, it automatically got buffer 0 and that's what I specified.
2. If I have the indicator handle in initialization, when I change the parameters that are passed to the indicator, do I need to re-fill the EA to the chart so that the initialization event comes and the new parameters are applied?
This is how I get the current data of the moving average, is this correct?
Two questions.
1.Nothing about not associating the indicator buffer number with the indicator. Since there is one indicator, it automatically got buffer 0 and that's what I specified.
2. If I have the indicator handle in initialization, when I change the parameters that are passed to the indicator, do I need to reload the EA to the chart for the initialization event to occur and the new parameters to apply?
1. There is no "association". There never was.
Let's read the help on CopyBuffer
There is a function that takes indicator handle (in your case this is variablema_handle and buffer number '0' - zero, because Moving Average indicator has only one buffer).
2. If you change input parameters in your EA, it will initialize your EA again and the indicator handle will be created in OnInit with the parameters you entered.
1. There is no "association". There never has been.
...
Meaning call toSetIndexBuffer()
Meaning a call to SetIndexBuffer()
Yes, I do not know what is an indicator buffer number, how these buffers are created, do they belong to a certain indicator or they have a general numbering. The documentation says to write SetIndexBuffer(), but in the Moving Average example it's written without. I've read the reference and searched additional articles, but it's still unclear. Does the preprocessor need to specify the buffers and why should the buffers be one less than in the preprocessor directive and not the same.
If you look for some metaphysical meaning... then a lot becomes incomprehensible. Otherwise, it's just a number. It belongs to a specific indicator.
The Expert Advisors don't have indicator buffers at all, therefore there cannot be a SetIndexBufer() call.
Not one less, but exactly the same. When counting from zero, the last number is 1 less than the total number.
If you don't mind, answer a few more questions, please.
1. I don't understand why I need to assign 0 to a declared variable if I'm going to assign something later anyway. And moreover, sometimes 0 is not assigned, sometimes it is.
And they say that you need to delete objects in deinitialization (I do not understand why), but an indicator handle is an object, but it is not usually deleted, why is that?
3.MqlTradeRequest request={0}; What does it mean? Probably, the entire structure is assigned 0, but it doesn't contain only numeric types.
4. And why is there a logical operation here?
If you don't mind, answer a few more questions, please.
1. I don't understand why I need to assign 0 to a declared variable if I'm going to assign something later anyway. And moreover, sometimes 0 is not assigned, sometimes it is.
And they say that you need to delete objects in deinitialization (I do not understand why), but an indicator handle is an object, but it is not usually deleted, why is that?
3.MqlTradeRequest request={0}; What does it mean? Probably, the entire structure is assigned 0, but it doesn't contain only numeric types.
4. Why do we need a logical operation here?
1. Out of habit.
2. it is another object. It will be unloaded by itself, but it can be accelerated by function IndicatorRelease().
3. it is cleared and that's it.
4. this is not a logical operation, but transfer of variable by reference.
1. Out of habit.
2. this is a different object. It will then unload itself, but can be accelerated by IndicatorRelease().
3. it is cleared and that's it.
4. this is not a logical operation, but transfer of variable by reference.