Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 806

 
bescom:

Guys, thanks for wanting to help, but I figured it out on my own. Variables were declared in the EA in this way, even though it is not required:

Why this was deemed acceptable by the compiler for a couple of months and then suddenly became a crime as of lunchtime today is the question. True, mt4 was being updated today, probably something did change in the syntax.
So why was it necessary to declare reserved words as variables! See Documentation to avoid such bloopers! And the compiler has become stricter, which helps us not to make mistakes!
 
borilunad:
Why would you declare reserved words as variables?!
Well, I'm a novice proger...
 
bescom:
Well, I'm a novice proger...
So start with the Tutorial, Documentation etc. without wasting precious time!
 
Hey, guys. I have this question. Is it possible, using M5, to determine the highs and lows of the last five days? And if so, how do I do it correctly? This is the third day.
 
Veterros:
Folks. I have this question. Is it possible, using M5, to determine the highs and lows of the last five days? And if so, how should it be done? It's the third day I'm racking my brain.

If you are using the M5 chart, you can check the extremes of the last five days like this:

  double high = iHigh(NULL,D1,iHighest(NULL,D1,MODE_HIGH,5,1));
  double low = iLow(NULL,D1,iLowest(NULL,D1,MODE_LOW,5,1));
// или каждого дня
  double high1 = iHigh(NULL,D1,1);
  double high2 = iHigh(NULL,D1,2);
  double high3 = iHigh(NULL,D1,3);
  double high4 = iHigh(NULL,D1,4);
  double high5 = iHigh(NULL,D1,5);
  double low1 = iLow(NULL,D1,1);
  double low2 = iLow(NULL,D1,2);
  double low3 = iLow(NULL,D1,3);
  double low4 = iLow(NULL,D1,4);
  double low5 = iLow(NULL,D1,5);
 
This is using D1, but when you run it in the tester, these values will not be correct, as I know. That's why the question sounds exactly like "using M5". Is there any way to use the date or day of the week? Or am I mistaken about using two TFs in the tester?
 
Veterros:
This is using D1, and when you run it in the tester, these values will not be correct as I know it. That's why the question sounds exactly like "using M5". Is there any way to use the date or day of the week? Or am I mistaken about using two TFs in the tester?
You are wrong! You can use all TFs taking necessary data from them! But in the tester, it would be better to set a smaller TF to better model ticks and/or bars, which is better for testing and optimization!
 
borilunad:
You are wrong! You can use all TFs and take all needed data from them! But in the tester it is better to set a smaller TF, so that ticks and/or bars would be better simulated, which is better for testing and optimization!
 

If I understand correctly, if the Expert Advisor performs all operations on M5, but needs the above data for the calculation, then the function using D1 will work correctly when optimised in the tester on M5?

 
borilunad:

Thank you very much! Checked through Comment, it works! I must have misunderstood the information about using multiple TFs in the tester.