Unveiling a possible resolution to the exploration problem in reinforcement learning β introducing Self-Supervised Exploration via Disagreement. This algorithm, based on a self-learning approach, enables the agent to generate intrinsic rewards by interacting and getting information from its environment. Unlike other algorithms, it incorporates multiple models interacting with the environment, producing varying predictions.
If the models disagree, it's regarded as an 'interesting' event, making the agent more determined to uncover that space in the environment. As the agent explores novel environment areas, it's able to offer more accurate reward predictions. It increases efficiency and reduces reliance on potential limited or costly external rewards, making it particularly beneficial in real-world applications.
The discrepancy in forecasts is used as an intrinsic reward for policy...
Read More
If the models disagree, it's regarded as an 'interesting' event, making the agent more determined to uncover that space in the environment. As the agent explores novel environment areas, it's able to offer more accurate reward predictions. It increases efficiency and reduces reliance on potential limited or costly external rewards, making it particularly beneficial in real-world applications.
The discrepancy in forecasts is used as an intrinsic reward for policy...
Read More
π5β€1
Access the treasure trove of coding examples housed in the official documentation, whether the goal is to learn, create a foundation for more complex programs, or simply improve personal codebases for more simplified, reusable solutions.
Find inspiration in the reworked codes available on Mql5 iFunctions, which are now optimized for recycling. Feedback is appreciated. Prospective users are encouraged to compare these codes with those from the original document and provide constructive comments.
For beginners in coding, a variety of basic codes have been provided, which include ADX, Alligator, AMA - Adaptive Moving Average, ATR - Average True Range, Bands Bollinger, and Ichimoku among others. These have been designed to fast track learning and provide a chase for quick evolution.
For those looking to understand calculations of indicators without applying Mql5 iFunctions, look no ...
Read More
Find inspiration in the reworked codes available on Mql5 iFunctions, which are now optimized for recycling. Feedback is appreciated. Prospective users are encouraged to compare these codes with those from the original document and provide constructive comments.
For beginners in coding, a variety of basic codes have been provided, which include ADX, Alligator, AMA - Adaptive Moving Average, ATR - Average True Range, Bands Bollinger, and Ichimoku among others. These have been designed to fast track learning and provide a chase for quick evolution.
For those looking to understand calculations of indicators without applying Mql5 iFunctions, look no ...
Read More
π2β€1
In this series, we have been focusing on the non-operational section of the MQTT protocol. Now, we are moving on to the operational part, which involves dealing with packets sent from the server. Our client needs to identify the server packet type and determine the appropriate behavior based on the client's state. To do this, we need to identify the server packet type in the first byte of the response. If it is a CONNACK packet, we must read its Connect Reason Code and react accordingly.
When our client requests a connection with the server, it must inform the server about desired capabilities, such as authentication and session preferences. This is done by setting bit flags in the Connect Flags field. These flags represent boolean values, with true or false indicating the desired capabilities. For example, the Clean Start flag indicates whether the server should discard any existing...
Read More
When our client requests a connection with the server, it must inform the server about desired capabilities, such as authentication and session preferences. This is done by setting bit flags in the Connect Flags field. These flags represent boolean values, with true or false indicating the desired capabilities. For example, the Clean Start flag indicates whether the server should discard any existing...
Read More
π2
Detailing Symbol Input Classification: This function accepts the symbol of a financial instrument, its primary function is to ascertain the filling policy. The method employed here is SymbolInfoInteger to accrue the filling policy information for the given symbol. The information is stored numerically in a variable coined 'filling'.
Differentiation of Filling Methods: The numerical value encapsulated in 'filling' is subsequently compared with constants symbolizing the array of filling policies, such as "Fill or Kill" (SYMBOL_FILLING_FOK), "Immediate or Cancel" (SYMBOL_FILLING_IOC), and Return (SYMBOL_FILLING_RETURN).
Deciphering the Filling Policy Protocol: Post comparison, the function identifies the type of the filling policy. If it links with "Fill or Kill," it indicates ORDER_FILLING_FOK. In the case it links up with "Immediate or Cancel," it signals ORDER_FILLING_IOC. Failing...
Read More
Differentiation of Filling Methods: The numerical value encapsulated in 'filling' is subsequently compared with constants symbolizing the array of filling policies, such as "Fill or Kill" (SYMBOL_FILLING_FOK), "Immediate or Cancel" (SYMBOL_FILLING_IOC), and Return (SYMBOL_FILLING_RETURN).
Deciphering the Filling Policy Protocol: Post comparison, the function identifies the type of the filling policy. If it links with "Fill or Kill," it indicates ORDER_FILLING_FOK. In the case it links up with "Immediate or Cancel," it signals ORDER_FILLING_IOC. Failing...
Read More
π8β€1
π New Article Alert! π
In this article, we explore the implementation of financial time series forecasting based on neural networks using PyTorch Lightning and PyTorch Forecasting framework through the MetaTrader5 trading platform. We provide detailed explanations on the libraries we utilized, including PyTorch Lightning and PyTorch Forecasting, highlighting their benefits and features for professional AI researchers and machine learning engineers.
π In this post, we introduce several important Python libraries for time series forecasting. We begin with PyTorch Lightning, a powerful framework designed for flexibility and scalability. With its separation of academic and engineering code, PyTorch Lightning streamlines and enhances code reusability, maintenance, and logic comprehension.
π We also discuss PyTorch Forecasting, a specialized library for time series forecasting. Buil...
Read More
In this article, we explore the implementation of financial time series forecasting based on neural networks using PyTorch Lightning and PyTorch Forecasting framework through the MetaTrader5 trading platform. We provide detailed explanations on the libraries we utilized, including PyTorch Lightning and PyTorch Forecasting, highlighting their benefits and features for professional AI researchers and machine learning engineers.
π In this post, we introduce several important Python libraries for time series forecasting. We begin with PyTorch Lightning, a powerful framework designed for flexibility and scalability. With its separation of academic and engineering code, PyTorch Lightning streamlines and enhances code reusability, maintenance, and logic comprehension.
π We also discuss PyTorch Forecasting, a specialized library for time series forecasting. Buil...
Read More
π3β€1
π£ Exploring the Implementation of Category Theory in MQL5!
Implementing Category Theory in MQL5 can be an intimidating task, especially with the lack of easily accessible material on the subject. But fear not! We are here to make this topic more approachable for traders. In this article, we will highlight the concept of horizontal composition of natural transformations.
In our previous article, we discussed the vertical composition of natural transformations. This time, we will extend the moving average time series horizontally by introducing a third category: the double exponential moving average. Our variant of this indicator is a moving average of a moving average, making it a valuable tool for analysis.
Similar to the previous article, we will have two functors between the categories, each with its own moving average period. The natural transformation between these functor pai...
Read More
Implementing Category Theory in MQL5 can be an intimidating task, especially with the lack of easily accessible material on the subject. But fear not! We are here to make this topic more approachable for traders. In this article, we will highlight the concept of horizontal composition of natural transformations.
In our previous article, we discussed the vertical composition of natural transformations. This time, we will extend the moving average time series horizontally by introducing a third category: the double exponential moving average. Our variant of this indicator is a moving average of a moving average, making it a valuable tool for analysis.
Similar to the previous article, we will have two functors between the categories, each with its own moving average period. The natural transformation between these functor pai...
Read More
π₯3π1
In the financial industry, traders often aim for high returns; however, this also increases risk. Therefore, risk-adjusted returns are a vital performance criterion. There are diverse metrics for this, each with pros and cons. For instance, the Sharpe ratio is a common measure, but it applies unrealistic conditions on return distribution, prompting alternatives.
The aim here is to outline the implementation of such alternative risk-return measures and generate hypothetical equity curves for analysis. The base data for the simulated trading strategy are the SP 500 - no specific trading rules are utilized, rather random numbers generate equity curves and the corresponding return series.
An application implemented as a Metatrader 5 (MT5) Expert Advisor graphically displays three equity curves β the benchmark red curve can be adjusted with the initial capital and defines the blue and ...
Read More
The aim here is to outline the implementation of such alternative risk-return measures and generate hypothetical equity curves for analysis. The base data for the simulated trading strategy are the SP 500 - no specific trading rules are utilized, rather random numbers generate equity curves and the corresponding return series.
An application implemented as a Metatrader 5 (MT5) Expert Advisor graphically displays three equity curves β the benchmark red curve can be adjusted with the initial capital and defines the blue and ...
Read More
π5
Understanding the application of the Double Bollinger Band strategy in the forex market can filter entries and departures. The essential aim is to initiate Buy or Sell trades when the forex price fluctuates beyond the 3Ο (3-standard deviation) in the respective direction. The 2Ο (2-standard deviations) standard deviation level of the Bollinger Bands are also taken into account for decision making.
Let's address the default parameters:
The 2Ο Bollinger Bands (20,2) signifies the simple moving average of 20 and the standard deviations at 2. The 3Ο Bollinger Bands (20,3) indicates the simple 20 moving average and 3 as the standard deviations.
For initiating a long entry, it is suggested to open a Buy order when the following conditions are adhered to:
1) The Ask price must surpass the 3Ο upper Bollinger Band (BB3UP).
2) Ensure the current price falls within the range of the 2Ο uppe...
Read More
Let's address the default parameters:
The 2Ο Bollinger Bands (20,2) signifies the simple moving average of 20 and the standard deviations at 2. The 3Ο Bollinger Bands (20,3) indicates the simple 20 moving average and 3 as the standard deviations.
For initiating a long entry, it is suggested to open a Buy order when the following conditions are adhered to:
1) The Ask price must surpass the 3Ο upper Bollinger Band (BB3UP).
2) Ensure the current price falls within the range of the 2Ο uppe...
Read More
π3
Following the examination of various topics in category theory applicable beyond the academic sphere, including sets & morphisms, ontology logs, functors, and natural transformations, this article moves forward by addressing possible applications of natural transformations in time series forecasting.
The need for such forecasting arises when a startup company creates a database for tracking customer purchases and notices substantial redundancy in the product column, highlighting popular products. Responding to this, the company decides to log more product-related data to better discern customer preferences and potentials for new product development. This could lead to partitioning the existing product column into parameters like version, subscription mode, and build name or the payment column into payment mode, currency, and payment amount.
Any alterations to the data structure mig...
Read More
The need for such forecasting arises when a startup company creates a database for tracking customer purchases and notices substantial redundancy in the product column, highlighting popular products. Responding to this, the company decides to log more product-related data to better discern customer preferences and potentials for new product development. This could lead to partitioning the existing product column into parameters like version, subscription mode, and build name or the payment column into payment mode, currency, and payment amount.
Any alterations to the data structure mig...
Read More
π3
Working on a Sunday isn't rare in the realm of software development. The highlight of todayβs work is the 'Awesome Oscillator' that's now available in the open-source codebase, in addition to the 'Adaptive Moving Average' and the 'Alligator'. This new embodiment of the iAO function provides better flexibility by offering increased adjustment parameters on moving averages.
Breaking the barriers of a single-function tool, the revamped iAO function now takes into account periods, methods, and application. The aim is to present you with a code that is simple, clear, and effectively embodies basic concepts. The additional bonus is its potential to be a perfect starting point for customizing it further based on individual requirements.
Feel free to reach out for detailed understanding or for suggesting ideas for free development. There's also a collection of free indicator codes designed ...
Read More
Breaking the barriers of a single-function tool, the revamped iAO function now takes into account periods, methods, and application. The aim is to present you with a code that is simple, clear, and effectively embodies basic concepts. The additional bonus is its potential to be a perfect starting point for customizing it further based on individual requirements.
Feel free to reach out for detailed understanding or for suggesting ideas for free development. There's also a collection of free indicator codes designed ...
Read More
π5
Creating profitable automated trading systems requires careful consideration and analysis. Even if a strategy appears profitable during testing, there are still questions about its performance in live trading and its potential returns compared to other investment opportunities. In this article, we will explore statistical techniques to estimate the future performance of automated trading systems using out-of-sample tests.
When testing a trading system, we gather various performance metrics to assess its profit potential. However, relying solely on intuition may not be enough, as a strategy that performs well during testing may not generate stellar returns in live trading. Statistical methods can provide a better understanding of whether the observed performance will continue and how it may vary. These methods are not meant to provide accurate estimations, but rather to identify strat...
Read More
When testing a trading system, we gather various performance metrics to assess its profit potential. However, relying solely on intuition may not be enough, as a strategy that performs well during testing may not generate stellar returns in live trading. Statistical methods can provide a better understanding of whether the observed performance will continue and how it may vary. These methods are not meant to provide accurate estimations, but rather to identify strat...
Read More
π3
Key Update: Version 2 boasts added settings for personalized use, including new methods to compute Lot size and the ability to enable various trailing stop strategies. This has been incorporated to tailor-fit your account and trading strategies.
The version is a breakthrough in the Donchian Channel Strategy breakout EA, delivering its best enactment at H1. A complete explanation of the strategy and input parameters are comprehensively relayed in the associated video.
The optimized utility extends over multiple pairs. It is recommended to:
1. Execute optimizations on as many pairs as feasible within the past 6 months.
2. Reset the optimizations on a monthly basis.
3. Attach all profitable sets to the charts to optimize profits and distribute risk.
Currently, these sets are operating on an account balance of 500β¬. The optimization process follows the approach documented in the linke...
Read More
The version is a breakthrough in the Donchian Channel Strategy breakout EA, delivering its best enactment at H1. A complete explanation of the strategy and input parameters are comprehensively relayed in the associated video.
The optimized utility extends over multiple pairs. It is recommended to:
1. Execute optimizations on as many pairs as feasible within the past 6 months.
2. Reset the optimizations on a monthly basis.
3. Attach all profitable sets to the charts to optimize profits and distribute risk.
Currently, these sets are operating on an account balance of 500β¬. The optimization process follows the approach documented in the linke...
Read More
π4
The task of predicting a real value from an unlabeled example is known as regression. For instance, estimating the value of a diamond based on its characteristics such as size, weight, color, clarity, etc. The accuracy of regression model predictions is assessed using regression metrics. Not to be confused with similar loss functions, these metrics are semantically different. They usually depend not only on the model parameters but also on the predicted values.
MQL5 language features several key metrics such as Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), R-squared (R2), Mean Absolute Percentage Error (MAPE), Mean Squared Percentage Error (MSPE) and Root Mean Squared Logarithmic Error (RMSLE). More are expected to be introduced.
To simplify, MAE measures the deviation of the predicted number from the actual number while RMSE further emphasizes...
Read More
MQL5 language features several key metrics such as Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), R-squared (R2), Mean Absolute Percentage Error (MAPE), Mean Squared Percentage Error (MSPE) and Root Mean Squared Logarithmic Error (RMSLE). More are expected to be introduced.
To simplify, MAE measures the deviation of the predicted number from the actual number while RMSE further emphasizes...
Read More
π3
Profoundly regarded among technical traders, the Marubozo, stemming from the Japanese term for 'close-cropped', denotes a notable candlestick construction in charting. It features an elongated body with an absence of shadows, signifying a stern trading period with dramatic price variations. The core principle behind these intriguing configurations revolves around the comparison of opening and closing prices within an isolated trading day.
Candlestick charts, vital to the realm of technical analysts, provide insightful market clues hidden within the price movements. These diagrams envisage potential market trends, serving as a key that unlocks investor sentiment and market dynamics.
Grasping the concept of Marubozo could offer significant advantage to traders, enhancing their decision-making capacity in this high-stakes financial play. It is, therefore, critical to understand these c...
Read More
Candlestick charts, vital to the realm of technical analysts, provide insightful market clues hidden within the price movements. These diagrams envisage potential market trends, serving as a key that unlocks investor sentiment and market dynamics.
Grasping the concept of Marubozo could offer significant advantage to traders, enhancing their decision-making capacity in this high-stakes financial play. It is, therefore, critical to understand these c...
Read More
π5β€1π1
Utilizing trading robots or signal subscriptions often ultimately leads to the demand for a 24/7 hosting server. The recommendation here is the use of MetaTrader VPS due to various factors. Notably, subscription management becomes a breeze through an MQL5.community account. This allows for a seamless migration of the platform to the cloud.
Offering you a selection of the closest server and an approximation of the reduced delay incomparable to your current connection, the MetaTrader VPS offers optimal trading execution. This includes minimization of slippage and reduced probability of a requote.
It's important to note that before a payment plan is chosen, it's beneficial to check if your broker provides MetaTrader 5 virtual hosting free of cost. If your broker participates in the recently introduced Sponsored VPS program, virtual hosting might be provided as a bonus with some conditi...
Read More
Offering you a selection of the closest server and an approximation of the reduced delay incomparable to your current connection, the MetaTrader VPS offers optimal trading execution. This includes minimization of slippage and reduced probability of a requote.
It's important to note that before a payment plan is chosen, it's beneficial to check if your broker provides MetaTrader 5 virtual hosting free of cost. If your broker participates in the recently introduced Sponsored VPS program, virtual hosting might be provided as a bonus with some conditi...
Read More
π5
The power and reach of Artificial Intelligence (AI) have undeniably permeated various aspects of daily life, spanning from finance and arts to education and beyond. A vital new development is the ability to export and import AI models in Open Neural Network Exchange (ONNX) format. This feature notably optimizes the development process, significantly saving time and resources when integrating AI into disparate language ecosystems.
The growing support for ONNX in MQL5 presents an exciting possibility. It allows for the creation and implementation of AI models in popular programming languages like Python, followed by their conversion into ONNX format for use within MQL5 programs.
ONNX streamlines the machine learning process, allowing models trained in a particular learning framework to be ported to alternate frameworks or platforms with minimal modifications. This functionality dramat...
Read More
The growing support for ONNX in MQL5 presents an exciting possibility. It allows for the creation and implementation of AI models in popular programming languages like Python, followed by their conversion into ONNX format for use within MQL5 programs.
ONNX streamlines the machine learning process, allowing models trained in a particular learning framework to be ported to alternate frameworks or platforms with minimal modifications. This functionality dramat...
Read More
π6β€1
In programming, logging neatly organized, formatted information can grant higher efficiency. StringFormat() function can be quite handy in such cases. It helps to format data, displaying it in the terminal journal and further using it in the program.
Creating templates for displaying symbol properties in the journal can involve two functions. The first one formats the string into the form required for printing, and the second one prints the string received by the first into the journal. This approach ensures uniform formatting.
Various properties have been explained in detail, ranging from data latency, economic sector, price for building bars, spread, Bid price, to Ask price. The focus has been on creating two functions for each property for a comprehensive understanding. Various examples have been included for every symbol property to ensure clear understanding for the user. Sub...
Read More
Creating templates for displaying symbol properties in the journal can involve two functions. The first one formats the string into the form required for printing, and the second one prints the string received by the first into the journal. This approach ensures uniform formatting.
Various properties have been explained in detail, ranging from data latency, economic sector, price for building bars, spread, Bid price, to Ask price. The focus has been on creating two functions for each property for a comprehensive understanding. Various examples have been included for every symbol property to ensure clear understanding for the user. Sub...
Read More
π4
Understanding the official documentation of code and functions can be daunting, therefore, there is now an initiative to simplify these codes for better comprehension and reusability. No matter the level of coding expertise, from beginners to those who want to evolve quickly, these simplified versions should be of assistance.
Opinions are sought on the user experience of the basic codes provided compared to those provided in the official documentation. Engagement with these codes, through comments and rating, is encouraged to enhance their visibility.
There is a host of codes available, specifically geared towards beginners, in the Mql5 iFunctions. These include ADX, Alligator, AMA - Adaptive Moving Average, ATR - Average True Range, Bands Bollinger, Ichimoku, MACDr, Momentum, Moving Average, RSI, and Stochastic.
For those looking for a bit more advancement in their coding, two ...
Read More
Opinions are sought on the user experience of the basic codes provided compared to those provided in the official documentation. Engagement with these codes, through comments and rating, is encouraged to enhance their visibility.
There is a host of codes available, specifically geared towards beginners, in the Mql5 iFunctions. These include ADX, Alligator, AMA - Adaptive Moving Average, ATR - Average True Range, Bands Bollinger, Ichimoku, MACDr, Momentum, Moving Average, RSI, and Stochastic.
For those looking for a bit more advancement in their coding, two ...
Read More
π5
Discrete Hartley Transform (DHT), first proposed in 1942 by Ralph Hartley, had a discrete version introduced in 1983 by Ronald Bracewell. DHT is used in signal analysis and processing of discrete time series - it converts signals from the time domain to the frequency domain, using real numbers only. This makes its application results more visually comprehensible and convenient for practical implementation.
This transformative technique allows the evaluation of the influence of specific harmonic in the original signal. Moreover, the Inverse Hartley transform aids in shifting from the frequency domain back to the time realm.
The practical usability of DHT is exemplified by taking the spectrum of Open prices as a signal, applying the inverse Hartley transform to an altered signal, or using it for signal smoothing. Furthermore, spectrum processing can involve nullifying or attenuating...
Read More
This transformative technique allows the evaluation of the influence of specific harmonic in the original signal. Moreover, the Inverse Hartley transform aids in shifting from the frequency domain back to the time realm.
The practical usability of DHT is exemplified by taking the spectrum of Open prices as a signal, applying the inverse Hartley transform to an altered signal, or using it for signal smoothing. Furthermore, spectrum processing can involve nullifying or attenuating...
Read More
π5
Examine the practical details of economically deploying large language models (LLMs) locally, fine-tuned to specific needs. This discourse covers essential aspects, including hardware and software configurations, to build a basic deployment environment for LLMs. Grasp the requirements for deploying these fundamental models that apply deep learning to natural language processing and natural language generation tasks.
Understand why LLMs are a preferred choice for algorithmic trading due to their strong logical comprehension and reasoning capabilities. The article also discusses the benefits of local deployments, such as data protection, optimized performance, personalized data fine-tuning, and real-time response.
Considerations for hardware configuration include CPU, GPU, memory, and storage devices that ensure efficient model performance. The software environment configuration reve...
Read More
Understand why LLMs are a preferred choice for algorithmic trading due to their strong logical comprehension and reasoning capabilities. The article also discusses the benefits of local deployments, such as data protection, optimized performance, personalized data fine-tuning, and real-time response.
Considerations for hardware configuration include CPU, GPU, memory, and storage devices that ensure efficient model performance. The software environment configuration reve...
Read More
π7
Lessons from an experienced developer:
Achieving efficient programming in financial markets goes beyond the elementary mastery of codes - it's about getting the full grasp of the essence of time. With the MQL5 (MetaQuotes Language 5), significant strides in handling date and time in financial trading has been actualized.
This knowledge is a weapon for both traders and developers, and today, the focus would be on highlighting the comprehensive scope of this important subject. Key topics include: datetime type, MqlDateTime structure, OnTimer event, and potential applications such as NewBar, Time Filter, and tradeAtTime.
The datetime variable type, fundamental to MQL5, helps comprehend Unix time i.e., seconds elapsed since January 1, 1970. From comparisons and manipulations to conversions, a deep understanding of datetime opens up limitless possibilities in the trading arena.
Ensui...
Read More
Achieving efficient programming in financial markets goes beyond the elementary mastery of codes - it's about getting the full grasp of the essence of time. With the MQL5 (MetaQuotes Language 5), significant strides in handling date and time in financial trading has been actualized.
This knowledge is a weapon for both traders and developers, and today, the focus would be on highlighting the comprehensive scope of this important subject. Key topics include: datetime type, MqlDateTime structure, OnTimer event, and potential applications such as NewBar, Time Filter, and tradeAtTime.
The datetime variable type, fundamental to MQL5, helps comprehend Unix time i.e., seconds elapsed since January 1, 1970. From comparisons and manipulations to conversions, a deep understanding of datetime opens up limitless possibilities in the trading arena.
Ensui...
Read More
π4π3β€1