This is a discussion on Metatrader 5 / Metatrader 4 for MQL5 / MQL4 articles preview within the General Discussion forums, part of the Trading Forum category; Contents Introduction Methods for Opening New Positions and Managing Existing Ones Trading Modes of a Strategy CTradeState Trading Mode Switch ...
Contents
- Introduction
- Event Model Based on Centralized Processing, ENUM_MARKET_EVENT_TYPE
- Access to Events Occurring on Other Instruments, the MarketEvent Structure
- The "New Bar" Event. New Tick and Bar Detection Algorithms
- The CPositionMT5 class — Basis of the Platform-Independent Algorithm
- Trading Strategy Prototype — the CStrategy Class
- Conclusion
more...
Table of Contents
- Introduction
- 1. Generally accepted method of evaluating the RSI indicator
- 2. Area method
- 3. RSIAreaIndicator_v1
- 3.1. Creating a draft for an indicator
- 3.2. Filling the indicator header line
- 3.3. Editing the indicator's OnInit() function
- 3.4. Creating the additional indicator function
- 3.5. Creating the main operation code of the indicator
- 4. RSIAreaExpert version 1.00 — Expert Advisor
- 4.1. Editing the Expert Advisor's header line
- 4.2. Additional function — RSIAreaFunc
- 4.3. Code for testing CopyBuffer
- 4.4. Further editing of the additional function
- 4.5. Expert Advisor's OnTick() function
- 5. Testing RSIAreaExpert version 1.00 on different periods and symbols
- Conclusion
- Reference list
more...
The MetaTrader 5 platform was originally designed for trading within the netting position accounting system. The netting system allows having only one position per financial instrument meaning that all further operations at that instrument lead only to closing, reversal or changing the volume of the already existing position. In order to expand possibilities of retail Forex traders, we have added the second accounting system — hedging. Now, it is possible to have multiple positions per symbol, including oppositely directed ones. This paves the way to implementing trading strategies based on the so-called "locking" — if the price moves against a trader, they can open a position in the opposite direction.
Since the new system is similar to the one used in MetaTrader 4, it will be familiar to traders. At the same time, traders will be able to enjoy all the advantages of the fifth platform version — filling orders using multiple deals (including partial fills), multicurrency and multithreaded tester with support for MQL5 Cloud Network, and much more.
Now, you can use one account to trade the markets that adhere to the netting system and allow having only one position per instrument, and use another account in the same platform to trade Forex and apply hedging.
This article describes the netting and hedging systems in details, as well as sheds light on the changes related to the implementation of the second accounting system.
more...
Contents
- Introduction
- Private Arrays of the Elements
- Managing the State of the Chart
- Identifiers for External and Internal Use
- Enriching the Class of the Context Menu
- Enriching the Class of the Menu Item
- Enriching the Main Class of Handling Events of the Graphical Interface
- Preliminary Test of Event Handlers
- Test of Several Context Menus and Fine Adjustment
- Test of Receiving Messages in the Custom Class of the Application
- Conclusion
more...
Contents
- Introduction
- Logs, CMessage and CLog Classes, Singleton Pattern
- Accessing Quotes Using Indexes from MetaTrader 4
- Using Object-Oriented Indicators
- Methods to Be Overridden by the Custom Expert Advisor
- Example of Expert Advisor Trading Two Moving Averages
- Example of Expert Advisor Based on Breakthrough of the BollingerBands Channel
- Loading Custom Strategies to the Trading Engine
- Conclusion
more...
It has been argued that technical analysis is both science and art. The reason behind this duality lies in individual points of view of various traders and analysts. For example, the exact same trend line can be drawn completely differently. Such uncertainty is frowned upon in commodities trading where accuracy is the key. Any trader who ever attempted to generate a trend line and discovered that there are few ways to do it, has encountered this problem. Such disorder doesn't contribute to the creation of accurate trading systems that could analyze markets with trend lines. There are some other problems caused by this multiplicity: discrepancy when searching for a local extremum, divergence and convergence based on a trend line that wasn't properly constructed etc.
more...
Introduction
It is common knowledge that a market price direction may be expressed, thus indicating a trend in the chart, or, in fact, absent, signifying that it is flat. It is considered that technical indicators that belong to the group of oscillators operate efficiently when trading is flat. However, a certain range for price fluctuation may exist also when trends appear.
In this article, I will attempt to enlighten a dynamic way of building equidistant channels, frequently named as sliding channels. It should be noted that one of the most popular strategies for such channels is a strategy of Victor Barishpolts. We will touch upon those aspects of his strategy that are connected with the rules of creating sliding channels. Also, we will attempt to extend these rules, that, in the author's opinion, would increase the flexibility of the channel system.
more...
Too Many Parameters to Optimize.
A trading-EA with many indicators each with many parameters will need a lot of time for its optimization as there will be way too many combinations to test. What if we were able to reduce this amount of combinations before we start the optimization of the trading-EA? In other words before coding the trading-EA we code a pseudo-EA that asks only a specific questions to the market. We split a big problem into smaller ones and solve them separately. This pseudo-EA doesn't trade! As an example we choose the ADX and check this indicator whether it is capable to distinguish between flat and trend markets and maybe we gain some additional information.
more...
Bookmarks