Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 664
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 don't understand how to write indicators, what is the problem?
I need a line to be drawn showing the difference in price between active_1 and active_2
it works
I also need an average ma_period ma_period to be plotted on this line, there is a problem with it - it is not displayed
You do not check the result of copying.
You copy the entire history on every tick.
The number of Bars(), not rates_total, should be copied from a non-native symbol (not the current chart symbol).
Every two minutes, you need to request, for example, current bar time for a non-native symbol to keep its history data up-to-date.
Use SimpleMAOnBuffer() to smooth the dataBuffer data
You do not check the result of copying.
You copy the entire history on each tick.
A non-native symbol (not the current chart symbol) should have Bars() number copied, not rates_total.
Every two minutes, you need to request, for example, current bar time for non-native symbol to keep its history data up to date.
Use SimpleMAOnBuffer() to smooth the dataBuffer data
like this? stopped working at all
Greetings.
Could you please tell me how to record some values when an EA opens an order, so that they refer to that particular order, for example on a ticket.
Greetings.
Could you please tell me how to record some values when an EA opens an order, so that they refer to that particular order, for example on a ticket.
In the comment
I want to observe the volatility. For this purpose I calculate the close-open difference in tmp1 array and then use it to plot SMA for a period of interest.
No errors occur at compilation, the terminal doesn't draw the indicator, the log shows CADJPY,H1: array out of range in '_t1.mq4' (65,11)
This is the line where the differenceMathMax-MathMin is calculated, what may be the reason?
I want to observe the volatility. For this purpose I calculate the close-open difference in tmp1 array and then use it to plot SMA for a period of interest.
No errors occur at compilation, the terminal doesn't draw the indicator, the log shows CADJPY,H1: array out of range in '_t1.mq4' (65,11)
This is the line where the differenceMathMax-MathMin is calculated, what may be the reason?
I haven't understood the code, but if so:
Forum on trading, automated trading systems & strategy testing
Any questions for beginners in MQL4, help and discussion on algorithms and codes
Vitaly Muzichenko, 2018.10.16 12:13
Didn't really deal with the code, but if so:
It doesn't work.
UPD
Simplified string to bare minimum tmp1[i]=close[i]; Error remains the same.
I want to observe the volatility. For this purpose I calculate the close-open difference in tmp1 array and then use it to plot SMA for a period of interest.
No errors occur at compilation, the terminal doesn't draw the indicator, the log shows CADJPY,H1: array out of range in '_t1.mq4' (65,11)
This is the line where the differenceMathMax-MathMin is calculated.
Array tmp[] is declared as a dynamic array and is initially of zero length. Hence the error.
You should declare this array as an indicator buffer for calculations.
Forum on trading, automated trading systems & strategy testing
Any questions for beginners in MQL4, help and discussion on algorithms and codes
Alexey Viktorov, 2018.10.16 12:31
Array tmp[] is declared as a dynamic array and is initially of zero length. Hence the error.
This array should be declared as an indicator buffer for calculations.
Why can't we use a dynamic array?
In this case I have the closing price overwritten there without any calculations.
Where can I read how to use indicator buffers?