The average of the highest and lowest values in an array

 
Good morning everyone.
I would like to code an indicator based on the TSI that calculates the 2 threshold values (oversold / overbought) by averaging the 10 largest values in the last year (number of bars to set according to the TF) for the value of Overbought. Opposite for oversold, i.e. average of the 10 lowest values in the last year.

In this way we would have mobile overbought / oversold values based on the history of the cross in question.
 
Your topic has been moved to the section: Technical Indicators — Please consider which section is most appropriate — https://www.mql5.com/en/forum/443428#comment_49114884
 
  • Usually people who cannot code do not receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, as well as reference the online Documentation.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.
 
Arciere84: ) by averaging the 10 largest values in the last year (number of bars to set according to the TF)
  1. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
              No free help (2017)

  2. Instead of just using the n largest, you could also just keep a running power mean.
              How to trade "day" bar in Oanda data? - Expert Advisors and Automated Trading - MQL5 programming forum #4 (2023)
              Generalized mean - Wikipedia

 
Arciere84:
Good morning everyone.
I would like to code an indicator based on the TSI that calculates the 2 threshold values (oversold / overbought) by averaging the 10 largest values in the last year (number of bars to set according to the TF) for the value of Overbought. Opposite for oversold, i.e. average of the 10 lowest values in the last year.

In this way we would have mobile overbought / oversold values based on the history of the cross in question.

What if the highest 10 , or lowest 10 are in sequence ?