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'm writing an algorithm of simple price constructions transfer to mcl5 from mcl4, on examples of mcl4 code copying to mcl5 stochastic masd and rsi, there are basic methods of access to mcl4 data.
Soon we'll have what we need.
now I'm struggling with iMaOnArRAu function as mt5 doesn't provide it to get the simplest methods of moving averages from user arrays.
i will expand libraries to all technical tools, i know almost all algorithms
I'm so dumb... I can't figure out how to write...
There is this code:
I want to get the index of the bar with the lowest Low among the bars from i-th to j-th.
I'm trying to use the ArrayMinimum function.
int k=ArrayMinimum(rates.low,i,j-i+1); - wrong
int k=ArrayMinimum(rates[].low,i,j-i+1); - wrong
What is the correct way?
I'm so dumb... I can't figure out how to write...
There is this code:
I want to get the index of the bar with the lowest Low among the bars from i-th to j-th.
I'm trying to use the ArrayMinimum function.
int k=ArrayMinimum(rates.low,i,j-i+1); - wrong
int k=ArrayMinimum(rates[].low,i,j-i+1); - wrong
What is the correct way?
Use functions of direct access, MqlRates is an array of "structures", and you need an array Low, here is an example, for High as well.
Take a look at examples of codes. This is from https://www.mql5.com/ru/code/102
Use direct access functions, MqlRates is an array of "structures" and you need an array of Low, here is an example, immediately and for High.
It's understandable. In my case, I've just written:
I don't want a bunch of arrays. It's not thrifty on resources and not very nice...
I just wanted to understand exactly withArrayMinimum - is it possible to use this function with an array of structures....
It's understandable. In my case, I just wrote:
I don't want a bunch of arrays... It's not resource-saving and not very nice...
I just wanted to deal with ArrayMinimum - is it possible to use this function with an array of structures....
If you think that storing a bunch of information in an array of structures is more economical than an array of doubles, I'm just holding up my hands.
or do you think storing ints, longs and dates is more economical in terms of memory?)
or picking out what you need from a pile of rubbish is more economical, ha ha ...
If you think storing a bunch of information in an array of structures is more economical than an array of doubles, then I'm just giving up
or do you think storing ints, lows and dates is more economical in terms of memory? ;))
or picking out what you need from a pile of rubbish is more economical, ha ha ...
Usually, before I ask anything, I go through various sources in search of an answer.
But now, after a week of searching, I've realised that I don't have an answer and I don't think anyone has come across it yet. Therefore I propose a puzzle.
Initial data:
1) I have a simple indicator such as Levels and Arrows iS7N_SacuL_v3.mq5 (attached)
2) an Expert Advisor that tries to receive data from this indicator aS7N_TIC.mq5 (attached)
So!
Out of five indicator buffers, only two data are correctly returned.
A detailed explanation will follow!!!
Having looked at the situation carefully, I found that both 3 and 4 indicator buffers do not always give the correct data (although it is impossible to tell which are correct and which are not)
Look at the chart. In the Data window on the left side there are values of the indicator in the chart and below there are values obtained by the Expert Advisor. Most of the values are the same, but there are some more...
In this regard, I have suggested that different historical data are used in the chart and in the tester.
What do you think?
Finally, the main problem! It is not possible to get the data of 1,2 and 5 indicator buffers in the usual way.
The problem is that the previously calculated data of the previous bars are taken into account when calculating the data for these arrays.
Of course, when calling the indicator, you can force it to recalculate N upcoming bars, regardless of the value of prev_calculated .
I suppose that the calling and calculation of indicator values is performed with the value ofprev_calculated not equal to 0
For most indicators this is true, because it saves resources, but for the given example it won't work.
What to do? What are your thoughts?
Alternatively, you can move all calculations to the Expert Advisor! This option works, but not the same... I'd like to not wear my trousers over my head.
in the Expert Advisor is used
value from bar 0 is taken, the values of indicator buffers for it are changed on every tick until the candle closes.