How does MATLAB calculate financial indicators?

조회 수: 7 (최근 30일)
Joseph Petrowski
Joseph Petrowski 2017년 4월 21일
답변: Kawee Numpacharoen 2017년 8월 8일
Hi,
I'm trying some basic inputs to get started in machine learning and finance. I am using the MACD and RSI as predictors in a classification model. I want to eliminate look-ahead bias.
When the MACD (or any other vector-input indicator) is calculated based on a vector of prices, does it include the price of its corresponding index in the calculation?
For example, if my input is a series of close prices, does the MACD calculated for 21 April include the close price of 21 April? Obviously, you wouldn't have the close price of the day you're trying to predict. Can I use the corresponding MACD vector, or will I need to backshift the results by one?
Thank you!

답변 (1개)

Kawee Numpacharoen
Kawee Numpacharoen 2017년 8월 8일
Instead of shifting all the predictors, you can just shift one response variable. Hope it helps

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by