# A Novel Algorithmic Forex Trade and Trend Analysis Framework Based on Deep Predictive Coding Network Optimized with Reptile Search Algorithm

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Literature Survey

## 3. Materials and Methods

#### 3.1. Architecture and Model Description of DPCN

#### 3.2. RSA Optimization Strategy

- 1.
**Initialization Phase:**In this phase, the process starts with a set of candidate solutions ($S$) generated stochastically to obtain the nearly optimum best solution at each iteration and is represented in Equation (10).$$S=\left[\begin{array}{ccc}{s}_{1,1}& \dots & {s}_{1,j}\\ {s}_{2,1}& \dots & {s}_{2,j}\\ \begin{array}{c}\dots \\ \vdots \\ \begin{array}{c}{s}_{CS-1,1}\\ {s}_{CS,1}\end{array}\end{array}& \begin{array}{c}\dots \\ \vdots \\ \begin{array}{c}\dots \\ \dots \end{array}\end{array}& \begin{array}{c}{s}_{i,j}\\ \vdots \\ \begin{array}{c}{s}_{CS-1,j}\\ {s}_{CS,j}\end{array}\end{array}\end{array}\begin{array}{cc}{s}_{1,d-1}& {s}_{1,d}\\ \dots & {s}_{2,d}\\ \begin{array}{c}\dots \\ \vdots \\ \begin{array}{c}\dots \\ {s}_{CS,d-1}\end{array}\end{array}& \begin{array}{c}\dots \\ \vdots \\ \begin{array}{c}{s}_{CS-1,d}\\ {s}_{CS,d}\end{array}\end{array}\end{array}\right]$$$$s\begin{array}{c}i,j=rand\times \left(Boun{d}_{Upper}-Boun{d}_{Lower}\right)+Boun{d}_{Lower}\end{array}$$- 2.
**Encircling Phase:**This phase deals with the exploratory behavior or encircling of RSA with two movements of crocodiles, such as high walking and belly walking, which do not allow them to approach the target prey, and the exploration search discovers a wide search area due to this movement behavior of the crocodiles. This exploration through high and belly walking is only used to support other phases of operation, such as hunting or exploration. The RSA makes a change between exploration and exploitation in search phases based on various behaviors in four conditions by dividing the number of iterations into four parts. The objective of exploration or encircling is to obtain a better solution based on the movement, and searching is done on two conditions such as (i) $t\le \frac{T}{4}$ for high walking and (ii) $t\le 2\frac{T}{4}$ and $t>\frac{T}{4}$ for belly walking. The position updating is done using Equation (12) during the exploration phase.$${s}_{\left(i,j\right)\left(CI+1\right)=\{\begin{array}{c}Bes{t}_{j}\left(CI\right)\times -H{B}_{\left(i,j\right)}\left(CI\right)\times \delta -R{F}_{\left(i,j\right)}\left(CI\right)\times rand,t\le \frac{T}{4}\\ Bes{t}_{j}\left(CI\right)\times {s}_{\left(r2,j\right)}\times ES\left(CI\right)\times rand,t\le 2\frac{T}{4}andtT/4\end{array}}$$$$H{B}_{i,j}=Bes{t}_{j}\left(CI\right)\times P{D}_{\left(i,j\right)}$$$$R{F}_{\left(i,j\right)}=\frac{Bes{t}_{j}\left(CI\right)\times {s}_{\left(r2,j\right)}}{Bes{t}_{j}\left(CI\right)+\in}$$$$ES\left(CI\right)=2\times r3\times \left(1-\frac{1}{T}\right)$$$$P{D}_{\left(ij\right)}=\gamma +\frac{{s}_{\left(i,j\right)-Averag{e}_{Position\left({s}_{i}\right)}}}{Bes{t}_{j}\left(CI\right)\times \left(Boun{d}_{Upper\left(j\right)}-Boun{d}_{Lower\left(j\right)}\right)+{\in}^{\prime}}$$$$Averag{e}_{Position\left({s}_{i}\right)}=\frac{1}{d}{\displaystyle \sum}_{j=1}^{d}{s}_{\left(i,j\right)}$$- 3.
**Hunting Phase:**This phase simulates crocodiles’ hunting strategy, such as coordination and cooperation, which allows them to target the prey quickly. These two phases obtain the near-optimal solution after several actions and establish the communication between them, and the RSA exploits those two main strategies based on Equation (18). The searching is based on hunting coordination conditioned on$t\le 3\frac{T}{4}andt2\frac{T}{4}$, otherwise the hunting coordination is done when $t\le \mathrm{T}andt3\frac{T}{4}$.$${s}_{\left(i,j\right)}\left(CI+1\right)=\{\begin{array}{c}Bes{t}_{j}\left(CI\right)\times P{D}_{\left(i,j\right)}\left(CI\right)\times rand,t\le 3\frac{T}{4}andt2\frac{T}{4}\\ Bes{t}_{j}\left(CI\right)-H{B}_{\left(i,j\right)}\left(CI\right)\times \in -R{F}_{\left(i,j\right)}\left(CI\right)\times rand,t\le Tandt3\frac{T}{4}\end{array}$$

#### 3.3. Dataset Preparation and Augmentation

#### 3.4. Parameters Used

#### 3.5. Model Description and Proposed RSA-DPCN Algorithm

Algorithm 1: RSA-DPCN forecasting model |

Initialize the sensitive parameters $\gamma ,\delta $ [Controls the exploration accuracy for hunting cooperation and high walking for encircling phases over the course of iterations respectively and both are set to 0.1] Initialize decision variables Feed forward kernel size; Feedback kernel size; Up-sample scale factor; While: Meet termination condition Calculate MSE from DPCN model; Find minimum MSE for $i=1:CS\left(AllPopulation\right)$[Number of candidate solutions] Update $HB,RF,PD$; [Hunting operator, Reduce function used to reduce the search space and Percentage Difference between the best obtained solution and current solution respectively] if $\left(t\le \frac{T}{4}\right)$ then High Walking; else if $(t\le 2\frac{T}{4}andt\frac{T}{4})$ Belly Walking; else if $(t\le 3\frac{T}{4}andt2\frac{T}{4})$ Hunting Co-ordination; else Hunting Co-operation; end if end for end while |

## 4. Experiments and Results

#### 4.1. Phase #1: RSA-DPCN for FOREX Short-Term Trading

#### 4.2. Performance Comparison and Validation of RSA-DPCN Forex Trading Model

^{2}), Theils’U [44], etc. The RMSE is used to evaluate the quality of predictions made, and the lower RMSE value shows the better-fitted model, the MAPE is used to forecast the error, and it is good if there are no zeros in the data and the percentage errors are summed up to compute the value of MAPE, generally, MAPE < 10% and MAPE < 20% are considered excellent and good, respectively. MAE measures the accuracy of the continuous variables and gives the magnitude of the errors without considering the directions. It has been seen that MAE is less biased towards higher values, whereas MSE is more biased towards higher values, but RMSE is much better for observing the predictor’s performance. Similarly, the MARE is used to measure the average magnitude of the errors in a set of predicted values and is sensitive to extreme values such as outliers or zeros and the R

^{2}is the fraction of variance of the actual value of the response variable. The higher the R

^{2}value, the better the model fits our data; a value higher than 0.9 is generally considered to be good. Theil’sU compares the predicted output with forecasting output with minimal historical data and, generally, this measure squares the deviations to give more weight to significant errors and, in turn, helps eliminate those significant errors. In this phase of experimentation, it can be seen that the proposed RSA-DPCN is showing its better performance over all the measures used and explained above for all three currency pairs for short-term forecasting of the Forex market given in Table 3, Table 4 and Table 5 for 3 days, 7 days and 15 days of predictive time-frames, respectively.

#### 4.3. Phase #2: RSA-DPCN for FOREX Trend Analysis Using HHs/HLs and LHs/LLs

## 5. Conclusions and Future Scope

^{2}, and Theils’U; and a two-sample K–S statistical test has been performed to assess the predictive ability of the RSA-DPCN forecasting model. Additionally, an attempt has also been made to monitor the market trends such as up-trends and down-trends by observing the highs, lows, higher highs, and lower lows in this Forex market using HHs/HLs and LHs/LLs, a widely used technical analysis tool. The significant outcome of this proposed algorithmic framework is, apart from the proposed forecasting of exchange prices or trade analysis; an attempt has been made to understand the behavior of this market through trends and trend reversals, and, in turn, this strategy will help the investors and traders to comprehend the entry and exit points of this financial market. This algorithmic framework only explored the short-term predictive horizons, whereas this experiment could have been expanded for long-term predictive days, and DL-based forecasting techniques could have been explored more, which will be extended in our future work. Additionally, this research can also be extended for not only observing the trends, but also measure or forecast the magnitude of trends with respect to average, maximum, and minimum number units up and/or down, and we believe this will surely help the investors and traders to comprehend the entry and exit points of this financial market.

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Das, S.R.; Mishra, D.; Rout, M. A hybridized ELM-Jaya forecasting model for currency exchange prediction. J. King Saud Univ.—Comput. Inf. Sci.
**2020**, 32, 345–366. [Google Scholar] [CrossRef] - Das, S.R.; Mishra, D.; Rout, M. An optimized feature reduction based currency forecasting model exploring the online sequential extreme learning machine and krill herd strategies. Phys. A Stat. Mech. Appl.
**2019**, 513, 339–370. [Google Scholar] [CrossRef] - Sarangi, P.K.; Chawla, M.; Ghosh, P.; Singh, S.; Singh, P.K. FOREX trend analysis using machine learning techniques: INR vs USD currency exchange rate using ANN-GA hybrid approach. Mater. Today Proc.
**2022**, 49, 3170–3176. [Google Scholar] [CrossRef] - Farimani, S.A.; Jahan, M.V.; Fard, A.M.; Tabbakh, S.R. Investigating the informativeness of technical indicators and news sentiment in financial market price prediction. Knowl.-Based Syst.
**2022**, 247, 108742. [Google Scholar] [CrossRef] - Das, S.R.; Mishra, D.; Rout, M. A hybridized ELM using self-adaptive multi-population-based Jaya algorithm for currency exchange prediction: An empirical assessment. Neural Comput. Appl.
**2019**, 31, 7071–7094. [Google Scholar] [CrossRef] - Nayak, R.K.; Mishra, D.; Rath, A.K. An optimized SVM-k-NN currency exchange forecasting model for Indian currency market. Neural Comput. Appl.
**2019**, 31, 995–3021. [Google Scholar] [CrossRef] - Galeshchuk, S. Neural networks performance in exchange rate prediction. Neurocomputing
**2016**, 172, 446–452. [Google Scholar] [CrossRef] - Ni, H.; Yin, H. Exchange rate prediction using hybrid neural networks and trading indicators. Neurocomputing
**2009**, 72, 2815–2823. [Google Scholar] [CrossRef] - PradeepKumar, D.; Ravi, V. Soft computing hybrids for FOREX rate prediction: A comprehensive review. Comput. Oper. Res.
**2018**, 99, 262–284. [Google Scholar] [CrossRef] - Carapuço, J.; Neves, R.; Horta, N. Reinforcement learning applied to Forex trading. Appl. Soft Comput.
**2018**, 73, 783–794. [Google Scholar] [CrossRef] - Panda, M.M.; Panda, S.N.; Pattnaik, P.K. Multi currency exchange rate prediction using convolutional neural network. Mater. Today Proc.
**2021**. ISSN 2214-7853. [Google Scholar] [CrossRef] - Sezer, O.B.; Gudelek, M.U.; Ozbayoglu, A.M. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Appl. Soft Comput.
**2020**, 90, 106181. [Google Scholar] [CrossRef] - Islam, M.S.; Hossain, E. Foreign exchange currency rate prediction using a GRU-LSTM hybrid network. Soft Comput. Lett.
**2021**, 3, 100009. [Google Scholar] [CrossRef] - Juszczuk, P.; Kruś, L. Soft multicriteria computing supporting decisions on the Forex market. Appl. Soft Comput.
**2020**, 96, 106654. [Google Scholar] [CrossRef] - Ahmed, S.; Hassan, S.U.; Aljohani, N.R.; Nawaz, R. FLF-LSTM: A novel prediction system using Forex Loss Function. Appl. Soft Comput.
**2020**, 97, 106780. [Google Scholar] [CrossRef] - Pang, Z.; O’May, C.B.; Choksi, B.; VanRullen, R. Predictive coding feedback results in perceived illusory contours in a recurrent neural network. Neural Netw.
**2021**, 144, 164–175. [Google Scholar] [CrossRef] [PubMed] - Mohan, A.; Luckey, A.; Weisz, N.; Vanneste, S. Predisposition to domain-wide maladaptive changes in predictive coding in auditory phantom perception. NeuroImage
**2022**, 248, 118813. [Google Scholar] [CrossRef] - Wen, H.; Han, K.; Shi, J.; Zhang, Y.; Culurciello, E.; Liu, Z. Deep Predictive Coding Network for Object Recognition. In Proceedings of the 35th International Conference on Machine Learning (ICML 2018), Stockholmsmässan, Stockholm, Sweden, 10–15 July 2018; Volume 80, pp. 5266–5275. [Google Scholar]
- Dora, S.; Pennartz, C.; Bohte, S. A Deep Predictive Coding Network for Inferring Hierarchical Causes Underlying Sensory Inputs. In Artificial Neural Networks and Machine Learning—ICANN 2018; Kůrková, V., Manolopoulos, Y., Hammer, B., Iliadis, L., Maglogiannis, I., Eds.; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2018; Volume 11141. [Google Scholar]
- Sledge, I.J.; Principe, J.C. Faster Convergence in Deep-Predictive-Coding Networks to Learn Deeper Representations. IEEE Trans. Neural Netw. Learn. Systems
**2021**, 1–15. [Google Scholar] [CrossRef] - Lotter, W.; Kreiman, G.; Cox, D. Deep Predictive Coding Networks for Video Prediction and Unsupervised Learning. arXiv
**2016**, arXiv:1605.08104. [Google Scholar] - Wang, L.; Zeng, Y.; Chen, T. Back propagation neural network with adaptive differential evolution algorithm for time series forecasting. Expert Syst. Appl.
**2015**, 42, 855–863. [Google Scholar] [CrossRef] - Rout, M.; Majhi, B.; Majhi, R.; Panda, G. Forecasting of currency exchange rates using an adaptive ARMA model with differential evolution based training. J. King Saud Univ.—Comput. Inf. Sci.
**2014**, 26, 7–18. [Google Scholar] [CrossRef] - Chouikhi, N.; Ammar, B.; Rokbani, N.; Alimi, A.M. PSO-based analysis of Echo State Network parameters for time series forecasting. Appl. Soft Comput.
**2017**, 55, 211–225. [Google Scholar] [CrossRef] - de Almeida, B.J.; Neves, R.F.; Horta, N. Combining Support Vector Machine with Genetic Algorithms to optimize investments in Forex markets with high leverage. Appl. Soft Comput.
**2018**, 64, 596–613. [Google Scholar] [CrossRef] - Evans, C.; Pappas, K.; Xhafa, F. Utilizing artificial neural networks and genetic algorithms to build an algo-trading model for intra-day foreign exchange speculation. Math. Comput. Model.
**2013**, 58, 1249–1266. [Google Scholar] [CrossRef] - Abualigah, L.; Abd Elaziz, M.; Sumari, P.; Geem, Z.W.; Gandomi, A.H. Reptile Search Algorithm (RSA): A nature-inspired meta-heuristic optimizer. Expert Syst. Appl.
**2022**, 191, 116158. [Google Scholar] [CrossRef] - Güntürkün, O.; Stacho, M.; Ströckens, F. Chapter 8—The Brains of Reptiles and Birds. In Evolutionary Neuroscience, 2nd ed.; Jon, H.K., Ed.; Academic Press: Cambridge, MA, USA, 2020; pp. 159–212. [Google Scholar]
- Gibbons, P.M.; Tell, L.A. Problem Solving in Reptile Practice. J. Exot. Pet Med.
**2009**, 18, 202–212. [Google Scholar] [CrossRef] - Das, S.R.; Mishra, D.; Rout, M. Stock market prediction using Firefly algorithm with evolutionary framework optimized feature reduction for OSELM method. Expert Syst. Appl. X
**2019**, 4, 100016. [Google Scholar] [CrossRef] - Das, A.K.; Mishra, D.; Das, K.; Mallick, P.K.; Kumar, S.; Zymbler, M.; El-Sayed, H. Prophesying the Short-Term Dynamics of the Crude Oil Future Price by Adopting the Survival of the Fittest Principle of Improved Grey Optimization and Extreme Learning Machine. Mathematics
**2022**, 10, 1121. [Google Scholar] [CrossRef] - Liu, M.; Luo, K.; Zhang, J.; Chen, S. A stock selection algorithm hybridizing grey wolf optimizer and support vector regression. Expert Syst. Appl.
**2021**, 179, 115078. [Google Scholar] [CrossRef] - Yao, J.; Tan, C.L. A case study on using neural networks to perform technical forecasting of forex. Neurocomputing
**2000**, 34, 79–98. [Google Scholar] [CrossRef] - Talebi, H.; Hoang, W.; Gavrilova, M.L. Multi-scale Foreign Exchange Rates Ensemble for Classification of Trends in Forex Market. Procedia Comput. Sci.
**2014**, 29, 2065–2075. [Google Scholar] [CrossRef] - Fiorucci, J.A.; Silva, G.N.; Barboza, F. Reaction trend system with GARCH quantiles as action points. Expert Syst. Appl.
**2022**, 198, 116750. [Google Scholar] [CrossRef] - Bartoš, E.; Pinčák, R. Identification of market trends with string and D2-brane maps. Phys. A Stat. Mech. Appl.
**2017**, 479, 57–70. [Google Scholar] [CrossRef] - Sadeghi, A.; Daneshvar, A.; Zaj, M.M. Combined ensemble multi-class SVM and fuzzy NSGA-II for trend forecasting and trading in Forex markets. Expert Syst. Appl.
**2021**, 185, 115566. [Google Scholar] [CrossRef] - Available online: https://in.investing.com/currencies/ (accessed on 1 January 2022).
- Panopoulou, E.; Souropanis, I. The role of technical indicators in exchange rate forecasting. J. Empir. Financ.
**2019**, 53, 197–221. [Google Scholar] [CrossRef] - Dai, Z.; Zhu, H.; Kang, J. New technical indicators and stock returns predictability. Int. Rev. Econ. Financ.
**2021**, 71, 127–142. [Google Scholar] [CrossRef] - Lee, S.W.; Kim, H.Y. Stock market forecasting with super-high dimensional time-series data using ConvLSTM, trend sampling, and specialized data augmentation. Expert Syst. Appl.
**2020**, 161, 113704. [Google Scholar] [CrossRef] - Available online: https://forexbee.co/trend-analysis/ (accessed on 11 January 2022).
- Available online: https://www.incrediblecharts.com/technical/dow_theory_trends.php (accessed on 11 January 2022).
- Korczak, J.; Hernes, M. Performance Evaluation of Trading Strategies in Multi-Agent Systems—Case of A-Trader. In Proceedings of the 2018 Federated Conference on Computer Science and Information Systems (FedCSIS), Poznan, Poland, 9–12 September 2018; pp. 839–844. [Google Scholar]
- Otsu, T.; Taniguchi, G. Kolmogorov–Smirnov type test for generated variables. Econ. Lett.
**2020**, 195, 109401. [Google Scholar] [CrossRef]

**Figure 2.**Proposed two-layer structure of DPCN for Forex market forecasting in which the feedback is shown in blue arrows, feed-forward in green arrows, and recurrent in black arrows, and the connections presenting the top-down and bottom-up prediction of errors, the historical data.

**Figure 4.**Convergence graphs of RSA-DPCN vs. RSA-FLANN and RSA-ELM for 3 predictive days ahead of closing price prediction for (

**a**) USD/EUR, (

**b**) AUD/JPY and (

**c**) CHF/INR for both AAs and OAs.

**Figure 5.**Convergence graphs of RSA-DPCN vs. RSA-FLANN and RSA-ELM for 7 predictive days ahead of closing price prediction for (

**a**) USD/EUR, (

**b**) AUD/JPY and (

**c**) CHF/INR for both AAs and OAs.

**Figure 6.**Convergence graphs of RSA-DPCN vs. RSA-FLANN and RSA-ELM for 15 predictive days ahead of closing price prediction for (

**a**) USD/EUR, (

**b**) AUD/JPY and (

**c**) CHF/INR for both AAs and OAs.

**Figure 7.**(

**a**). Convergence curves of RSA-DPCN vs. DE-DPCN, PSO-FPCN, and GA-DPCN for all three currency datasets for 3 days ahead of closing price prediction for AAs. (

**b**). Convergence curves of RSA-DPCN vs. DE-DPCN, PSO-FPCN, and GA-DPCN for all three currency datasets for 7 days ahead of closing price prediction for AAs. (

**c**). Convergence curves of RSA-DPCN vs. DE-DPCN, PSO-FPCN, and GA-DPCN for all three currency datasets for 15 days ahead of closing price prediction for AAs.

**Figure 8.**(

**a**). Predictive performance of RSA-DPCN for all three currency pairs for 03 days ahead of closing price prediction with OAs and AAs. (

**b**). Predictive performance of RSA-DPCN for all three currency pairs for 7 days ahead of closing price prediction with OAs and AAs. (

**c**). Predictive performance of RSA-DPCN for all three currency pairs for 15 days ahead of closing price prediction with OAs and AAs.

**Figure 10.**Up-trends and Down-trends observed using HHs/HLs and LHs/LLs and potential divergence/split points for USD/EUR currency pairs for 3 days, 7 days, and 15 days ahead of prediction for AAs based on closing price.

**Figure 11.**Up-trends and Down-trends observed using HHs/HLs and LHs/LLs and potential divergence/split points for AUD/JPY currency pairs for 3 days, 7 days, and 15 days ahead of prediction for AAs based on closing price.

**Figure 12.**Up-trends and Down-trends observed using HHs/HLs and LHs/LLs and potential divergence/split points for CHF/INR currency pairs for 3 days, 7 days, and 15 days ahead of prediction for AAs based on closing price.

Datasets | Total Samples | Date Range | Data Range |
---|---|---|---|

USD/EUR | 1828 | 1 January 2015~1 January 2021 | 0.7969~0.9671 |

AUD/JPY | 1828 | 59~98 | |

CHF/INR | 1828 | 60~83 |

Networks and Optimization Techniques | Parameters and Associated Values |
---|---|

FLANN | algorithm = ’autotuned’; target_precision = 0.7; build_weight = 0.01; memory_weight = 0; |

ELM | Activation Function: Multiquadtratic |

DPCN | Feebforward-Conv2D-Kernel Size-3; Feebback-Conv2D-Kernel Size-3 For prediction: Up sampling has been performed using PyTorch with various scaling factors. |

GA | Number of Decision Variables = 3; Maximum Number of Iterations = 50 Population size = 10; Selection method-Roulette wheel |

PSO | Number of Decision Variables = 3; Maximum Number of Iterations = 50 Number of Particles = 10; Inertia Weight = 1; Inertia Weight Damping Ratio = 0.99; Personal Learning Coefficient = 1.5; Global Learning Coefficient = 2.0 |

DE | Number of Decision Variables = 3; Maximum Number of Iterations = 50 Crossover rate = 0.7; Mutation factor = 0.5; Number of Decision Variables = 3 |

RSA | Maximum Number of Iterations = 50; Alpha = 0.1; Beta = 0.005 |

Models | Currency Pairs | RMSE | MAPE | MAE | MSE | MARE | R^{2} | Theil’s U |
---|---|---|---|---|---|---|---|---|

GA-DPCN | USD/EUR | 0.0065 | 0.740271 | 0.0065 | 4.22 × 10^{−}^{5} | 0.007403 | 0.964974 | 0.3958 |

PSO-DPCN | 0.00308 | 0.350775 | 0.00308 | 9.49 × 10^{−6} | 0.003508 | 0.992136 | 0.1932 | |

DE-DPCN | 0.002 | 0.227776 | 0.002 | 4 × 10^{−6} | 0.002278 | 0.996684 | 0.1923 | |

RSA-DPCN | 0.001 | 0.113888 | 0.001 | 1 × 10^{−6} | 0.001139 | 0.999171 | 0.1919 | |

GA-DPCN | AUD/JPY | 1.1885 | 1.462043 | 1.1885 | 1.412532 | 0.01462 | 0.961778 | 0.3215 |

PSO-DPCN | 1.1788 | 1.45011 | 1.1788 | 1.389569 | 0.014501 | 0.962399 | 0.3158 | |

DE-DPCN | 1.167 | 1.435594 | 1.167 | 1.361889 | 0.014356 | 0.963148 | 0.3115 | |

RSA-DPCN | 1.148 | 1.412221 | 1.148 | 1.317904 | 0.014122 | 0.964338 | 0.2848 | |

GA-DPCN | CHF/INR | 0.5885 | 0.826408 | 0.5885 | 0.346332 | 0.008264 | 0.989719 | 0.4181 |

PSO-DPCN | 0.5788 | 0.812787 | 0.5788 | 0.335009 | 0.008128 | 0.990055 | 0.4142 | |

DE-DPCN | 0.5167 | 0.725582 | 0.5167 | 0.266979 | 0.007256 | 0.992075 | 0.4156 | |

RSA-DPCN | 0.5148 | 0.722914 | 0.5148 | 0.265019 | 0.007229 | 0.992133 | 0.3147 |

Models | Currency Pairs | RMSE | MAPE | MAE | MSE | MARE | R^{2} | Theil’s U |
---|---|---|---|---|---|---|---|---|

GA-DPCN | USD/EUR | 0.00625 | 0.711727 | 0.00625 | 3.91 × 10^{−5} | 0.007117 | 0.967591 | 0.3868 |

PSO-DPCN | 0.003087 | 0.351536 | 0.003087 | 9.53 × 10^{−6} | 0.003515 | 0.992094 | 0.2911 | |

DE-DPCN | 0.0027 | 0.307466 | 0.0027 | 7.29 × 10^{−6} | 0.003075 | 0.993952 | 0.2593 | |

RSA-DPCN | 0.0017 | 0.19359 | 0.0017 | 2.89 × 10^{−6} | 0.001936 | 0.997602 | 0.2124 | |

GA-DPCN | AUD/JPY | 1.41985 | 1.747244 | 1.41985 | 2.015974 | 0.017472 | 0.944855 | 0.3242 |

PSO-DPCN | 1.31888 | 1.622992 | 1.31888 | 1.739444 | 0.01623 | 0.952419 | 0.3168 | |

DE-DPCN | 1.2697 | 1.562472 | 1.2697 | 1.612138 | 0.015625 | 0.955901 | 0.3154 | |

RSA-DPCN | 1.258 | 1.548074 | 1.258 | 1.582564 | 0.015481 | 0.95671 | 0.2954 | |

GA-DPCN | CHF/INR | 1.95885 | 2.749931 | 1.95885 | 3.837093 | 0.027499 | 0.885766 | 0.4487 |

PSO-DPCN | 1.5788 | 2.216398 | 1.5788 | 2.492609 | 0.022164 | 0.925792 | 0.4444 | |

DE-DPCN | 1.1667 | 1.637872 | 1.1667 | 1.361189 | 0.016379 | 0.959476 | 0.4251 | |

RSA-DPCN | 1.1148 | 1.565012 | 1.1148 | 1.242779 | 0.01565 | 0.963001 | 0.3242 |

Models | Currency Pairs | RMSE | MAPE | MAE | MSE | MARE | R^{2} | Theil’s U |
---|---|---|---|---|---|---|---|---|

GA-DPCN | USD/EUR | 0.00925 | 1.053217 | 0.00925 | 8.56 × 10^{−5} | 0.010532 | 0.929121 | 0.3879 |

PSO-DPCN | 0.008087 | 0.920796 | 0.008087 | 6.54 × 10^{−5} | 0.009208 | 0.945823 | 0.2995 | |

DE-DPCN | 0.0077 | 0.876732 | 0.0077 | 5.93 × 10^{−5} | 0.008767 | 0.950884 | 0.2784 | |

RSA-DPCN | 0.0067 | 0.76287 | 0.0067 | 4.49 × 10^{−5} | 0.007629 | 0.962813 | 0.2615 | |

GA-DPCN | AUD/JPY | 1.4985 | 1.845308 | 1.4985 | 2.245502 | 0.018453 | 0.937204 | 0.3249 |

PSO-DPCN | 1.3888 | 1.71022 | 1.3888 | 1.928765 | 0.017102 | 0.946061 | 0.3287 | |

DE-DPCN | 1.3697 | 1.686699 | 1.3697 | 1.876078 | 0.016867 | 0.947535 | 0.3241 | |

RSA-DPCN | 1.298 | 1.598405 | 1.298 | 1.684804 | 0.015984 | 0.952884 | 0.2922 | |

GA-DPCN | CHF/INR | 2.01885 | 2.832884 | 2.01885 | 4.075755 | 0.028329 | 0.878081 | 0.4491 |

PSO-DPCN | 1.9788 | 2.776685 | 1.9788 | 3.915649 | 0.027767 | 0.88287 | 0.4318 | |

DE-DPCN | 1.967 | 2.760127 | 1.967 | 3.869089 | 0.027601 | 0.884263 | 0.4122 | |

RSA-DPCN | 1.5148 | 2.125593 | 1.5148 | 2.294619 | 0.021256 | 0.931361 | 0.3142 |

Datasets | Model Pairs | $\mathit{p}$ $\mathbf{and}\mathit{h}$ Value | 03 Days | 07 Days | 15 Days |
---|---|---|---|---|---|

USD/EUR | RSA-DPCN vs. GA-DPCN | (p) | 1.8 × 10^{−6} | 7.85 × 10^{−5} | 0.027227 |

(h) | 1 | 1 | 1 | ||

RSA-DPCN vs. PSO-DPCN | (p) | 0.070596 | 0.228212 | 0.229598 | |

(h) | 0 | 0 | 0 | ||

RSA-DPCN vs. DE-DPCN | (p) | 0.384621 | 0.384953 | 0.386367 | |

(h) | 0 | 0 | 0 | ||

AUD/JPY | RSA-DPCN vs. GA-DPCN | (p) | 0.840559 | 0.419428 | 0.312933 |

(h) | 0 | 0 | 0 | ||

RSA-DPCN vs. PSO-DPCN | (p) | 0.878402 | 0.76134 | 0.647665 | |

(h) | 0 | 0 | 0 | ||

RSA-DPCN vs. DE-DPCN | (p) | 0.924807 | 0.953454 | 0.718191 | |

(h) | 0 | 0 | 0 | ||

CHF/INR | RSA-DPCN vs. GA-DPCN | (p) | 0.701395 | 1.15E-05 | (p)0.008726 |

(h) | 0 | 1 | (h)1 | ||

RSA-DPCN vs. PSO-DPCN | (p) | 0.739155 | 0.01578 | 0.015761 | |

(h) | 0 | 1 | 1 | ||

RSA-DPCN vs. DE-DPCN | (p) | 0.992113 | 0.78707 | 0.01862 | |

(h) | 0 | 0 | 1 |

Models | Currency Pairs | OAs | AAs | ||||
---|---|---|---|---|---|---|---|

03 Days | 07 Days | 15 Days | 03 Days | 07 Days | 15 Days | ||

GA-DPCN | USD/EUR | 960 | 943 | 915 | 1014 | 1001 | 986 |

PSO-DPCN | 955 | 940 | 917 | 998 | 986 | 979 | |

DE-DPCN | 964 | 942 | 921 | 1021 | 998 | 981 | |

RSA-DPCN | 961 | 947 | 919 | 1002 | 999 | 985 | |

GA-DPCN | AUD/JPY | 960 | 941 | 924 | 1012 | 999 | 986 |

PSO-DPCN | 954 | 935 | 916 | 995 | 979 | 979 | |

DE-DPCN | 952 | 942 | 923 | 1026 | 983 | 979 | |

RSA-DPCN | 955 | 945 | 917 | 1008 | 999 | 982 | |

GA-DPCN | HF/INR | 925 | 914 | 909 | 1017 | 1008 | 976 |

PSO-DPCN | 931 | 924 | 917 | 989 | 981 | 972 | |

DE-DPCN | 971 | 946 | 922 | 1015 | 993 | 969 | |

RSA-DPCN | 958 | 947 | 920 | 1011 | 987 | 981 |

**Table 8.**The trend analysis: Trends observed based on predicted closing price of RSA-DPCN based on HH/HL and LH/LL vs. Trends observed on closing price of actual datasets for OAs and AAs during 3 days, 7 days, and 15 days ahead of prediction.

Predictive Days | Datasets OAs/AAs | USD/EUR | AUD/JPY | CHF/INR | |||
---|---|---|---|---|---|---|---|

No. of UP-Trends | No. of Down-Trends | No. of UP-Trends | No. of Down-Trends | No. of UP-Trends | No. of Down-Trends | ||

3 Days | OAs | 27 | 27 | 32 | 29 | 34 | 29 |

AAs | 26 | 27 | 32 | 29 | 35 | 28 | |

No. of mismatches observed | 1 | 0 | 0 | 0 | 1 | 1 | |

7 Days | OAs | 27 | 26 | 30 | 29 | 31 | 26 |

AAs | 26 | 25 | 30 | 29 | 32 | 25 | |

No. of mismatches observed | 1 | 1 | 0 | 0 | 1 | 1 | |

15 Days | OAs | 26 | 24 | 26 | 29 | 28 | 21 |

AAs | 28 | 26 | 26 | 29 | 29 | 22 | |

No. of mismatches observed | 1 | 2 | 0 | 0 | 1 | 1 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Dash, S.; Sahu, P.K.; Mishra, D.; Mallick, P.K.; Sharma, B.; Zymbler, M.; Kumar, S.
A Novel Algorithmic Forex Trade and Trend Analysis Framework Based on Deep Predictive Coding Network Optimized with Reptile Search Algorithm. *Axioms* **2022**, *11*, 396.
https://doi.org/10.3390/axioms11080396

**AMA Style**

Dash S, Sahu PK, Mishra D, Mallick PK, Sharma B, Zymbler M, Kumar S.
A Novel Algorithmic Forex Trade and Trend Analysis Framework Based on Deep Predictive Coding Network Optimized with Reptile Search Algorithm. *Axioms*. 2022; 11(8):396.
https://doi.org/10.3390/axioms11080396

**Chicago/Turabian Style**

Dash, Swaty, Pradip Kumar Sahu, Debahuti Mishra, Pradeep Kumar Mallick, Bharti Sharma, Mikhail Zymbler, and Sachin Kumar.
2022. "A Novel Algorithmic Forex Trade and Trend Analysis Framework Based on Deep Predictive Coding Network Optimized with Reptile Search Algorithm" *Axioms* 11, no. 8: 396.
https://doi.org/10.3390/axioms11080396