Errors, bugs, questions - page 2101
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
Hello, I have started studying MQL5 sincehttps://www.mql5.com/ru/articles/100. I have launched the code and got error 4756. I have looked through the documentation and it was no better. I thought I would start with something simple (Alert/Print...). One of the most important functions is OrderSend. I started searching through the forum/documentation on how to use OrderSend. I found this articlehttps://www.mql5.com/ru/docs/constants/tradingconstants/enum_trade_request_actions and found the code for opening a Buy position. I got error 4756 and retcode 10030. I understood that 10030 - it is the OrderSend property, but I have not understood how this property should be used (I looked at somebody else's code) and what it is mainly used for. Then I openedhttps://www.mql5.com/ru/docs/trading/ordersend, copied the code, ran it, it worked fine.
But I still don't understand why error 4756 appears and how to get rid of it, as well as 10030.
Looked at the code between
and this one.
They seem almost identical to me, I don't see where these errors appear (4756 and 10030). Point the finger and explain please
Instant Execution
A trade order to open a position in the Instant Execution mode (the mode of trading at streaming prices). 9 fields are required:
You can also specify magic and comment fields.
Market Execution
A trade order to open a position in the Market Execution mode. Requires 5 fields to be specified:
You can also specify magic and comment fields.
what update has arrived, 1736, what's in it, where can I read it?
I propose to give an opportunity to determine programmatically which indicator buffer is drawing on the chart.
Suppose a trader starts his own indicators, we don't know how many buffers are used for calculation and how many are used to draw the indicator on the chart.
Addressing custom indicators through
intChartIndicatorGet(
longchart_id,// chart identifier
intsub_window// number of the subwindow
const string indicator_shortname // short indicator name
);
We can also request the array of drawing buffers
intChartIndicatorGet(
longchart_id,// chart identifier
intsub_window//window number
const string indicator_shortname // short indicator name
int & IndicatorVisualBuffer[] // drawing buffer numbers... );
This will extend the possibility of working with unknown indicators installed on the chart...
I propose to give an opportunity to determine programmatically which indicator buffer is drawing on the chart.
Suppose a trader starts his indicators, we don't know how many buffers are used to calculate and how many are used to draw the indicator on the chart.
Addressing to the indicator through
intChartIndicatorGet(
longchart_id,// chart ID
intsub_window// number of the subwindow
const string indicator_shortname // short indicator name
);
We can also request the drawing buffers array
intChartIndicatorGet(
longchart_id,// chart identifier
intsub_window//window number
const string indicator_shortname // short indicator name
int & IndicatorVisualBuffer[] // drawing buffer numbers... );
This will increase the possibility of working with unknown indicators installed on the chart...
What does it return?
and what will be the use of adding it? You want to add an input parameter and receive the same indicator handle in response...
And if you don't mind, for what purpose is it needed? I am not being ironic. After all, if something is suggested, you should, in my opinion, give a convincing argument of the necessity of the suggested.
What does it return
and what good would it do to add it? You propose to add an input parameter and get the same indicator handle in response...
And if it isn't difficult, for what purposes did such a necessity appear? The question is without irony. After all, if something is offered, it is necessary, in my opinion, to give convincing arguments in necessity of the offered.
The user puts any indicator.
The Expert Advisor automatically finds it and uses buffer data to receive the signal.
Now we have to use iCustom and if we can write the parameter list, here is the problem with buffers....
It is possible to count the buffers quantity through Copy, but it's impossible to understand which one of them is drawing ...
The user places any indicator.
The Expert Advisor automatically finds it and uses buffer data to obtain the signal.
Now we have to use iCustom and if we can write the list of parameters, here is the problem with buffers....
It is possible to count the buffers quantity using Copy programmatically, but it's impossible to understand which one of them is drawing ...
Why is it impossible? Can the buffer INDICATOR_CALCULATIONS be taken out through iCustom()?
It's an interesting question, but not in this thread to discuss it. I personally have doubts that it can somehow improve or simplify the programmer's work. The indicators are too different and the conditions of their application are too different. Then we will have to ask to be able to determine the type of graphical plotting and some other things, and our internal requests will snowball.
Why is it not possible? Can the INDICATOR_CALCULATIONS buffer be reached through iCustom()?
The question is interesting, but not in this thread to discuss it. Personally I have doubts that it can somehow improve or facilitate the programmer's work. There are too different indicators and too different conditions for their application. Then we will have to ask to be able to determine the type of graphical plotting and some other things, and our internal requests will snowball.
Theoretically, what is written into the indicator by default, I'm not speaking about the programmer's code, should be available from outside ... Buffers their number, plotting type, colour, and other standard ...
This is the problem I've encountered:
I decided to use as magic the remainder of division of ChartID by 1000 or 10000, it doesn't really matter.
But for some reason with different ChartID() the remainder of the division suddenly turns out the same. Question: why?
Checking script
Result
I expected to see 74907 and 74908 respectively, because the remainder of the division should be the same.
I am also waiting for an answer to this question.
Forum on trading, automated trading systems and strategy testing
Bugs, bugs, questions
Alexey Viktorov, 2018.01.09 14:21
In the MT5 tester the "Input field" object OBJ_EDIT doesn't allow to edit value in it. Is this the way it's designed or is it a bug?
In terminals and MT4 tester it is editable, but in MT5 tester it doesn't want to, the value entered into it programmatically when creating the object disappears at all.
But for some reason different ChartID() suddenly produces the same residual from division. Question: why?
Because input fmod is double. Double cannot store a huge number of integers. For instance, this is your case:
Do this.
Using float as an example, you can quickly understand the peculiarity of double
Result
SZY double doesn't lose the information of the whole int-range, not so with long.
Because the input fmod is double. Double cannot store a huge number of integers. For example, your case:
Do this.
Of course, I will check this sample now but I also had a check code like this
the result is
It indicates that there should not be value truncation.
But here I checked this variant and slightly changed the proposed
and got the expected variant.
Another question appears,
If MathMod as well as fmodreturns real remainder after division of two numbers. And % according to the documentation
The remainder of minutes = time % 60;
why is there a difference?