Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 654

 
RRR5:
Can the EA look into the future?

I need the EA to take the last year's data, calculate the variance on it and then with the known variance value, have the EA test the last year in the tester.

Can. In the tester. Slapping a grail for the market and baiting rabbits?

And what will the EA do on current data?

 
Ghabo:

In the next cycle I check 3 fractals and write them into the variable f

The condition is complete: if the upper fractal is above the MA and the next lower fractal is below the MA, then from this upper fractal I compare three fractals with any price of the current bar.

With a normal fractal, the algorithm works correctly. With iFreeNumFractals, some fractals do not seem to be visible. How do I know why?

It's easier for you to look here - you'll get faster results.

 
Artyom Trishkin:

Can. In the tester. Slapping a grail for the market and baiting rabbits?

No. I just do not know how to do it.

I start testing. I have zero - the number of the current bar. How do I view the data for the whole year, so I can calculate the variance and then run the EA from the beginning of the year?

Artyom Trishkin:

And what will the EA do on the current data?

I set the dispersion coefficient manually in the EA.

It is just for testing purposes.


I don't want to write the script and the Expert Advisor separately. The script should calculate the variance and then run the Expert Advisor in the tester.
I would like to fit everything into one program.
 
RRR5: I do not want to write the script and the Expert Advisor separately. I want the script to calculate the variance and then run the Expert Advisor in the tester.
I want to fit everything in one program.

In that time, you can write a script and another script and an adviser and ... write

As for the essence of the question, you need to write an indicator that calculates the variance on the historical data, and once you have the variance values, you can use them in the EA, do not forget that the indicator helps to visualize the data

if you still stubbornly want to peep the EA into the historical data - the answer is no, in the tester is only available files in the folder tester, you can put in this folder files .hst and then you can read them with the EA from the tester

 
Artyom Trishkin:

You might find it easier to look here, it will give faster results.

Ailuromancy would be a good idea.)

The question is not about the essence and correctness of the algorithm, but about the fact that two equal, in my opinion, strings

        f_up=iFractals(Symbol(),0,MODE_UPPER,i_i);
        f_up=NormalizeDouble(iCustom(Symbol(),0,"iFreeNumFractals",1,2,2,2,2,0,i_i),Digits);

when put into the algorithm, produce different results. All variants with and without normalization have been tried.

If you have time, you can checkiFreeNumFractals indicatorhere

my craft here
 
Ghabo:

it's that the two lines are equivalent, in my opinion.

either they're not equivalent or you're having trouble seeing

unpinf_up andi_i, and the otherf_up andi_i

or use your formula: f_up=iFractals(Symbol(),0,MODE_UPPER,i_i);

indicator and compare it with the formula f_up=NormalizeDouble(iCustom(Symbol(),0,"iFreeNumFractals",1,2,2,2,0,i_i),Digits);

you need to visualize the error

HH: you can run the debugger and see the values in the variables

 
Igor Makanu:

you need to visualise the error

ZS: you can run the debugger and see the values of the variables

Visually, the fractals of the indicators coincide. Print by result, two out of five signals coincide and in three cases, one fractal iFreeNumFractals as if missing. I haven't used the debugger yet. What can I see in it?

 
Ghabo:

I haven't used the debugger yet. What can you see in it?

2. debugger

https://www.mql5.com/ru/articles/654

Отладка программ на MQL5
Отладка программ на MQL5
  • www.mql5.com
Эта статья ориентирована в первую очередь на программистов, которые уже изучили язык, но еще недостаточно освоились в разработке программ. В статье освещаются основные вопросы, с которыми приходится сталкиваться разработчику при отладке программы. Что же такое отладка? Отладка программы - это стадия разработки, в которой обнаруживают и...
 
Igor Makanu:

If you still want the EA to look at historical data, the answer is no
You will have to read the variance for the previous year in oninit and then use it in your EA.
 

Good afternoon!

Can you tell me if it is possible to create a script that, when dragged to a certain bar, would give its date? Is it possible to do this? If so, what function? Been reading the handbook and forums but haven't found anything so far. Give me an idea or direction. Thank you!