IDEAS home Printed from https://ideas.repec.org/a/eee/eneeco/v127y2023ipas0140988323006047.html
   My bibliography  Save this article

Transformer-based forecasting for intraday trading in the Shanghai crude oil market: Analyzing open-high-low-close prices

Author

Listed:
  • Huang, Wenyang
  • Gao, Tianxiao
  • Hao, Yun
  • Wang, Xiuqing

Abstract

The Shanghai crude oil futures market exudes distinct speculative attributes, underscoring the pivotal significance of precise price forecasts. Accurate forecasting of Shanghai crude oil futures prices assumes vital importance for investors to optimize their portfolios profitably, for producers to mitigate production risks in the crude oil spot market, and for providing cogent decision-making support to government entities. This study implements a groundbreaking unbiased structural forecasting for Shanghai crude oil futures' open-high-low-close (OHLC) prices leveraging the Transformer framework coupled with the model-driven and penalty term-based loss function designs. Based on OHLC forecasts, this study devises three intraday trading strategies. Notably, our results evince that the forecasting accuracy of the Transformer outperforms the Naïve method, vector autoregression (VAR) and vector error correction model (VECM), multiple linear regression (MLR), support vector regression (SVR), and long short-term memory (LSTM) neural network when applied to different temporal granularities of Shanghai crude oil futures OHLC data. Furthermore, the three proposed intraday trading strategies exhibit higher annualized return rates and Sharpe ratios, alongside lower maximum drawdowns and standard deviations of returns in comparison to the conventional close-to-close strategy relying solely on the close price. Remarkably, the forecasting process and intraday trading strategies explicated in this study can equally apply to other futures products in the energy sector, including electricity, coal, and natural gas.

Suggested Citation

  • Huang, Wenyang & Gao, Tianxiao & Hao, Yun & Wang, Xiuqing, 2023. "Transformer-based forecasting for intraday trading in the Shanghai crude oil market: Analyzing open-high-low-close prices," Energy Economics, Elsevier, vol. 127(PA).
  • Handle: RePEc:eee:eneeco:v:127:y:2023:i:pa:s0140988323006047
    DOI: 10.1016/j.eneco.2023.107106
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S0140988323006047
    Download Restriction: Full text for ScienceDirect subscribers only

    File URL: https://libkey.io/10.1016/j.eneco.2023.107106?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    References listed on IDEAS

    as
    1. Wuyue An & Lin Wang & Yu‐Rong Zeng, 2023. "Text‐based soybean futures price forecasting: A two‐stage deep learning approach," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 42(2), pages 312-330, March.
    2. Paulo Rodrigues & Nazarii Salish, 2015. "Modeling and forecasting interval time series with threshold models," Advances in Data Analysis and Classification, Springer;German Classification Society - Gesellschaft für Klassifikation (GfKl);Japanese Classification Society (JCS);Classification and Data Analysis Group of the Italian Statistical Society (CLADAG);International Federation of Classification Societies (IFCS), vol. 9(1), pages 41-57, March.
    3. Huang, Wenyang & Wang, Huiwen & Wei, Yigang, 2023. "Identifying the determinants of European carbon allowances prices: A novel robust partial least squares method for open-high-low-close data," International Review of Financial Analysis, Elsevier, vol. 90(C).
    4. Liu, Min & Lee, Chien-Chiang, 2021. "Capturing the dynamics of the China crude oil futures: Markov switching, co-movement, and volatility forecasting," Energy Economics, Elsevier, vol. 103(C).
    5. Lv, Fei & Yang, Chen & Fang, Libing, 2020. "Do the crude oil futures of the Shanghai International Energy Exchange improve asset allocation of Chinese petrochemical-related stocks?," International Review of Financial Analysis, Elsevier, vol. 71(C).
    6. Fiess, Norbert M & MacDonald, Ronald, 2002. "Towards the fundamentals of technical analysis: analysing the information content of High, Low and Close prices," Economic Modelling, Elsevier, vol. 19(3), pages 353-374, May.
    7. Agnolucci, Paolo, 2009. "Volatility in crude oil futures: A comparison of the predictive ability of GARCH and implied volatility models," Energy Economics, Elsevier, vol. 31(2), pages 316-321, March.
    8. Wang, Jianli & Qiu, Shushu & Yick, Ho Yin, 2022. "The influence of the Shanghai crude oil futures on the global and domestic oil markets," Energy, Elsevier, vol. 245(C).
    9. Wenbo Wu & Jiaqi Chen & Liang Xu & Qingyun He & Michael L. Tindall, 2019. "A statistical learning approach for stock selection in the Chinese stock market," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 5(1), pages 1-18, December.
    10. Wei, Yu & Wang, Yizhi & Vigne, Samuel A. & Ma, Zhenyu, 2023. "Alarming contagion effects: The dangerous ripple effect of extreme price spillovers across crude oil, carbon emission allowance, and agriculture futures markets," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 88(C).
    11. Stanislav Radchenko, 2005. "The Long-Run Forecasting of Energy Prices Using the Model of Shifting Trend," Econometrics 0502002, University Library of Munich, Germany.
    12. Xiaofei Wu & Hailong Miao & Shuzhen Zhu & Xin Li, 2022. "Study on the optimal hedging ratio of Shanghai crude oil futures based on Copula models," Asia-Pacific Journal of Accounting & Economics, Taylor & Francis Journals, vol. 29(6), pages 1657-1670, November.
    13. Sun, Yuying & Han, Ai & Hong, Yongmiao & Wang, Shouyang, 2018. "Threshold autoregressive models for interval-valued time series data," Journal of Econometrics, Elsevier, vol. 206(2), pages 414-446.
    14. Jiang, Zhe & Zhang, Lin & Zhang, Lingling & Wen, Bo, 2022. "Investor sentiment and machine learning: Predicting the price of China's crude oil futures market," Energy, Elsevier, vol. 247(C).
    15. Bin Li & Di Zhang & Yang Zhou, 2017. "Do trend following strategies work in Chinese futures markets?," Journal of Futures Markets, John Wiley & Sons, Ltd., vol. 37(12), pages 1226-1254, December.
    16. Bai, Lan & Wei, Yu & Zhang, Jiahao & Wang, Yizhi & Lucey, Brian M., 2023. "Diversification effects of China's carbon neutral bond on renewable energy stock markets: A minimum connectedness portfolio approach," Energy Economics, Elsevier, vol. 123(C).
    17. Wei, Yu & Wang, Yizhi & Lucey, Brian M. & Vigne, Samuel A., 2023. "Cryptocurrency uncertainty and volatility forecasting of precious metal futures markets," Journal of Commodity Markets, Elsevier, vol. 29(C).
    18. Huang, Yisu & Xu, Weiju & Huang, Dengshi & Zhao, Chenchen, 2023. "Chinese crude oil futures volatility and sustainability: An uncertainty indices perspective," Resources Policy, Elsevier, vol. 80(C).
    19. Yang, Yuying & Ma, Yan-Ran & Hu, Min & Zhang, Dayong & Ji, Qiang, 2021. "Extreme risk spillover between chinese and global crude oil futures," Finance Research Letters, Elsevier, vol. 40(C).
    20. Ballestra, Luca Vincenzo & Guizzardi, Andrea & Palladini, Fabio, 2019. "Forecasting and trading on the VIX futures market: A neural network approach based on open to close returns and coincident indicators," International Journal of Forecasting, Elsevier, vol. 35(4), pages 1250-1262.
    21. Yu, Zhuoxi & Qin, Lu & Chen, Yunjing & Parmar, Milan Deepak, 2020. "Stock price forecasting based on LLE-BP neural network model," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 553(C).
    22. Lanza, Alessandro & Manera, Matteo & Giovannini, Massimo, 2005. "Modeling and forecasting cointegrated relationships among heavy oil and product prices," Energy Economics, Elsevier, vol. 27(6), pages 831-848, November.
    23. Sun, Chuanwang & Min, Jialin & Sun, Jiacheng & Gong, Xu, 2023. "The role of China's crude oil futures in world oil futures market and China's financial market," Energy Economics, Elsevier, vol. 120(C).
    24. Prasanth, Sikakollu & Singh, Uttam & Kumar, Arun & Tikkiwal, Vinay Anand & Chong, Peter H.J., 2021. "Forecasting spread of COVID-19 using google trends: A hybrid GWO-deep learning approach," Chaos, Solitons & Fractals, Elsevier, vol. 142(C).
    25. Zhao, Yang & Li, Jianping & Yu, Lean, 2017. "A deep learning ensemble approach for crude oil price forecasting," Energy Economics, Elsevier, vol. 66(C), pages 9-16.
    26. Xu Gong & Keqin Guan & Qiyang Chen, 2022. "The role of textual analysis in oil futures price forecasting based on machine learning approach," Journal of Futures Markets, John Wiley & Sons, Ltd., vol. 42(10), pages 1987-2017, October.
    27. LI, Jie & HUANG, Lixin & LI, Ping, 2021. "Are Chinese crude oil futures good hedging tools?," Finance Research Letters, Elsevier, vol. 38(C).
    28. Tan, Xue-Ping & Wang, Xin-Yu, 2017. "Dependence changes between the carbon price and its fundamentals: A quantile regression approach," Applied Energy, Elsevier, vol. 190(C), pages 306-325.
    29. Wei, Yu & Zhang, Jiahao & Bai, Lan & Wang, Yizhi, 2023. "Connectedness among El Niño-Southern Oscillation, carbon emission allowance, crude oil and renewable energy stock markets: Time- and frequency-domain evidence based on TVP-VAR model," Renewable Energy, Elsevier, vol. 202(C), pages 289-309.
    30. Chao Deng & Liang Ma & Taishan Zeng, 2021. "Crude Oil Price Forecast Based on Deep Transfer Learning: Shanghai Crude Oil as an Example," Sustainability, MDPI, vol. 13(24), pages 1-13, December.
    31. Lu, Xinjie & Ma, Feng & Wang, Jiqian & Wang, Jianqiong, 2020. "Examining the predictive information of CBOE OVX on China’s oil futures volatility: Evidence from MS-MIDAS models," Energy, Elsevier, vol. 212(C).
    32. AlKathiri, Nader & Al-Rashed, Yazeed & Doshi, Tilak K. & Murphy, Frederic H., 2017. "“Asian premium” or “North Atlantic discount”: Does geographical diversification in oil trade always impose costs?," Energy Economics, Elsevier, vol. 66(C), pages 411-420.
    33. Huang, Wenyang & Wang, Huiwen & Qin, Haotong & Wei, Yigang & Chevallier, Julien, 2022. "Convolutional neural network forecasting of European Union allowances futures using a novel unconstrained transformation method," Energy Economics, Elsevier, vol. 110(C).
    34. Zhang, Jin-Liang & Zhang, Yue-Jun & Zhang, Lu, 2015. "A novel hybrid method for crude oil price forecasting," Energy Economics, Elsevier, vol. 49(C), pages 649-659.
    35. Fischer, Thomas & Krauss, Christopher, 2018. "Deep learning with long short-term memory networks for financial market predictions," European Journal of Operational Research, Elsevier, vol. 270(2), pages 654-669.
    36. Ye, Michael & Zyren, John & Shore, Joanne, 2005. "A monthly crude oil spot price forecasting model using relative inventories," International Journal of Forecasting, Elsevier, vol. 21(3), pages 491-501.
    37. Kok Choon Tay & Calvin M. L. Chan, 2021. "Digital Transformation of Banks: The Case of DBS," World Scientific Book Chapters, in: David Kuo Chuen Lee & Ding Ding & Chong Guan (ed.), Financial Management in the Digital Economy, chapter 8, pages 141-161, World Scientific Publishing Co. Pte. Ltd..
    38. Jammazi, Rania & Aloui, Chaker, 2012. "Crude oil price forecasting: Experimental evidence from wavelet decomposition and neural network modeling," Energy Economics, Elsevier, vol. 34(3), pages 828-841.
    39. Robert S. Pindyck, 1999. "The Long-Run Evolutions of Energy Prices," The Energy Journal, International Association for Energy Economics, vol. 0(Number 2), pages 1-27.
    40. , Yangriani, 2021. "Yangriani - Managing Digital Transformation - GSLC 1," OSF Preprints 4btj6, Center for Open Science.
    41. Mann, Janelle & Sephton, Peter, 2016. "Global relationships across crude oil benchmarks," Journal of Commodity Markets, Elsevier, vol. 2(1), pages 1-5.
    42. , Darmadi & Sari, Ratna, 2021. "Gaya Kepemimpinan Transformasional dan Motivasi Kerja," Thesis Commons 8zeh9, Center for Open Science.
    43. Michael A Kelly & Steven P Clark, 2011. "Returns in trading versus non-trading hours: The difference is day and night," Journal of Asset Management, Palgrave Macmillan, vol. 12(2), pages 132-145, June.
    44. Christian L Dunis & Jason Laws & Jozef Rudy, 2011. "Profitable mean reversion after large price drops: A story of day and night in the S&P 500, 400 MidCap and 600 SmallCap Indices," Journal of Asset Management, Palgrave Macmillan, vol. 12(3), pages 185-202, August.
    45. Bekiroglu, Korkut & Duru, Okan & Gulay, Emrah & Su, Rong & Lagoa, Constantino, 2018. "Predictive analytics of crude oil prices by utilizing the intelligent model search engine," Applied Energy, Elsevier, vol. 228(C), pages 2387-2397.
    46. Sun, Shaolong & Sun, Yuying & Wang, Shouyang & Wei, Yunjie, 2018. "Interval decomposition ensemble approach for crude oil price forecasting," Energy Economics, Elsevier, vol. 76(C), pages 274-287.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Sun, Shaolong & Sun, Yuying & Wang, Shouyang & Wei, Yunjie, 2018. "Interval decomposition ensemble approach for crude oil price forecasting," Energy Economics, Elsevier, vol. 76(C), pages 274-287.
    2. Hu, Genhua & Jiang, Haifeng, 2023. "Time-varying jumps in China crude oil futures market impacted by COVID-19 pandemic," Resources Policy, Elsevier, vol. 82(C).
    3. Lang, Korbinian & Auer, Benjamin R., 2020. "The economic and financial properties of crude oil: A review," The North American Journal of Economics and Finance, Elsevier, vol. 52(C).
    4. Zhang, Jiaming & Guo, Songlin & Dou, Bin & Xie, Bingyuan, 2023. "Evidence of the internationalization of China's crude oil futures: Asymmetric linkages to global financial risks," Energy Economics, Elsevier, vol. 127(PA).
    5. Guo, Lili & Huang, Xinya & Li, Yanjiao & Li, Houjian, 2023. "Forecasting crude oil futures price using machine learning methods: Evidence from China," Energy Economics, Elsevier, vol. 127(PA).
    6. Lin, Ling & Jiang, Yong & Xiao, Helu & Zhou, Zhongbao, 2020. "Crude oil price forecasting based on a novel hybrid long memory GARCH-M and wavelet analysis model," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 543(C).
    7. Liu, Min & Lee, Chien-Chiang, 2021. "Capturing the dynamics of the China crude oil futures: Markov switching, co-movement, and volatility forecasting," Energy Economics, Elsevier, vol. 103(C).
    8. Wang, Minggang & Zhao, Longfeng & Du, Ruijin & Wang, Chao & Chen, Lin & Tian, Lixin & Eugene Stanley, H., 2018. "A novel hybrid method of forecasting crude oil prices using complex network science and artificial intelligence algorithms," Applied Energy, Elsevier, vol. 220(C), pages 480-495.
    9. Wang, Bin & Wang, Jun, 2020. "Energy futures and spots prices forecasting by hybrid SW-GRU with EMD and error evaluation," Energy Economics, Elsevier, vol. 90(C).
    10. Manel Hamdi & Chaker Aloui, 2015. "Forecasting Crude Oil Price Using Artificial Neural Networks: A Literature Survey," Economics Bulletin, AccessEcon, vol. 35(2), pages 1339-1359.
    11. Cortazar, Gonzalo & Ortega, Hector & Valencia, Consuelo, 2021. "How good are analyst forecasts of oil prices?," Energy Economics, Elsevier, vol. 102(C).
    12. Nademi, Arash & Nademi, Younes, 2018. "Forecasting crude oil prices by a semiparametric Markov switching model: OPEC, WTI, and Brent cases," Energy Economics, Elsevier, vol. 74(C), pages 757-766.
    13. Qi Zhang & Yi Hu & Jianbin Jiao & Shouyang Wang, 2022. "Exploring the Trend of Commodity Prices: A Review and Bibliometric Analysis," Sustainability, MDPI, vol. 14(15), pages 1-22, August.
    14. Matteo Manera & Chiara Longo & Anil Markandya & Elisa Scarpa, 2007. "Evaluating the Empirical Performance of Alternative Econometric Models for Oil Price Forecasting," Working Papers 2007.4, Fondazione Eni Enrico Mattei.
    15. Yuanrong Wang & Yinsen Miao & Alexander CY Wong & Nikita P Granger & Christian Michler, 2023. "Domain-adapted Learning and Interpretability: DRL for Gas Trading," Papers 2301.08359, arXiv.org, revised Sep 2023.
    16. Wu, Chunying & Wang, Jianzhou & Hao, Yan, 2022. "Deterministic and uncertainty crude oil price forecasting based on outlier detection and modified multi-objective optimization algorithm," Resources Policy, Elsevier, vol. 77(C).
    17. Huang, Wenyang & Wang, Huiwen & Qin, Haotong & Wei, Yigang & Chevallier, Julien, 2022. "Convolutional neural network forecasting of European Union allowances futures using a novel unconstrained transformation method," Energy Economics, Elsevier, vol. 110(C).
    18. Wu, Yu-Xi & Wu, Qing-Biao & Zhu, Jia-Qi, 2019. "Improved EEMD-based crude oil price forecasting using LSTM networks," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 516(C), pages 114-124.
    19. Marcus Vinicius Santos & Fernando Morgado-Dias & Thiago C. Silva, 2023. "Oil Sector and Sentiment Analysis—A Review," Energies, MDPI, vol. 16(12), pages 1-29, June.
    20. Jiang Wu & Yu Chen & Tengfei Zhou & Taiyong Li, 2019. "An Adaptive Hybrid Learning Paradigm Integrating CEEMD, ARIMA and SBL for Crude Oil Price Forecasting," Energies, MDPI, vol. 12(7), pages 1-23, April.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:eee:eneeco:v:127:y:2023:i:pa:s0140988323006047. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Catherine Liu (email available below). General contact details of provider: http://www.elsevier.com/locate/eneco .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.