Discussing the article: "Neural Networks in Trading: Hierarchical Dual-Tower Transformer (Hidformer)"

 

Check out the new article: Neural Networks in Trading: Hierarchical Dual-Tower Transformer (Hidformer).

We invite you to get acquainted with the Hierarchical Double-Tower Transformer (Hidformer) framework, which was developed for time series forecasting and data analysis. The framework authors proposed several improvements to the Transformer architecture, which resulted in increased forecast accuracy and reduced computational resource consumption.

Neural network models capable of capturing the temporal structure of data and identifying hidden patterns have become particularly in demand in financial forecasting. However, traditional neural network approaches face limitations related to high computational complexity and insufficient interpretability of results. Consequently, in recent years, architectures based on attention mechanisms have attracted increasing interest from researchers, as they provide more accurate analysis of time series and financial data.

Models based on the Transformer architecture and its modifications have gained the most popularity. One such modification, introduced in the paper "Hidformer: Transformer-Style Neural Network in Stock Price Forecasting" is called Hidformer. This model is specifically designed for time-series analysis and focuses on improving prediction accuracy through optimized attention mechanisms, efficient identification of long-term dependencies, and adaptation to the characteristics of financial data. The main advantage of Hidformer lies in its ability to account for complex temporal relationships, which is an especially important feature in stock market analysis, where asset prices depend on numerous factors.


Author: Dmitriy Gizlyk

 
Could you please tell me how to get a set of trends with this neural network?

I understand that this is one of its features -

" The first analyses temporal characteristics, identifying trends and patterns on the time scale".


 

Hello Dmitriy,

According to the OnTesterDeinit() the code should in the Tester mode (ie. in the StrategyTester) save down NN files.

//+------------------------------------------------------------------+
//| TesterDeinit function|
//+------------------------------------------------------------------+
void OnTesterDeinit()
  {
//---
   int total = ArraySize(Buffer);
   printf("total %d", MathMin(total, MaxReplayBuffer));
   Print("Saving...");
   SaveTotalBase();
   Print("Saved");
  }
//+------------------------------------------------------------------+

This doesnt happen. Also this OnTesterDeinit() doesnt get called it seems. Since i dont see any of the print statements.

Is this due to an update of MQL5? Or why does your code not save files anymore?

 
Andreas Alois Aigner print statements.

Is this due to an update of MQL5? Or why does your code not save files anymore?

Dear Andreas,

OnTesterDeinit runs only in optimisation mode. Please refer to the documentation at https://www.mql5.com/en/docs/event_handlers/ontesterdeinit.
We do not save models in the tester because this EA does not study them. It is necessary to check the effectiveness of previously studied model.

Best regards,
Dmitriy.

Documentation on MQL5: Event Handling / OnTesterDeinit
Documentation on MQL5: Event Handling / OnTesterDeinit
  • www.mql5.com
The function is called in EAs when the TesterDeinit event occurs after EA optimization. Return Value No return value Note The TesterDeinit event is...