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

 
evillive:
The way I see it, if an EA works on a new candle opening (there is a check for a new candle appearing in the code), then testing results on the "open prices only" model should be close to results of testing on the "all ticks" model, or am I mistaken?

All Expert Advisors are different. I have some Expert Advisors that have practically no difference in results of these two types of testing. Others have a big difference. Again, it very much depends on TF. Sometimes results on M1-M15 are the same but above that the difference starts. For example, if you set TP and SL in points, but not on the condition of a high day or low day, then the difference between these two methods of testing will be very big. Make a test run with different methods and look at the difference, if it is not considerable, then test on openings. But the final conclusion about the Expert Advisor is done on all ticks.
 
Question for a puzzle. Is there any way to find out the number of digits in a number?
 
tuner:
Question for a puzzle. Is there any way to find out the number of digits in a number?

Take your pick. Convert to µl - algorithms in pascal. There is a choice of options...
 
I also have a question for you. How do I know by code that there is a powerful trend? The size in pips of the candle also fits, but in the momentum is only one part powerful (beginning, middle or end) how to identify the entire momentum? Any ideas?
 
_Roman:

Choose according to taste. Translate to µl - algorithms in pascal. There's a choice of options...

thanks
 
001:

All Expert Advisors are different. Some Expert Advisors have practically no difference in results using these two types of testing. Others have a big difference. Again, it very much depends on TF. Sometimes results are the same on M1-M15 and then the difference starts to grow. For example, if you set TP and SL in points, but not on the condition of a high day or low day, then the difference between these two methods of testing will be very big. Make a test run with different methods and look at the difference, if it is not considerable, then test on openings. But the final conclusion about the Expert Advisor is done on all ticks.

Actually, I want to know why there is this difference, if the EA should not do anything before the opening of a new candle, no matter how many ticks are there. There is a test, a classic one, I don't know how correct it is, but I've seen exactly the same one most often:

static datetime prevtime = 0;

int init()
  {
   prevtime = Time[0];
   return(0);
  }
        
int start()
  {
    if(Time[0] == prevtime) return(0);//ждем появления нового бара
    else  prevtime = Time[0];//если появился новый бар, начинаем работу
...
много кода, который должен выполняться только на открытии...
...
   return(0);
  }


The selection of parameters for the "all ticks" model can take weeks, and then the results of testing on these parameters do not coincide with work in real time, nor with testing on opening prices. And vice versa, testing results obtained using the parameters adjusted to open prices do not coincide and sometimes even radically differ from the results obtained using the same parameters but at all ticks. I use indicators with open prices for which I cannot set the price - I take their values at the previous candle's close. TP and SL values are set to 0, they should not affect the result, I do not use trailing stops, I close profit/loss by percentage of balance, again by opening a new candle.

 

I'm not sure I'm in the right place, but I couldn't find another thread.

MQL4 documentation: MQL4 Reference Language Fundamentals Operators

No jump to the while loop statement

Immediately jump to the do while loop statement

 
sable:

I'm not sure I'm in the right place, but I couldn't find another thread.

MQL4 Docs: MQL4 Basics Reference Operators

No jump to the while loop statement

Immediately you are redirected to the do while loop statement


This is a Service Desk web site and they should rip ear off the web site programmers )

ME's help is correct, it is updated more often than the site, I advise to use help.

 
evillive:

Actually, I want to know why there is this difference, if the EA should not do anything before the opening of a new candle, no matter how many ticks are there. There is a test, a classic one, I don't know how correct it is, but I've seen exactly the same one most often:


The selection of parameters for the "all ticks" model can take weeks, and then the results of testing on these parameters do not coincide with work in real time, nor with testing on opening prices. And vice versa, testing results obtained using the parameters adjusted to open prices do not coincide and sometimes even radically differ from those obtained using the same parameters but at all ticks. I use indicators with open prices for which I cannot set the price - I take their values based on the previous candle's close. TP and SL are set to 0, they should not affect the result, I do not use trailing stops, I close profit/loss by percentage of balance, again by opening a new candle.

In each case we need to look at opening and closing conditions , and then it will be clear why there is a difference. For example. If we set TP of +5 pips and do not set a SL, we will get a grail on TF higher than M5 if we test on openings and if we don't check the candle opening, well, you probably know it without me. There is an imperfection of the tester and imperfection of the algorithm. In my experience, I've drawn the following conclusion - what you write is what you get. That is, the algorithm is often not more perfect than the tester. The difference is mainly due to the fact that if we test on openings, but within this candle there are ticks which may affect the opening and closing of the position, but they aren't taken into account in the Expert Advisor, then there will be a difference.
 
001:
In each case you have to look at the opening and closing conditions of the position, then it will be clear why there is a difference. For example. If we set TP of +5 pips and do not set SL, we will get a grail on TF higher than M5 if we test it on openings and if we do not prescribe control of a candle opening, well, you probably know it without me. There is an imperfection of the tester and imperfection of the algorithm. In my experience, I've drawn the following conclusion - what you write is what you get. That is, the algorithm is often not more perfect than the tester. The difference is usually due to the fact that if we test on openings, but within this candle there are ticks that may affect the opening and closing of a position, but they are not taken into account in the Expert Advisor, then there will be a difference.

I wrote - TP=0, SL=0, all open/close conditions are only tested when a new candle opens, check above. Is it even correct? Vinin once confirmed that such a check works. I'm testing on M15, H1, it still doesn't match. That's why I want to make a robot on opening prices, to discard the tester's imperfect tick simulator.