Questions from Beginners MQL5 MT5 MetaTrader 5 - page 817
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
I understand correctly that the Volume method of the CPositionInfo class returns the volume corresponding to the point in time when the Select() method was last called? That is, you can find out the volume that was a month ago for this symbol?
You have explained how to prepare CPositionInfo. I still don't understand two things though:
1) How this recipe follows from the CPositionInfo class help ?
2) Why do we need the class itself, if you can't use more than one object normally, because before each access to the position property, we need to configure the position using the Select method, otherwise suddenly we will use the Select method for another CPositionInfo object somewhere else.
You have explained how to prepare CPositionInfo. I still don't understand two things though:
1) How this recipe follows from the CPositionInfo class help ?
2) Why do we need the class itself, if you can't use more than one object normally, because before each access to the position property, we need to configure its position using the Select method, otherwise suddenly we will use Select method for another CPositionInfo object in some other place.
I don't understand what my mistake is in using help.
1) I needed the volume of the position in the program.
2) Through a search I found the Volume method from the CPositionInfo class.
3) It refers to using the Select method before calling Volume.
4) There is no reference in the description of the Select method. To be on the safe side, I study the description of the CPositionInfo class.
5) I write the code. I get a result that doesn't follow from the reference.
Where is the error?
Once again I know about choosing a position and an order before accessing the properties. But this knowledge and knowledge of CPositionInfo in the help do not intersect.
Where is the mistake ?
If you learn to write in more detail, you will be able to see where you are wrong.
Try writing like this:
I don't understand what my mistake is in using help.
1) I needed the volume of the position in the program.
2) Through a search I found the Volume method from the CPositionInfo class.
3) It refers to using the Select method before calling Volume.
4) There is no reference in the description of the Select method. To be on the safe side, I study the description of the CPositionInfo class.
5) I write the code. I get a result that doesn't follow from the reference.
Where is the mistake?
Once again about position selection, order, before accessing properties I know. But this knowledge and the CPositionInfo knowledge in the help do not overlap.
It is a code block that bypasses all the positions and prints out information similar to that in the terminal in the "Trade" tab:
Algorithm of work: first We select the position (take a jar of jam from the supermarket shelf), then we access the properties of the selected position and print these properties (read the label on the jar of jam).
It turns out that the CPositionInfo class doesn't make any sense, because normally, you can only work with one object of this class.
Ivan Ivanov ,Vladimir Karputov, fxsaber thanks for your help.
I retrieve data from indicators in the Expert Advisor. First I calculate the handle, then I copy the last several actual values from the indicator buffers.
Questions:
1. What is the depth of history in these indicators?
2. Is there a method to limit the depth of calculations?
In this case we need only few last values to determine the inflection or direction up/down.
The Expert Advisor is multi-currency, there are dozens of indicators, so I don't need to make unnecessary calculations.
I retrieve data from indicators in the Expert Advisor. First I calculate the handle, then I copy the last several actual values from the indicator buffers.
Questions:
1. How deep is the history in these indicators?
2. Is there a way to limit the depth of calculations?
In this case we only need a few last values to determine the inflection or direction up/down.
The Expert Advisor is multi-currency, there are dozens of indicators, so there is a need not to make unnecessary calculations.
I hope you create indicator handles ONE time in OnInit()?
The calculation depth depends on the indicator. Rare indicators limit the depth forcibly - as a rule, all of them calculate the entire history. Therefore, perhaps the following variant is useful: to introduce the variable responsible for the depth in the indicator, and then to pass this parameter through iCustom in the Expert Advisor.