When does it make sense to keep part of the robot code in an indicator? - page 24

 
Vinin:

I gave the logic of a workable algorithm. It didn't work. I'm sorry I didn't get through.

You tell me the error in the code, not your vision of the correct algorithm. You say there's an error. Then you know exactly where it is located. Why is it so hard to show the location (which you have already defined) in 10 lines of code?
 
TheXpert:
No, the price will already be on a new bar. This is perfectly visible when the terminal is switched on. In the beginning the bar looks like a point.

I told you about the REAL conditions. An EA with an indicator will also get an incorrect EMA value as long as there are no bars.

If we are talking about REAL conditions of adequate use of the EA, then the gap of 10 minutes will absolutely be taken into account.

 
hrenfx:

You point out the error in the code to me, not your vision of the correct algorithm. You say there is an error. So you know exactly where it is located. Why is it so hard to show you the location (which you have already defined) in 10 lines of code?


You cannot operate with time. You can only operate with the number of current bars and the number of bars processed. If their difference is greater than 1, then full recalculation. If it is equal to 1, calculation of the first and the second bar. If it is equal to zero, then only the zero bar.

There is nothing complicated about it. I just repeated the algorithm for the correct calculation. I don't want to give you the calculation itself. There is no sense in it. If there is no desire to try to do such a thing, then there is no need. And there is no sense in discussing it any further.

 
hrenfx:

I told you about the REAL conditions. An EA with an indicator will get exactly the same incorrect EMA value as long as there are no bars.

Yes, but if in the indicator the values are corrected as soon as the bars come in, then in your version the values will be incorrect during the number of bars equal to the width of the EMA window.
 
Vinin:


You can't operate on time. You can only operate on the number of current bars and the number of bars processed. If their difference is greater than 1, then full recalculation. If it is equal to 1, then the calculation of the first and the second bar. If equal to zero, then only the zero bar.

I don't understand what you are saying, about not being allowed. I gave you a specific example with a disconnect. In this example, I have shown you that the calculation will be correct. What's not to like? I showed you an example, I showed you that the gap will be taken into account. But now you are saying that it cannot be done that way. The result is correct, but you say you can't.

 
TheXpert:
Yes, but while the values in the indicator will correct as soon as the bars come in, in your version the values will be wrong for the number of bars equal to the width of the EMA window.
  1. Yes, everything will be corrected in the indicator. True, the EA will get the wrong values before the correction and will have a chance to "screw up". But again, I'm talking about REAL conditions. You run the Expert Advisor only when you are sure that the entire history is downloaded. And my Expert Advisor will react to brief connection failures perfectly correctly. You know perfectly well that the problem of identification of the full download of the history was not solved by the developers, even though they were asked about it many times.
  2. If the DC draws "left" bars, the indicator will be recalculated and will give "left" values to the Expert Advisor. This will not happen in the "all-in-one" variant. It should be understood that we are talking about choosing one of the evils. As the developers have ignored the obvious problem. And I keep saying that adequate REAL is being considered. You know perfectly well as a practitioner what that is.
  3. There is no window in the EMA. It is an exponential average.

P.S. About the IndicatorCounted() implementation. In MT4 there are no buffers keeping track of it. There is just a hash function whose value is indirectly used in IndicatorCounted(). Whenever the history is changed, the hash function changes the value. Anyone can write a simple hash function that will track changes in the history.

 
Cut the crap.
 
And the EMA has a window!
 
Integer:
Cut the crap.

Learn how to argue.
 
Integer:

I'm sorry, but explaining anything to you is a very unfortunate task.

So I bid you farewell with a brush...

And by the way, where's your promised version of the Expert Advisor to be hooked up to the indicator? I can't find it anywhere.

The discussion goes in the wrong direction because the problem of connection and history swapping is not discussed here, but performance measurement of any random input data through the indicator and directly in the code.