Example of creating an indicator based on iATR. Part 5.
code: xSuperTrend.mq5
Until this moment, we performed preparatory operations. Now it is time to write the indicator logic.
To avoid unnecessary calculations, we always work in the 'prev_calculated' variable
Remember that the indicator already has all arrays by the current character (ope, high, low, close, and others) - they are transferred through OnCalculate.
Save the version number 1.005
The end.
Hello thank you for your work but after wroting that i become array out of range for the atrbuffer
The main objective of this article is to guide beginners to learn how to design their algorithmic trading system in MQL5 through learning some of the basics of MQL5 for a simple trading system idea which will be coded step by step through this article after explaining some of the MQL5 basics. We'll code them by scripts then we'll present the result after code execution. To enhance your understanding, I advise you to apply and code what you’ll read here by yourself as this will help you to understand concepts of mentioned codes deeply. And be noted that all created codes, programs, and trading strategies in this article are designed for educational purposes only, not for anything else. And be noted that we'll use MQL5 to write codes.
This article shows the basics of MQL for beginners to design their Algorithmic trading system (Expert Advisor) through designing a simple algorithmic trading system after mentioning some basics of MQL5
It is not hidden by anyone in the financial market field, the importance of time, and how it can affect trading decisions and results. MQL5 (MetaQuotes Language 5) offers an amazing solution to deal with date and time effectively and this is what we will learn in this article because we will see how we can deal with this important topic through many applications that can be coded as a part of our trading system after understanding the most important aspects of this topic in the MQL5 programming language.
A new article about a new important topic which is dealing with date and time. As traders or programmers of trading tools, it is very crucial to understand how to deal with these two aspects date and time very well and effectively. So, I will share some important information about how we can deal with date and time to create effective trading tools smoothly and simply without any complicity as much as I can.
MQL5 is the programming language of the MetaTrader 5 which is considered the most popular trading platform and it is very rich in tools and concepts that can be used to create any trading system from its simple to complex. Our objective as developers is to understand how to use these tools and concepts to achieve our development objective.
In this article, we will mention and dive deeper to learn more about variables and data types in MQL5 and how they can be useful when creating or building MQL5 trading software. We will learn more about some advanced concepts of variables and data types ...
Variables and data types are very important topics not only in MQL5 programming but also in any programming language. MQL5 variables and data types can be categorized as simple and advanced ones. In this article, we will identify and learn about advanced ones because we already mentioned simple ones in a previous article.
Without any prior programming experience, learning MQL5 can be difficult but not impossible. Understanding MQL5, a specialized language created for algorithmic trading, necessitates having both programming and financial market expertise.
In this article, we will cover the following topics:
Welcome back to our MQL5 journey! In Part One, we embarked on the adventure of algorithmic trading, breaking down the complexities of MQL5 for beginners without prior programming experience. As we step into Part Two, the excitement continues as we delve even deeper into the essential building blocks of MQL5. Our goal is simple yet profound: to ensure everyone, regardless of their programming background, feels the embrace of understanding. Feel free to ask any questions, and let's unravel the intricacies of MQL5 together. Let's forge a community where every voice is heard and every journey in algorithmic trading is shared.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Example of creating an indicator based on iATR. Part 5.
code: xSuperTrend.mq5
Until this moment, we performed preparatory operations. Now it is time to write the indicator logic.
To avoid unnecessary calculations, we always work in the 'prev_calculated' variable
Remember that the indicator already has all arrays by the current character (ope, high, low, close, and others) - they are transferred through OnCalculate.
Save the version number 1.005
The end.
Example: catching a Take Profit trigger
The code: Last Deal Take Profit activation.mq5
An example of online work (via OnTradeTransaction).
'm_deal' - undeclared identifier. Does not work.
m_deal.InfoInteger(DEAL_REASON,deal_reason)
m_deal.InfoInteger(DEAL_REASON,deal_reason)returns a boolean, so your comparison is incorrect.
'm_deal' - undeclared identifier. Does not work.
ignore.
thank you for posting very usefull code , i am learning a lot.
I have a question. Would you consider these two functions adequate to count pending orders and open positions by magic and symbol ?
Thank you for your time and patience. Hope you are well and life is treating you good.
Learn Why and How to Design Your Algorithmic Trading System
Learn how to deal with date and time in MQL5
Advanced Variables and Data Types in MQL5
MQL5 is the programming language of the MetaTrader 5 which is considered the most popular trading platform and it is very rich in tools and concepts that can be used to create any trading system from its simple to complex. Our objective as developers is to understand how to use these tools and concepts to achieve our development objective.
In this article, we will mention and dive deeper to learn more about variables and data types in MQL5 and how they can be useful when creating or building MQL5 trading software. We will learn more about some advanced concepts of variables and data types ...In this article, we will cover the following topics:
Introduction to MQL5 (Part 2): Navigating Predefined Variables, Common Functions, and Control Flow Statements