Find average value over number of bars? - page 6

 
Dominik Christian Egert #: ... given the fact, an example was asked for "find the average value of the Close price minus the Open prices over the past x number of bars", which is not easily possible with the built-in functions

It is easy! Save the "close - open" in a buffer and apply the iMAOnArray. That simple!

Or if you prefer to use "MovingAverages.mqh", then the functions "SimpleMA" or "SimpleMAOnBuffer" can be used, irrespective of their efficiency.

Remember that the question is about a custom Indicator.

 
Fernando Carreiro #:

It is easy! Save the "close - open" in a buffer and apply the iMAOnArray. That simple!

Or if you prefer to use "MovingAverages.mqh", then the functions "SimpleMA" or "SimpleMAOnBuffer" can be used, irrespective of their efficiency.

Remember that the question is about a custom Indicator.

Yes. That's true.


 
Fernando Carreiro #:

It is easy! Save the "close - open" in a buffer and apply the iMAOnArray. That simple!

Or if you prefer to use "MovingAverages.mqh", then the functions "SimpleMA" or "SimpleMAOnBuffer" can be used, irrespective of their efficiency.

Remember that the question is about a custom Indicator.

Great answer - thanks!

 
Good.

A technical forum, this is... Haha.

As far as I see, and understand, it seems my contribution to the original question is not wanted, not to mention appreciated.

Further more, I would see the closing statements here as a disqualification of the solution I have offered.

In future I won't contribute solutions. It is a waist of time on my side.
 
@Dominik Christian Egert #: Good. A technical forum, this is... Haha. As far as I see, and understand, it seems my contribution to the original question is not wanted, not to mention appreciated. Further more, I would see the closing statements here as a disqualification of the solution I have offered. In future I won't contribute solutions. It is a waist of time on my side. Your solution has merit but just not for this case!

For one, the OP does not have the coding skill or the maths knowledge to understand your solution, nor does he require it, given that the "efficiency" factor is not a requirement for this case.

Yes, it is true that your O(1) solution is indeed helpful when processing Tick Data, or when speed is a priority. However, an SMA is not ideal for that. That is where EMA is much better and faster for those cases, even when using an SMA with O(1).

Your code will indeed be helpful to someone, but probably not on this thread. Let's just say that it is a good solution but for the wrong problem 😅.

 
Dominik Christian Egert #:
Good.

A technical forum, this is... Haha.

As far as I see, and understand, it seems my contribution to the original question is not wanted, not to mention appreciated.

Further more, I would see the closing statements here as a disqualification of the solution I have offered.

In future I won't contribute solutions. It is a waist of time on my side.

Seems like you have a desperate need for recognition and accolade - its about helping others and not expecting anything in return.

No need to take things so personally - its about collaboration rather than competition.

 
Dominik Christian Egert #:
So in some future, when you gain access to some quantum computer, you might (although I highly doubt that) figure out a method on how you can solve this more efficient.


And BTW no need to mock - my son is leading efforts in quantum computing at his University in California, so if it were relevant, I could get access... 

But heck why would one waste time solving a trivial matter like this? Over and out