
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
over this period
don't get it ?
The nearest minimum in the history is less than Low_1_Level , which will be .
Run the code to see how it works.
I have no errors for the whole period
I'm attaching the log
I have no errors for the whole period
I'm attaching the log.
There seems to be no error but it is in the log
You have in your log 19:31:53.126 2016.12.15 00:00:00 Array EURUSD,H1: i = 456 Bar_data_D1 [i][2] = 1.04789
as I have a price Min_D:104789 more than low_D1 1.03660 , by convention it cannot be so.
if i replace the for loop, there will be an error. and it will be correct.
actually expression2 is just masking an error
There is a question. Why do you start the loop with the first element and not zero?
If you don't mind giving me an example, how to write it correctly?
I have some experience in trading, but I'm only starting to learn MQL4.
If you use MqlRates, then declare an array:
MqlRates Bar_data_D1[];
That is, you get a one-dimensional array instead of a two-dimensional one. MqlRates is a standard structure (described in MQL4 Reference under "Basics of the Language" - "Data Types" - "Structures, Classes, Interfaces"). It has all the fields that you need in this case. You can address them like this:
i is the index of the array.
In the same way you can create your own structure to record the parameters of candlesticks. It will be smaller than Mqlrates by two fields (spread and real_volume), which you don't need. The structure will look like this:
Declaring an array of such structures looks like this:
Accessing members of the structure is similar to accessing members of MqlRates structure.
Exactly!
If via MqlRates, you declare the array like this:
That is, you get a one-dimensional array instead of a two-dimensional one. MqlRates is a standard structure (described in MQL4 Reference under "Language Fundamentals" - "Data Types" - "Structures, Classes, Interfaces"). It has all the fields that you need in this case. You can address them like this:
i is the index of the array.
In the same way you can create your own structure to record the parameters of candlesticks. It will be smaller than Mqlrates by two fields (spread and real_volume), which you don't need. The structure will look like this:
Declaring an array of such structures looks like this:
Access to members of the structure is similar to access to members of MqlRates structure.
Ok, I will try it tomorrow !
Thank you for your help. I will let you know when I figure it out.