Neural Networks in Trading: A Spiking Architecture for Spatio-Temporal Market Analysis (SDformerFlow)
Introduction
The financial market is always a story of movement. Not of those reassuring, smoothed lines that appear on charts. But of vibrant pulses, sudden surges in liquidity, and brief delays between events. It is precisely here, at the level of tick pulses, that true dynamics emerge — dynamics that are still hidden from most models. The problem is that classical neural networks view the market through the lens of fixed intervals and averaged values, forcing the dynamic flow to conform to a predetermined rhythm. This approach inevitably smooths out the data structure, erases small but significant transitions, and leaves the trader without important details that, under real-world conditions, determine how price movement develops.
Event-based approaches offer a different perspective. They respond not to time itself, but to the occurrence of changes. This is particularly natural for the market. After all, every tick is an event. Every surge in liquidity is a signal. Every micro-pause is part of the bigger picture. The SDformerFlow architecture is based precisely on this principle. It does not wait for the next uniform frame, but starts working the moment the market actually changes. This event-driven logic brings the model closer to the very nature of market data, in which value lies not so much in the values themselves as in the moments when they change.
The initial ideas for this approach came from the field of computer vision, where event cameras recorded not static frames, but only changes in brightness at each point. If we apply this logic to finance, it becomes clear just how similar the two worlds are. Tick data is likewise a sparse stream of events. What matters to us is the dynamic relationship between adjacent values, not just the fact that they exist. Therefore, the application of event-driven architectures to trading appears to be a natural evolution of analytical methods.
SDformerFlow has a number of features that make it particularly well-suited for analyzing market microstructure. Spiking dynamics allow the system to respond to sudden changes in a natural and efficient manner, keeping the model's attention focused on the most significant events. The window-based attention mechanism makes it possible to capture local relationships while also grasping the overall pattern of movement. The model does not impose an artificial rhythm on the market, but rather adapts to its natural rhythm. This makes it possible to detect subtle shifts in liquidity and reconstruct the hidden rate of price change.
The deeper we delve into the fabric of market movements, the more obvious it becomes that traditional methods are losing touch with reality. Between two consecutive ticks, an entire miniature battle over liquidity can unfold: a limit order is removed and reappears, and incoming orders arrive at an increasing rate. On a conventional chart, all of this disappears, reduced to a single value. Event-driven architecture fills this gap and allows us to see the market structure between the lines. Where the precursors of movement are born, before they have taken on a visual form.
SDformerFlow allows traders to observe the market as if they were looking at a live stream rather than static images. It highlights early signs of increased activity. It helps distinguish real movement from noise. It also allows you to assess price microvelocity just as the price begins to build momentum. This approach is particularly valuable in short-term forecasting models, noise filtering, order flow analysis, and the development of next-generation indicators capable of responding to the structure of price movement in real time.
The SDformerFlow Algorithm
The SDformerFlow architecture is based on a principle that has proven itself in event analysis tasks. The data stream passes through an encoder–decoder pair. The encoder progressively compresses the data and extracts features, while the decoder reconstructs the motion structure, transforming latent representations into the final flow map. This approach has long been known in the literature on event-based optical odometry and stream processing; however, in SDformerFlow, it has been adapted to the requirements of spiking processing and the nature of market data.
For clarity, the framework's authors compare two versions of the model: the spiking SDformerFlow and its counterpart based on conventional neural networks — STTFlowNet. Both versions are conceptually identical; they differ only in the type of data processing performed within the blocks. The ANN version uses standard Swin transformers with windowed Self-Attention, and the internal logic of the layers is consistent with modern implementations. Each block includes a 3D attention mechanism operating within bounded windows, followed by a dual MLP module combined with normalization and residual connections. A key distinguishing feature is the use of scaled cosine attention and logarithmic relative position bias, which increases the model’s robustness as the size of the input data grows and significantly improves its ability to handle long spatiotemporal sequences.
However, the paper focuses primarily on the spiking version — SDformerFlow — since its properties align most naturally with the dynamics of financial markets. The event stream is pulse-like and sparse. The model's architecture consists of three key components that sequentially form a signal hierarchy. First, the events are fed into the spiking feature generation module (Spiking Feature Generator — SFG), which serves as both a compact encoder and a lightweight patch extraction block. At this stage, the sparse stream of ticks is converted into a dense spatiotemporal representation suitable for subsequent processing by transformers. The resulting features are then fed into a chain of STSF encoders (SpatioTemporal swin SpikeFormer) — spiking Swin blocks that generate multi-level descriptions of motion, gradually expanding the field of attention and capturing not only local but also long-range relationships within the temporal stream.
In the final stage, the decoder combines the output of each encoder level with the corresponding scale in its own structure, creating a smooth descending path from high-level representations to a concrete motion map prediction. This symmetrical combination of levels allows the model to preserve both broad context and precision in capturing local changes — an important quality for analyzing price microstructure, where both overall trends and brief bursts of activity matter. Two additional residual blocks are placed between the encoder and the decoder to stabilize training and improve the transmission of subtle signals.
A key aspect of SDformerFlow lies in the choice of residual connection type — an issue that is far from trivial for spiking architectures. Early versions of SpikeFormer models used either conventional shortcut branches or so-called SEW connections. Both approaches had their limitations: classical shortcut blocks added values directly to the membrane potential, which disrupted the identity mapping and reduced stability in deep stacks of layers. The SEW variant, on the other hand, added residuals after spike generation, which led to excessive signal accumulation and unwanted integration. The authors of SDformerFlow chose a different approach — membrane-potential shortcut connections (MS). They add a residual signal prior to the spiking activation stage, preserving the model's event-driven nature and ensuring the correct transmission of information between levels. This makes it possible to avoid the degradation of learning that characterized previous approaches and to maintain precise control over the dynamics of membrane potentials.
The first stage in processing the event stream in SDformerFlow is the spiking feature generator module, which uses lightweight patch embedding (Spiking Feature Generator with Shortcut Patch Embedding). This unit consists of two consecutive stages. First, the event stream passes through the SFG block, where spatiotemporal features are generated, and then through the SPE block, which transforms these features into token embeddings suitable for further processing in STSF encoders.
In the Spiking Feature Generator (SFG), events are first processed using a spiking convolution, followed by two residual blocks with membrane-potential residual connections. This combination makes it possible to halve the spatial resolution of the feature map while preserving the spiking nature of the signal and highlighting the most significant changes in the event stream.
Formally speaking, the events under analysis undergo spiking convolution with normalization and spiking activation. They then pass through two consecutive MSRes residual blocks, which carefully add the signal to the membrane potential, ensuring proper information accumulation between layers. This approach preserves the signal's identity and prevents the degradation typical of classical shortcut branches. Unlike conventional ANN solutions, where both blocks are processed identically in a Resblock, the spiking generator focuses specifically on preserving spike dynamics, which are critical for analyzing streams with infrequent but significant events.
In the second stage, Shortcut Patch Embedding (SPE), the feature map is divided into spatial patches of size P×P, while the temporal sequence is preserved as a separate dimension. This step creates compact spatiotemporal tokens of size 1×P×P and projects spatiotemporal features into spiking embeddings. To improve performance and preserve information integrity, a deformed shortcut is added to the patches: the residual signal passes through a convolution with a 1×1 kernel and a stride of 2, ensuring matching output embedding shapes and improving feature transmission to subsequent STSF encoders.
As a result, the entire module functions as a compact and efficient event stream filter. First, it identifies significant spatiotemporal characteristics. It then carefully constructs token embeddings that can convey the entire structure of the microchanges to the deeper layers of the model. This is particularly valuable for trading: this approach makes it possible to identify short-term spikes in activity, localized shifts in liquidity, and hidden price momentum that go unnoticed in standard models.
The Spiking Feature Generator with Shortcut Patch Embedding ensures a smooth transition from a sparse, spiking stream of events to dense and informative features that can be efficiently processed by STSF encoders. This lays the foundation for further development of a feature hierarchy, balancing the precision of local details with coverage of the global motion context.
Once the events have been carefully converted into tokens, they are passed to the SpatioTemporal Swin SpikeFormer Encoder (STSF) — a key component of the SDformerFlow model. It gives rise to the fundamental spatiotemporal hierarchy of features. It is here that a sparse, spiking stream of events is transformed into a rich representation capable of capturing both microscopic spikes in activity and global patterns in price movement.
The STSF architecture is inspired by Swin transformers and modern SpikeFormer solutions. The model consists of four consecutive levels, with each level containing a specific number of STSF blocks (2–2–6–2). After each level except the last, Spiking Patch Merge (SPM) is applied to reduce the spatial resolution of the feature map by a factor of two. At the same time, the time axis remains unchanged. This approach makes it possible to gradually build a multi-level hierarchy. First, local micro-movements are detected; then, larger patterns emerge that reflect trends across the entire stream.
Each STSF block combines a spiking implementation of Multi-Head Self-Attention with 3D window shifting (SDSA) and a spiking MLP block. The stream being analyzed is divided into three-dimensional windows — small cubes of space and time — within which attention is calculated. For the low-resolution version, the framework's authors use a 2×9×9 window, and for the full map, a 2×15×15 window. The number of attention heads ranges from 3 to 24 across different levels, which gives the model flexibility. In the early layers, attention focuses on fine details; in the final layers, it focuses on global patterns.
The heart of the block is SDSA, or the spiking Self-Attention mechanism. In their paper, the authors of the framework presented two variants. The first is Spiking Dot Product Attention: Query, Key, and Value are represented as spiking tensors. Unlike classical neural networks, SoftMax is not needed here, since attention is inherently non-negative. Scaling prevents the vanishing gradient problem when using LIF neurons. Adaptive neurons do not require scaling — their thresholds are learned automatically.


After each STSF level (except the last one), Spiking Patch Merge (SPM) is applied to reduce spatial resolution without affecting the time axis. In practice, this means that the model compresses space without losing track of the sequence of events, just as a trader captures major movements on a chart without losing sight of the details of individual ticks. The combination of SDSA and SPM creates a powerful tool for constructing a multilevel spatiotemporal representation of the market.
It is particularly important to emphasize that each STSF block preserves pure spiking dynamics. Residual connections and attention mechanisms operate before spike generation, allowing spike information to be transmitted accurately between layers without blurring the signals. As a result, the model captures the slightest shifts in liquidity, early signs of spikes in activity, and hidden patterns that conventional models based on averaging simply fail to detect.
As a result, STSF performs several important functions simultaneously: it identifies local impulses, generates global movement patterns, and preserves the precise temporal structure of events. This is critically important for financial trading. Thanks to this architecture, SDformerFlow is capable of detecting early signals of price movement, forecasting short-term price fluctuations, and providing a foundation for constructing high-precision flow maps suitable for algorithmic strategies and microstructure forecasting.
Once the STSF encoders have generated rich spatiotemporal features, the decoder takes over. Its task is to restore the spatial resolution of the motion map and integrate local and global representations into a unified picture of the flow. In SDformerFlow, the decoder consists of three consecutive transposed convolution layers, each of which doubles the resolution. It is similar to how a trader gradually zooms in on a chart. First, the overall dynamics become apparent. Then, slight fluctuations become apparent. And at the final level, you can see the entire structure of price movement.
A key feature of the decoder is its skip connections to the corresponding levels of the STSF encoders. The output of each encoder is concatenated with the prediction at the same scale in the decoder. This allows the model to preserve fine local details that might otherwise be lost when the resolution is increased. This design ensures that each intermediate-level motion map contains information on both global patterns and local impulses, which is particularly important when analyzing the microstructure of financial flows.
A flow prediction is generated at each level of the decoder. These intermediate maps are then concatenated and used for the final output. Training is conducted using supervised learning approaches. The error is calculated as the mean absolute deviation between the predicted flow and the reference value. For each flow pixel in the space corresponding to price movement, the difference between the predicted and true horizontal and vertical components is calculated. Summing over all valid pixels yields the final error value, which is used to update the model's weights.
It is precisely this approach that makes the SDformerFlow decoder a powerful tool for flow analysis. It integrates local bursts of activity detected at early levels with global motion patterns generated by STSF encoders. For the financial market, this means the ability to simultaneously track short-term price impulses and overall market dynamics, creating accurate motion maps that can serve as the basis for algorithmic strategies, noise filtering, and microstructure forecasting.
Taken together, this design makes the SDformerFlow architecture robust, responsive, and efficient — qualities that are particularly valuable for tasks where the event stream may be irregular, impulsive, and full of bursts of activity, just as it is in financial markets. The author's visualization of the framework is shown below.

Implementation in MQL5
Now that we have covered the theoretical aspects of the SDformerFlow framework in detail, it is time to move on to the practical part of the work. Here, we will present one possible way to implement the proposed approaches using MQL5, demonstrating how the concepts described earlier are transformed into a functional tool for analyzing market flows. Let's start with the basic components of SDformerFlow, gradually building the architecture from feature generation to motion map prediction.
It is important to note at the outset that a common thread running throughout the framework is the membrane-potential residual connection (MS) proposed by the authors. Its principle is extremely simple yet highly effective: data is taken from the input before spiking activation and passed to the output before the corresponding activation is applied. In practice, this means moving away from the traditional approach, in which nonlinearity is applied only after all operations in the current layer have been completed. Instead, spiking activation is applied at the input of each layer, after which the result is processed using linear operations, convolutions, or other transformations. This order of operations preserves the pulsed nature of the signal, captures the timing of activity, and carefully accumulates features throughout the model. This is especially important when working with financial flows, where rare but significant events can easily be lost with the traditional sequence of operations.
In our work, we implement the key process using a new object, CNeuronSpikeConvBlock, which inherits basic functionality from the batch normalization layer CNeuronBatchNormOCL and serves as a building block for the spiking layers of SDformerFlow.
class CNeuronSpikeConvBlock : public CNeuronBatchNormOCL { protected: CNeuronSpikeActivation cActivation; CNeuronConvOCL cConv; //--- virtual bool feedForward(CNeuronBaseOCL *NeuronOCL) override; virtual bool updateInputWeights(CNeuronBaseOCL *NeuronOCL) override; virtual bool calcInputGradients(CNeuronBaseOCL *NeuronOCL) override; public: CNeuronSpikeConvBlock(void) {}; ~CNeuronSpikeConvBlock(void) {}; //--- virtual bool Init(uint numOutputs, uint myIndex, COpenCLMy *open_cl, uint window, uint step, uint window_out, uint units_count, uint variables, ENUM_OPTIMIZATION optimization_type, uint batch); //--- virtual int Type(void) override const { return defNeuronSpikeConvBlock; } //--- methods for working with files virtual bool Save(int const file_handle) override; virtual bool Load(int const file_handle) override; //--- virtual void SetOpenCL(COpenCLMy *obj) override; //--- virtual bool WeightsUpdate(CNeuronBaseOCL *source, float tau) override; virtual uint GetFilters(void) const { return cConv.GetFilters(); } virtual uint GetVariables(void) const { return cConv.GetVariables(); } virtual uint GetUnits(void) const { return cConv.GetUnits(); } //--- virtual void SetActivationFunction(ENUM_ACTIVATION value) override { }; virtual void TrainMode(bool flag) override; virtual bool Clear(void) override; };
The object contains two key components:
- CNeuronSpikeActivation handles spiking activation of the input data;
- CNeuronConvOCL implements convolution operations.
Interaction between them is managed through the overridden methods feedForward, updateInputWeights, and calcInputGradients, which ensure correct forward propagation of signals, weight updates, and gradient calculations during training.
In addition, normalization at the layer output, performed by the parent class, helps maintain a consistent distribution of values regardless of the model's depth. This ensures training stability, prevents vanishing gradients or exploding gradients, and preserves feature consistency as the signal passes through multiple layers — which is critical for deep spiking architectures such as SDformerFlow.
The Init method initializes all key components of the block, providing flexible configuration to support various scales and levels of the model.
bool CNeuronSpikeConvBlock::Init(uint numOutputs, uint myIndex, COpenCLMy *open_cl, uint window, uint step, uint window_out, uint units_count, uint variables, ENUM_OPTIMIZATION optimization_type, uint batch) { if(!CNeuronBatchNormOCL::Init(numOutputs, myIndex, open_cl, window_out * units_count * variables, batch, optimization_type)) return false; activation = None;
First, the initialization routine of the parent class CNeuronBatchNormOCL is called to prepare the inherited objects and interfaces.
Next, the spiking activation object cActivation is initialized; it generates the neurons' spiking response before convolution operations are applied.
if(!cActivation.Init(0, 0, OpenCL, (window - step + step * units_count)*variables, optimization, iBatch)) return false;
After that, the convolution layer cConv is configured to perform linear transformations and convolution over spatiotemporal features. Activation is disabled for the convolution. This underscores that spiking activation has already been performed in the previous stage, and that cConv is responsible solely for convolution operations.
if(!cConv.Init(0, 1, OpenCL, window, step, window_out, units_count, variables, optimization, iBatch)) return false; cConv.SetActivationFunction(None); //--- return true; }
Once the object has been initialized, we move on to setting up the forward pass. This stage fully demonstrates the key principle behind the unit's operation.
bool CNeuronSpikeConvBlock::feedForward(CNeuronBaseOCL *NeuronOCL) { if(!cActivation.FeedForward(NeuronOCL)) return false;
In the feedForward method, spiking activation is first invoked through the cActivation object to model the neurons' response to the events being analyzed by capturing rare but significant spikes. Just as a trader notes sudden spikes in volume or sharp price movements on a chart.
The activated data are then passed to the cConv convolution unit, where linear transformations and convolutions are performed to generate spatiotemporal features.
if(!cConv.FeedForward(cActivation.AsObject())) return false;
Finally, to maintain a comparable distribution of values regardless of the model's depth, the resulting output undergoes normalization provided by the parent class.
if(!CNeuronBatchNormOCL::feedForward(cConv.AsObject())) return false; //--- return true; }
This approach ensures a comprehensive, consistent transformation of the data: first, the signal’s impulse structure is preserved; then, local and global features are extracted; and normalization stabilizes the values and prevents vanishing gradients or exploding gradients. In a financial context, this makes it possible to accurately capture the minute details of price movements while simultaneously generating informative flow maps for subsequent analysis and forecasting.
As you can see, the algorithm for the forward pass is linear and predictable, which greatly simplifies the organization of the backward pass. For this reason, we have deliberately chosen not to go into detail about backpropagation, leaving that for you to explore on your own. The complete code for the class and all its methods, including the implementation of the backward pass, is provided in the attachment. This allows readers to fully familiarize themselves with the practical implementation and, if they wish, integrate it into their own projects.
Thus, CNeuronSpikeConvBlock serves as the core for building SDformerFlow spiking layers using MQL5, ensuring the smooth and accurate transmission of spiking information. But this is only the first building block in the construction of the spiking architecture. We implement the membrane-potential residual connection mechanism in a separate class, CNeuronMSRes, which inherits from the base class CNeuronBaseOCL.
The CNeuronMSRes object carefully manages the data flow, ensuring that the membrane potential is propagated before layer activation, which preserves the spiking structure of the signal without losing information about rare but significant events.
class CNeuronMSRes : public CNeuronBaseOCL { protected: CLayer cFlow; //--- //--- virtual bool feedForward(CNeuronBaseOCL *NeuronOCL) override; virtual bool updateInputWeights(CNeuronBaseOCL *NeuronOCL) override; virtual bool calcInputGradients(CNeuronBaseOCL *NeuronOCL) override; public: CNeuronMSRes(void) {}; ~CNeuronMSRes(void) {}; //--- virtual bool Init(uint numOutputs, uint myIndex, COpenCLMy *open_cl, uint units, uint window, uint variables, ENUM_OPTIMIZATION optimization_type, uint batch); //--- virtual int Type(void) override const { return defNeuronMSRes; } //--- methods for working with files virtual bool Save(int const file_handle) override; virtual bool Load(int const file_handle) override; //--- virtual void SetOpenCL(COpenCLMy *obj) override; //--- virtual bool WeightsUpdate(CNeuronBaseOCL *source, float tau) override; virtual void SetActivationFunction(ENUM_ACTIVATION value) override { }; virtual void TrainMode(bool flag) override; virtual bool Clear(void) override; };
The object initialization method coordinates the operation of the entire membrane-potential residual connection block and demonstrates the sequence for constructing a spiking architecture in practice.
bool CNeuronMSRes::Init(uint numOutputs, uint myIndex, COpenCLMy *open_cl, uint units, uint window, uint variables, ENUM_OPTIMIZATION optimization_type, uint batch) { if(!CNeuronBaseOCL::Init(numOutputs, myIndex, open_cl, window * units * variables, optimization_type, batch)) return false; activation = None;
The method's algorithm begins by calling the parent class's initialization method, which configures the neuron's basic settings. The activation field is set to None, indicating that spiking activation will occur within nested blocks.
Most of the work is handled by the cFlow object, which manages the block's internal components. First, its Clear method is called to clear the previous data, and then OpenCL support is configured to accelerate computations on the GPU.
cFlow.Clear(); cFlow.SetOpenCL(OpenCL);
Next, two CNeuronSpikeConvBlock blocks are created, which form the core of the module. The first block is initialized with a window size of window and twice the number of output channels. It is then added to cFlow.
CNeuronSpikeConvBlock *block = new CNeuronSpikeConvBlock(); if(!block || !block.Init(0, 0, OpenCL, window, window, 2 * window, units, variables, optimization, iBatch) || !cFlow.Add(block)) { DeleteObj(block) return false; }
The second block is given a larger window size and a reduced number of output channels to correctly process spatiotemporal features, and it is also added to the processing pipeline.
block = new CNeuronSpikeConvBlock(); if(!block || !block.Init(0, 1, OpenCL, 2 * window, 2 * window, window, units, variables, optimization, iBatch) || !cFlow.Add(block)) { DeleteObj(block) return false; } //--- return true; }
The forward pass algorithm is implemented in the feedForward method and fully embodies the principle of the membrane-potential residual connection.
bool CNeuronMSRes::feedForward(CNeuronBaseOCL *NeuronOCL) { CNeuronBaseOCL* prev = NeuronOCL; CNeuronBaseOCL* curr = NULL; //--- for(int i = 0; i < cFlow.Total(); i++) { curr = cFlow[i]; if(!curr || !curr.FeedForward(prev)) return false; prev = curr; }
First, a sequence is created for processing the input signal through all the internal blocks organized within the cFlow object. At each step, the current block curr receives the output of the previous block prev, performs spiking activation and convolution operations, and then passes the processed data to the next block. This sequential processing ensures the accumulation of spatiotemporal features and preserves the signal's spike structure.
After all nested blocks have processed the events being analyzed, the results are added to the original values.
if(!SumAndNormilize(NeuronOCL.getOutput(), prev.getOutput(), Output, 1, false, 0, 0, 0, 1)) return false; //--- return true; }
This ensures that the membrane potential is accumulated correctly and maintains a stable distribution of values regardless of the model's depth.
Ultimately, the feedForward method demonstrates a harmonious combination of spiking activation, linear transformations, and normalization, making the block a reliable tool for analyzing financial flows and accurately constructing spatiotemporal features.
However, flow prediction using random parameters generated during model initialization provides only limited information. Obtaining accurate results requires setting up the training process, which begins with careful handling of errors.
The calcInputGradients method implements gradient backpropagation within the CNeuronMSRes block.
bool CNeuronMSRes::calcInputGradients(CNeuronBaseOCL *NeuronOCL) { CNeuronBaseOCL* next = cFlow[-1]; CNeuronBaseOCL* curr = NULL; if(!next || !DeActivation(next.getOutput(), next.getGradient(), Gradient, next.Activation())) return false;
First, the gradients for the last block in the internal pipeline of cFlow are computed. In this process, the DeActivation method is used to undo the activation correctly and align it with the computed errors.
After that, the gradients are propagated backward sequentially through all the nested blocks, each of which adjusts its internal weights and accumulated membrane potentials.
for(int i = cFlow.Total() - 2; i >= 0; i--) { curr = cFlow[i]; if(!curr || !curr.CalcHiddenGradients(next)) return false; next = curr; }
In the final stage, the gradients obtained from the two information streams are combined.
if(!NeuronOCL.CalcHiddenGradients(next)) return false; next = cFlow[-1]; if(!DeActivation(NeuronOCL.getOutput(), next.getPrevOutput(), Gradient, NeuronOCL.Activation())) return false; if(!SumAndNormilize(NeuronOCL.getGradient(), next.getPrevOutput(), NeuronOCL.getGradient(), 1, false, 0, 0, 0, 1)) return false; //--- return true; }
This ensures a stable distribution of values and proper training even in deep spiking networks.
As a result, the calcInputGradients method transforms the CNeuronMSRes block into an active participant in the learning process, allowing the system to adapt to past events and gradually improve the accuracy of its price movement forecasts.
This CNeuronMSRes architecture ensures smooth hierarchical feature formation. First, the pulses are recorded, and local spiking patterns are formed. They then pass through a series of blocks to accumulate the membrane potential. As a result, the CNeuronMSRes object becomes a fundamental unit that preserves key information about events across multiple layers of the model, creating a reliable foundation for the accurate analysis of financial flows and the construction of price motion maps.
Conclusion
In this article, we explored the SDformerFlow framework, whose authors presented a number of new approaches that offer potential advantages for solving time series forecasting problems. The use of membrane-potential residual connections ensures the preservation of key information about rare but significant events. Spiking feature generators and multilevel encoders enable hierarchical processing of spatiotemporal data, creating informative price motion maps. Implementing them using MQL5 with OpenCL support opens up opportunities for flexible integration and accelerated processing of tick data. In addition, normalization and adaptive convolution blocks following spiking activation maintain stable feature distributions and simplify model training. Taken together, these solutions provide a solid foundation for the further development and application of the framework in the analysis and forecasting of financial flows.
Links
- SDformerFlow: Spatiotemporal swin spikeformer for event-based optical flow estimation
- Other articles in this series
Programs used in this article
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Study.mq5 | Expert Advisor | Expert Advisor for offline model training |
| 2 | StudyOnline.mq5 | Expert Advisor | Online model training Expert Advisor |
| 3 | Test.mq5 | Expert Advisor | Model testing Expert Advisor |
| 4 | Trajectory.mqh | Class library | Structure describing the system state and model architectures |
| 5 | NeuroNet.mqh | Class library | Class library for building a neural network |
| 6 | NeuroNet.cl | Library | Code library for an OpenCL program |
Translated from Russian by MetaQuotes Ltd.
Original article: https://www.mql5.com/ru/articles/20352
Warning: All rights to these materials are reserved by MetaQuotes Ltd. Copying or reprinting of these materials in whole or in part is prohibited.
This article was written by a user of the site and reflects their personal views. MetaQuotes Ltd is not responsible for the accuracy of the information presented, nor for any consequences resulting from the use of the solutions, strategies or recommendations described.