Announcement

Collapse
No announcement yet.

Creating an Indicator with Multiple Indicator Buffers for Newbies

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating an Indicator with Multiple Indicator Buffers for Newbies

    Introduction

    In my previous articles "Custom Indicators in MQL5 for Newbies" and "Practical Implementation of Digital Filers in MQL5 for Beginners" I focused in details on structure of the indicator with one indicator buffer.


    Obviously, such a method can be widely applied for writing custom indicators, but the real life can hardly be limited to their use, and thus it is time to approach more complex methods of building the indicator code. Fortunately, the capabilities of MQL5 are truly inexhaustible and are limited only by the RAM of our PCs.
    The Aroon Indicator as example of code doubling

    The formula of this indicator contains two components: the bullish and the bearish indicators, which are plotted in a separate chart window:

    BULLS = (1 - (bar - SHIFT(MAX(HIGH(), AroonPeriod)))/AroonPeriod) * 100
    BEARS = (1 - (bar - SHIFT(MIN (LOW (), AroonPeriod)))/AroonPeriod) * 100

    where:
    • BULLS - the Bull's strength;
    • BEARS - the Bear's strength;
    • SHIFT() - function of determining the index position of the bar;
    • MAX() - function of searching for the maximum over the AroonPeriod period;
    • MIN() - function of searching for the minimum over the AroonPeriod period;
    • HIGH() and LOW() - the relevant price arrays;

    Right from the formulas of the indicator, we can conclude that to construct an indicator, we must have only two indicator buffers, the indicator structure will differ very little from the structure of the SMA_1.mq5, considered in the previous article.

    Read more - Creating an Indicator with Multiple Indicator Buffers for Newbies

  • #2
    How does this work. What does it tell me? when constructing the indicator how can i make it so its not a lagging indicator. is that determined by my datafeed? inquiring minds want to know

    Comment


    • #3
      The developing indicator completely depend what it should visualize and how it should be calculated. Based on that indicator could be lagging or not. Anyway, it does not depend on the datafeed.

      Comment

      Disclaimer: There is a risk of loss in trading futures, forex and options. Futures, forex and options trading are not appropriate for all investors. Only risk capital should be used when trading futures. All information is for educational use only and is not investment advice. Past performance is not indicative of future results.

      This website is hosted and operated by AMP Global Clearing, LLC ("AMP"), which provides brokerage services to traders of futures and foreign exchange products. This website is intended for customer support, educational and informational purposes only and should NOT be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by AMP and the information made available on this Web site is NOT an offer or solicitation of any kind. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of AMP.

      All Users and Contributors along with their websites, products and services, are independent persons or companies that are in no manner affiliated with AMP. AMP is not responsible for, do not approve, recommend or endorse any User and/or Contributor Content referenced on this website and it’s your sole responsibility to evaluate All Content. Please be aware that any performance information provided by a user and/or contributor should be considered hypothetical.

      HYPOTHETICAL PERFORMANCE RESULTS HAVE MANY INHERENT LIMITATIONS, SOME OF WHICH ARE DESCRIBED BELOW. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. IN FACT, THERE ARE FREQUENTLY SHARP DIFFERENCES BETWEEN HYPOTHETICAL PERFORMANCE RESULTS AND THE ACTUAL RESULTS SUBSEQUENTLY ACHIEVED BY ANY PARTICULAR TRADING PROGRAM.

      ONE OF THE LIMITATIONS OF HYPOTHETICAL PERFORMANCE RESULTS IS THAT THEY ARE GENERALLY PREPARED WITH THE BENEFIT OF HINDSIGHT. IN ADDITION, HYPOTHETICAL TRADING DOES NOT INVOLVE FINANCIAL RISK, AND NO HYPOTHETICAL TRADING RECORD CAN COMPLETELY ACCOUNT FOR THE IMPACT OF FINANCIAL RISK IN ACTUAL TRADING. FOR EXAMPLE, THE ABILITY TO WITHSTAND LOSSES OR TO ADHERE TO A PARTICULAR TRADING PROGRAM IN SPITE OF TRADING LOSSES ARE MATERIAL POINTS WHICH CAN ALSO ADVERSELY AFFECT ACTUAL TRADING RESULTS. THERE ARE NUMEROUS OTHER FACTORS RELATED TO THE MARKETS IN GENERAL OR TO THE IMPLEMENTATION OF ANY SPECIFIC TRADING PROGRAM WHICH CANNOT BE FULLY ACCOUNTED FOR IN THE PREPARATION OF HYPOTHETICAL PERFORMANCE RESULTS AND ALL OF WHICH CAN ADVERSELY AFFECT ACTUAL TRADING RESULTS.

      AMP has NOT endorsed or recommended the use any product, services offered by any 3rd party User or Contributor on this forum. No person employed by, or associated with, AMP is authorized to provide any information about any 3rd party User or Contributor content. All specific brokerage related questions should be directed towards AMP.

      Copyright © 2017. All rights reserved.

      Working...
      X