SpikesHardy # : Please not just the current fractal but based on my analysis, i may need the 4th lower fractal or the 10th upper fractal or any fractal with a range between the current and the 20th fractals. i want to be able to change the fractal index in the alert function to any number between 0 and 20 e.g at anytime within the code. ALL I NEED IS A CODE THAT WOULD COUNT THE LOWER AND UPPER FRACTALS BACKWARDS TO THE 20TH AND ASSIGN THEM TO AN ARRAY. i hope you'd understand my illustration .THANK YOU
Yes, now I get it. You need:
enter two variables of the 'datetime' type - in these variables you will store the time of the N-th fractal (for example, the time of the UP fractal number 5 and the time of the DOWN fractal number 5).
use third form CopyBuffer
intCopyBuffer(
int indicator_handle, // indicator handle int buffer_num, // indicator buffer number datetimestart_time, // start date and time datetimestop_time, // end date and time double buffer[] // target array to copy
);
enter two variables of the 'datetime' type - in these variables you will store the time of the N-th fractal (for example, the time of the UP fractal number 5 and the time of the DOWN fractal number 5).
use third form CopyBuffer
ok thank you. i will correct that and give you feedback. Much grateful
atesz5870 #: I am trying too get into my array the fractals values, without zeros (like last lower fractal is the 0 in the array, 2. last is in 1 in the array....)
How is that? I don't get it.
Read the indicator buffer, remove the zeros.
int len = copyBuffer(…, buffer);
len = remove(buffer, 0, len, 0);
///////////////////////#define INDEX uinttemplate<typename T>
INDEX remove(T& arr[], INDEX iBeg, INDEX iEnd, const T& value){
INDEX oBeg = iBeg;
for(; iBeg != iEnd; ++iBeg){
if(!(arr[iBeg] == value) ) arr[oBeg++] = arr[iBeg];
}
return oBeg;
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please not just the current fractal but based on my analysis, i may need the 4th lower fractal or the 10th upper fractal or any fractal with a range between the current and the 20th fractals. i want to be able to change the fractal index in the alert function to any number between 0 and 20 e.g at anytime within the code. ALL I NEED IS A CODE THAT WOULD COUNT THE LOWER AND UPPER FRACTALS BACKWARDS TO THE 20TH AND ASSIGN THEM TO AN ARRAY. i hope you'd understand my illustration .THANK YOU
Yes, now I get it. You need:
Yes, now I get it. You need:
ok thank you. i will correct that and give you feedback. Much grateful
I am trying too get into my array the fractals values, without zeros (like last lower fractal is the 0 in the array, 2. last is in 1 in the array....)
How is that? I don't get it.
How is that? I don't get it.
Read the indicator buffer, remove the zeros.