フィルターのクリア

How to calculate spread with price at time t and bid and ask after t + 5 min?

1 回表示 (過去 30 日間)
NS
NS 2019 年 7 月 17 日
コメント済み: darova 2019 年 7 月 18 日
Hi
I have to calculate this spread measure wherein i have DATETIME column in format shown along with PRICE and BID and ASK rates. How to calculate S as given by formula for every minute -
S= PRICE(t) − [BID(t+5) + OFR(t+5) /2]
Also, there might be days in which not all minutes are available as there might be missing minutes.
Also, since i have to run this for each day separately using cell array with split dates how to do this using cell array function?
  2 件のコメント
NS
NS 2019 年 7 月 17 日
kindly reply?
darova
darova 2019 年 7 月 18 日
If you want to do this in MATLAB
n = length(BID)-5;
S = zeros(n,1);
for i = 1:n
S(i) = PRICE(i) - (BID(i+5)+OFR(i+5))/2;
end
But it easy to do in Excel. What do you think?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by