Announcement

Collapse
No announcement yet.

Mql5 cookbook: Handling custom chart events

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

  • Mql5 cookbook: Handling custom chart events

    Introduction

    This article is a logical continuation of the article MQL5 Cookbook: Handling Typical Chart Events. It covers methods of work with custom chart events. Here the reader can find examples of developing and handling of custom events. All the ideas discussed in this article were implemented with object-oriented tools.

    As the theme of custom events is rather broad, it is the case when a programmer and developer can introduce creativity to their work.


    1. Custom Chart Event

    It is clear that this event is defined by the user. It is up to a programmer to decide what exactly and which task or a program block could take the form of an event. The MQL5 developers can create their own events, which expands the language capabilities for implementation of complex algorithms.

    A custom event is the second possible type of a chart event. The first one is a typical event. Although there is no such a term as "typical chart event" in the Documentation, I still suggest using it for the first ten types of chart events.

    The developers suggest only one enumeration for all chart events—ENUM_CHART_EVENT.

    Read more - MQL5 COOKBOOK: HANDLING CUSTOM CHART EVENTS


  • #2
    MT-MC This program block can be created to resemble key events such as tommorows FOMC release at 1:15 pm est I imagine by going back to charts around similar events in the past you could create a block that would behave the way a market did around that time and set parameters that it hit. Using market memory as the building block for program. Example if over the last 4 FOMC meetings the ES gyrated x amount points then at the release it came back to certain points before continuing higher or lower....those parameters can be built into a block and then executed. Is this the approach as I understand it?

    Comment


    • #3
      CollinPalmer
      It is something that could be used. To use it the calendar should be applied on the chart and the chart objects should be analyzed to find for example, FOMC release or NFP. The next function could be used to extract news events from the charts objects:

      void ProcessCalendar() {
      long cid=ChartID();
      int ot=ObjectsTotal(cid,0,OBJ_EVENT);
      if (ot>0) {
      ArrayResize(TimeCalendar,ot+1);
      }

      for(int i=0;i<ot;i++)
      {
      string name=ObjectName(cid,i,0,OBJ_EVENT);
      //Print(name,": ",ObjectGetString(cid,name,OBJPROP_TEXT));
      //Print("Date:",StringSubstr(name,0,16));
      TimeCalendar[i]=StringToTime(StringSubstr(name,0,16));
      }
      }

      Comment


      • #4
        Very cool thanks for posting the string to set this up. Anyone out there want to take a stab at this and post results? PM me and let me know

        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