필터 지우기
필터 지우기

How to extract data from fints using time and NOT dates

조회 수: 3 (최근 30일)
Adhish Aggarwal
Adhish Aggarwal 2018년 3월 1일
댓글: Walter Roberson 2018년 3월 1일
I have stock price intra minute data from 09:15 AM to 3:30 PM for last 5 years with dates in fints format. I want to extract data from 09:45 AM to 3:30 PM for all the dates. How can I do it?

채택된 답변

Walter Roberson
Walter Roberson 2018년 3월 1일
datevec() and look at the 4th and 5th columns of the results to decide which are in the desired range.
  댓글 수: 2
Adhish Aggarwal
Adhish Aggarwal 2018년 3월 1일
Could you elaborate how to do it?
Walter Roberson
Walter Roberson 2018년 3월 1일
Suppose your fints obj is named FT. Then
DV = datevec(FT.dates);
mask = (DV(:,4) == 9 & DV(:,5) >= 15) | (DV(:,4) >= 10 & DV(:,4) <= 14) | (DV(:,4) == 15 && DV(:,5) <= 30);
extracted_FT = FT(mask);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by