Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1206
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
Resize the nnc_arr_in array by 1 more than its size in cell 0 of the structures array:
Thank you.
Question mql5
There are two open positions and a signal(Flag==true)
only one position should be closed by this signal, i.e. the one with the larger profit.
How to close only the one with the higher profit?
What is the best way to handle this event?
I am trying to do it this way:
The last open position will be closed as a result.
Please advise how to do it correctly, I would like to have an example. I read reference books and primers, but I don't always understand the subtleties.
Question mql5
There are two open positions and a signal(Flag==true)
only one position should be closed by this signal, i.e. the one with the larger profit.
How to close only the one with the higher profit?
What is the best way to handle this event?
I am trying to do it this way:
The last open position will be closed as a result.
Please advise how to do it correctly, I need an example. I read reference books but I don't always understand details.
Code:
Code:
Thank you very much, seems to work. Only complains about ticket, as there is already such a local variable.
The declaration of 'ticket' hides local variable Lim_Stop_03_Sell_pos_06.mq5 299 10
Some of these tickets might need to be hidden inside.
Thank you very much, it seems to be working. Only it complains about ticket, because there is already such a local variable.
The declaration of 'ticket' hides local variable Lim_Stop_03_Sell_pos_06.mq5 299 10
Some of these tickets might need to be hidden inside.
Rename the variable
в
and of course do not forget to rename it in your code.
Rename the variable
в
and of course don't forget to rename it in the code as well.
Yes thanks, I've already sorted it out... renamed it.
Good day!
Can you please tell me where I can find an EA that sends an email or push letter if the price is above the top line, or below the bottom line (the line is horizontal or slanted and can be moved on the chart)
Maybe someone has one, please share.
Only on MT5
Thank you!
if I connect the indicator in EA
and then I get indicator buffers using CopyBuffer(ind_handle, 0, 1, 3, buffer1)
do i have to read every tick of indicator buffers?
I need an answer, and preferably the source - docs, articles:
1. the indicator always calculates itself in parallel
2. the indicator is calculated only at the moment of call of CopyBuffer()
if I connect the indicator in EA
and then I get indicator buffers using CopyBuffer(ind_handle, 0, 1, 3, buffer1)
do i have to read every tick of indicator buffers?
I need an answer, and preferably the source - docs, articles:
1. the indicator always calculates itself in parallel
2. the indicator is calculated only at the moment of call of CopyBuffer()
There is information somewhere about the calculation of the indicator on every tick. As far as I remember, by default the indicator is recalculated only when it is accessed, but it is possible to make it recalculate on every tick. How to do it, you should look in the documentation.
Igor, if the indicator is written correctly, only the values of the current bar can be changed. Therefore, if you need current values, you should use the CopyBuffer right before using these fresh values. And if we need history values, they don't change, and there's no reason to re-read them.
There is some information somewhere about the calculation of the indicator on every tick. As far as I remember, by default the indicator is recalculated only when it is called, but it is possible to make it recalculated at every tick. How to do this is in the documentation.
OK, so I will have to test it anyway
the problem is in the indicator redrawing, I do not want to rewrite the indicator yet