WorstCases:
Hello Folks,
[....]
2nd: I wonder if this code could be written smarter. It seems to be very much code for a simple task. Let's just say I want to get the lows for 50 hours.
1) use a for loop for(;;)
2) i think u should start with iLow(Symbol(),PERIOD_H1,0); (or maybe u don't want the current hour low)
WorstCases:
1st: Use an external variable in the brackets [], instead of the 24, so that I can set the desired period for the calculation (like 12 hours as an example). But changing out the 24 with a variable does not work as I was hoping.
2nd: I wonder if this code could be written smarter. It seems to be very much code for a simple task. Let's just say I want to get the lows for 50 hours.
int start = 1; // input int end = 24; // parameters double MyArray_Prev24Low[]; // Output int length = end - start + 1; ArrayResize(MyArray_Prev24Low, length); for(int index = 0; start <= end; start++, index++) MyArray_Prev24Low[index]=iLow(Symbol(), PERIOD_H1, start);

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
Hello Folks,
I know to you all it must not sound like much, but for me it is another step on the programming ladder.
Current status: This array is giving me the lows of a 24hr period.
What I want to archieve:
1st: Use an external variable in the brackets [], instead of the 24, so that I can set the desired period for the calculation (like 12 hours as an example). But changing out the 24 with a variable does not work as I was hoping.
2nd: I wonder if this code could be written smarter. It seems to be very much code for a simple task. Let's just say I want to get the lows for 50 hours.
Thanks for looking into this.
WorstCases