MetaTrader 5 Python User Group - the summary - page 34

 

Quantitative approach to risk management: Applying VaR model to optimize multi-currency portfolio using Python and MetaTrader 5

Quantitative approach to risk management: Applying VaR model to optimize multi-currency portfolio using Python and MetaTrader 5

Value at Risk (VaR) has become the cornerstone of my research into market risk. Years of practice in Forex have convinced me of the power of this instrument. VaR answers the question that torments every trader: how much can you lose in a day, week or month?

Quantitative approach to risk management: Applying VaR model to optimize multi-currency portfolio using Python and MetaTrader 5
Quantitative approach to risk management: Applying VaR model to optimize multi-currency portfolio using Python and MetaTrader 5
  • www.mql5.com
This article explores the potential of the Value at Risk (VaR) model for multi-currency portfolio optimization. Using the power of Python and the functionality of MetaTrader 5, we demonstrate how to implement VaR analysis for efficient capital allocation and position management. From theoretical foundations to practical implementation, the article covers all aspects of applying one of the most robust risk calculation systems – VaR – in algorithmic trading.
 

Feature Engineering With Python And MQL5 (Part IV): Candlestick Pattern Recognition With UMAP Regression

Feature Engineering With Python And MQL5 (Part IV): Candlestick Pattern Recognition With UMAP Regression

Candlestick patterns are widely used across many different trading strategies and styles by most algorithmic traders in our community. However, our understanding of these patterns is limited to the candlesticks that we have uncovered, while in truth there may be many other profitable candlestick patterns we are simply not aware of yet. Due to the wealth of information covering most modern markets, it is materially challenging for traders to be confident that they are always using the most reliable candlestick patterns available to them in their chosen market.
Feature Engineering With Python And MQL5 (Part IV): Candlestick Pattern Recognition With UMAP Regression
Feature Engineering With Python And MQL5 (Part IV): Candlestick Pattern Recognition With UMAP Regression
  • www.mql5.com
Dimension reduction techniques are widely used to improve the performance of machine learning models. Let us discuss a relatively new technique known as Uniform Manifold Approximation and Projection (UMAP). This new technique has been developed to explicitly overcome the limitations of legacy methods that create artifacts and distortions in the data. UMAP is a powerful dimension reduction technique, and it helps us group similar candle sticks in a novel and effective way that reduces our error rates on out of sample data and improves our trading performance.
 

Finding custom currency pair patterns in Python using MetaTrader 5

Finding custom currency pair patterns in Python using MetaTrader 5

The idea was to study a lot of historical data using an algorithm that would find repeating patterns and evaluate their performance. Sounds interesting? In reality, the implementation turned out to be not so simple.
Finding custom currency pair patterns in Python using MetaTrader 5
Finding custom currency pair patterns in Python using MetaTrader 5
  • www.mql5.com
Are there any repeating patterns and regularities in the Forex market? I decided to create my own pattern analysis system using Python and MetaTrader 5. A kind of symbiosis of math and programming for conquering Forex.
 

High frequency arbitrage trading system in Python using MetaTrader 5

High frequency arbitrage trading system in Python using MetaTrader 5High frequency arbitrage trading system in Python using MetaTrader 5

Let's sum it up. We have created a system that looks for arbitrage opportunities. Remember that the system does not solve all your financial problems. 

We have sorted out backtesting. It works with time-based data, and even better, it allows us to see how our system would have worked in the past.

High frequency arbitrage trading system in Python using MetaTrader 5
High frequency arbitrage trading system in Python using MetaTrader 5
  • www.mql5.com
In this article, we will create an arbitration system that remains legal in the eyes of brokers, creates thousands of synthetic prices on the Forex market, analyzes them, and successfully trades for profit.
 

Economic forecasts: Exploring the Python potential

Economic forecasting is a rather complex and labor-intensive task. It allows us to analyze possible future movements using past data. By analyzing historical data and current economic indicators, we can speculate on where the economy might be heading. This is a pretty useful skill. With its help, we can make more informed decisions in business, investments, and economic policy.

We will develop this tool using Python and economic data from collecting information to creating predictive models. It will analyze and also make predictions for the future.

Economic forecasts: Exploring the Python potential
Economic forecasts: Exploring the Python potential
  • www.mql5.com
How to use World Bank economic data for forecasts? What happens when you combine AI models and economics?
 

Building MQL5-Like Trade Classes in Python for MetaTrader 5

Building algorithmic trading systems in the MQL5 programming language has been made easier with Standard Libraries that come preloaded in MetaEditor. These modules (libraries) come with functions and variables that simplify the process of opening, validating, closing the trades, etc.

Without these dependencies, it becomes harder to write even a simple program, such as making a simple script for opening a buy position (trade).

Building MQL5-Like Trade Classes in Python for MetaTrader 5
Building MQL5-Like Trade Classes in Python for MetaTrader 5
  • www.mql5.com
MetaTrader 5 python package provides an easy way to build trading applications for the MetaTrader 5 platform in the Python language, while being a powerful and useful tool, this module isn't as easy as MQL5 programming language when it comes to making an algorithmic trading solution. In this article, we are going to build trade classes similar to the one offered in MQL5 to create a similar syntax and make it easier to make trading robots in Python as in MQL5.
 

Data Science and ML (Part 42): Forex Time series Forecasting using ARIMA in Python, Everything you need to Know

Data Science and ML (Part 42): Forex Time series Forecasting using ARIMA in Python, Everything you need to Know

Time series forecasting is the process of using past data to predict future values in a sequence of data points. This sequence is typically ordered by time, hence the name time series.

Data Science and ML (Part 42): Forex Time series Forecasting using ARIMA in Python, Everything you need to Know
Data Science and ML (Part 42): Forex Time series Forecasting using ARIMA in Python, Everything you need to Know
  • www.mql5.com
ARIMA, short for Auto Regressive Integrated Moving Average, is a powerful traditional time series forecasting model. With the ability to detect spikes and fluctuations in a time series data, this model can make accurate predictions on the next values. In this article, we are going to understand what is it, how it operates, what you can do with it when it comes to predicting the next prices in the market with high accuracy and much more.
 

Analyzing weather impact on currencies of agricultural countries using Python

Analyzing weather impact on currencies of agricultural countries using Python

In this article, we will start with collecting weather data and work our way up to creating a complete trading system that analyzes weather factors. Our work is based on real trading data for the last five years from the world's major financial centers: New York, London, Tokyo, Hong Kong and Frankfurt. Using up-to-date data analysis and machine learning tools, we will obtain real trading signals from weather observations.
Analyzing weather impact on currencies of agricultural countries using Python
Analyzing weather impact on currencies of agricultural countries using Python
  • www.mql5.com
What is the relationship between weather and Forex? Classical economic theory has long ignored the influence of such factors as weather on market behavior. But everything has changed. Let's try to find connections between the weather conditions and the position of agricultural currencies on the market.
 

Fast trading strategy tester in Python using Numba

Fast trading strategy tester in Python using Numba

When developing trading algorithms based on machine learning, it is important to correctly and quickly evaluate the results of their trading on history. If we take into account the rare use of the tester on large time intervals and with a small history depth, then the tester in Python is quite suitable. However, if the task involves multiple tests and high-frequency strategies, then an interpreted language may be too slow.

Let's say we are not satisfied with the execution speed of some scripts, but we do not want to give up our familiar Python development environment. This is where Numba comes to the rescue, allowing us to convert and compile native Python code into fast machine code on the fly. The execution speed of such a code becomes comparable to the execution speed of code in programming languages, such as C and FORTRAN.

Fast trading strategy tester in Python using Numba
Fast trading strategy tester in Python using Numba
  • www.mql5.com
The article implements a fast strategy tester for machine learning models using Numba. It is 50 times faster than the pure Python strategy tester. The author recommends using this library to speed up mathematical calculations, especially the ones involving loops.
 
Implementing Practical Modules from Other Languages in MQL5 (Part 01): Building the SQLite3 Library, Inspired by Python

Implementing Practical Modules from Other Languages in MQL5 (Part 01): Building the SQLite3 Library, Inspired by Python

While an attempt to implement a module, tool, framework, etc., from one language into another— in this case into MQL5, could produce a slightly different functionality and outcome(s) due to the distinct nature of programming languages, but having a similar syntax or experience might be sufficient to make product development in MQL5 easy and a fun experience for developers familiar with different languages. Not to mention, we might learn some valuable information in the process that could solidify our programming skills in general.

In this new article series, we will be implementing not every module from other languages, but every module practical in MQL5 from another language. For example, modules for mathematical calculations, data storage, data analysis, etc.

Starting with the sqlite3 module that comes built-in with Python programming language.

Implementing Practical Modules from Other Languages in MQL5 (Part 01): Building the SQLite3 Library, Inspired by Python
Implementing Practical Modules from Other Languages in MQL5 (Part 01): Building the SQLite3 Library, Inspired by Python
  • www.mql5.com
The sqlite3 module in Python offers a straightforward approach for working with SQLite databases, it is fast and convenient. In this article, we are going to build a similar module on top of built-in MQL5 functions for working with databases to make it easier to work with SQLite3 databases in MQL5 as in Python.