亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? get_tickers_data.m

?? This a simple algorithm that downloads all most updated data from the stocks in the SP500 index, for
?? M
字號:
%{
Script for Bringing yahoo SP500 (date=01/07/2007) stocks Data into Matlab Workspace

This is a simple algorithm that downloads all most updated data from the
stocks in the SP500 index, for as many day you want and for different frequencies (dailly,
weeklly and monthly). 

The main advantage of this function is that it controls for bad data or for
the cases where yahoo server doesn't have the data you want. You can also set a
critera for bad data (eg. missing 5% of valid prices, when comparing to a full date ticker).
When bad data is found, the function skips that particular asset.

It is basicly a large scale application of sqq.m which is originally submited by
Michael Boldin, link:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4069&objectType=file

The sqq.m works beautifully. Thanks Michael.

The steps are:

1) Get SP500 tickers from tickers.txt (you can change this file for you own purpose)
1) Download data using sqq() (controlling for bad data and missing prices)
2) Substitute values of 0 (price=0) for the most closest previous price
(this way you set return on that date = 0. This substitution shouldn't happen
much. You can control the filter for this event by using a reasonable value for variable Critera)

Please notes that SP500 changes composition over time. The composition 
for the function is from 01-july-07. I'm trying to set a solution for this
(any suggestions are welcome..)

INPUT:

    n_days_back - Integer. Number of days to go back (including weekends and holidays)

    n_stocks    - Number of stocks which to get data from sp500 (in the same order as ticker.txt)

    Freq        - (optional,default='d'). Frequency of data. Options: 'd' dailly, 'w' weekly, 'm', monthlly

    Criteria    - (optional, default=.05). The percentage of a full valid price vector (from a valid ticker eg. IBM)
                  that will set how many missing prices is enough to set bad data event (and cut such stock
                  from the downloaded database.

OUTPUT:

    SPData - A structure with the folowning fields:

    Date
    Close
    Open
    High
    Low
    Volume
    Closeadj
    Valid_Tickers - The downloaded valid tickers (those with enough valid prices and no yahoo problems)

    In such matrices, each collum represents each asset

Author: Marcelo Scherer Perlin
Email:  marceloperlin@gmail.com
Phd Student in finance ICMA/UK (Starting october 2007)
Created: July/2007

Fell free to use it and/or modify it for your own interest.

Any comments are welcome, if you have a suggestion that will significantly
improve the code, please write it and send it to me. If the changes are interesting,
I'll repost the file with full aknowledgements.

%}

function [SPData]=Get_Tickers_Data(n_days_back,n_stocks,Freq,P_Criteria)
    
    addpath([pwd,'\sqq_msp']);    
    
    if nargin()<2
        error('The function needs at least 2 inputs');
    end
    
    if nargin()==2
        Freq='d';
        P_Criteria=.05;
    end
    
    if nargin()==3
        P_Criteria=.05;
    end
        
    if (exist('tickers.txt','file'))==0
        error('The required tickers.txt file was not found at working directory. Please check it.');
    end
    
    if n_days_back<0||n_stocks<0||P_Criteria<0
        error('The inputs n_days, n_stocks and Criteria should be all positive');
    end
    
    if P_Criteria>1
        error('The input Criteria is a percentage and therefore lower than 1');
    end
    
    % Getting ticker from ticker.txt
    
    fid = fopen('tickers.txt', 'r');
    a=textscan(fid, '%s','delimiter',' ');
    fclose(fid);

    tickers=a{1,1};

    fprintf(1,'\nDownloading IBM stock for Date comparisons <-');
    
    % Downloading IBM for date comparinson (from my tests IBM is a reliable
    % stock regarding dates)
    
    try
        first_out=sqq_msp('ibm',today-n_days_back,today,Freq);
    catch
        error('Problem with downloading the IBM stock for dates comparison. Please check internet conection and try again..');
    end
    
    % creting Criteria for bad data. When number of missing prices is higher than Criteria, 
    % then the stock is removed from database
    
    Criteria=floor(P_Criteria*length(first_out));
    
    fprintf(1,['Download complete:\n First Date in data -> ',datestr(first_out(1,1)),'\n Last  Date in data -> ',datestr(first_out(end,1))])
    fprintf(1,['\nCriteria for bad data is: ',num2str(Criteria),' missing prices.\n']);

    Date(:,1)=first_out(:,1);

    fprintf(1,'\n-> Starting Yahoo Downloads <-');

    idx=0;
    for i=1:n_stocks
        try
            fprintf(1,['\nAsset #',num2str(i),' - Ticker: ',tickers{i},' --> ']);
            
            out=sqq_msp(tickers{i},today-n_days_back,today,Freq);
            
            if size(out,1)==size(first_out(:,1),1) % cases where the dates match

                idx=idx+1;

                Date(:,idx)=out(:,1);
                Close(:,idx)=out(:,2);
                Open(:,idx)=out(:,3);
                Low(:,idx)=out(:,4);
                High(:,idx)=out(:,5);
                Volume(:,idx)=out(:,6);
                Closeadj(:,idx)=out(:,7);

                fprintf(1,'DL OK. Dates fully matching.');
                Valid_Tickers{1,idx}=tickers{i};
                
            elseif (length(first_out(:,1))-length(out(:,7)))<Criteria % cases where the dates DONT match

                idx=idx+1;

                for j=1:size(out,1) % this loop will set all prices according to matching dates of valid ticker (in this case IBM)

                    [a]=find(out(j,1)==Date(:,1));

                    Date(a,idx)=out(j,1);
                    Close(a,idx)=out(j,2);
                    Open(a,idx)=out(j,3);
                    Low(a,idx)=out(j,4);
                    High(a,idx)=out(j,5);
                    Volume(a,idx)=out(j,6);
                    Closeadj(a,idx)=out(j,7);

                end

                fprintf(1,['DL OK, but is missing ',num2str(length(first_out(:,1))-length(out(:,7))),' price(s)']);
                Valid_Tickers{1,idx}=tickers{i};

            else
                fprintf(1,'DL OK, but number of missing prices is higher than criteria. Skipping this one.');
            end

        catch
            fprintf(1,'Problem with yahoo Data, skipping this one');
            continue
        end
    end

    % fixing cases where the first price = 0 (this would be a problem in the
    % substituion part
    
    [a]=find(Close(1,:)==0);

    for j=1:size(a,2)
        for i=1:size(Close,1)
            if Close(i,j)~=0

                Close(1,a(j))=Close(i,j);
                Closeadj(1,a(j))=Closeadj(i,j);
                High(1,a(j))=High(i,j);
                Low(1,a(j))=Low(i,j);
                Open(i,a(j))=Open(i,j);

                break;
            end
        end

    end
    
    % Replacing prices = 0 with the oldest availabe price
    
    for i=2:size(Close,1)
        for j=1:size(Close,2)
            if Close(i,j)==0

                Close(i,j)=Close(i-1,j);
                Closeadj(i,j)=Closeadj(i-1,j);
                High(i,j)=High(i-1,j);
                Low(i,j)=Low(i-1,j);
                Open(i,j)=Open(i-1,j);

            end
        end
    end
    
    % Saving it all in the structure

    SPData.Close=Close;
    SPData.Closeadj=Closeadj;
    SPData.Date=Date;
    SPData.Open=Open;
    SPData.Volume=Volume;
    SPData.Low=Low;
    SPData.High=High;
    SPData.Valid_Tickers=Valid_Tickers;
    
    fprintf(1,'\n');

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国产免费看| 国产精品亚洲专一区二区三区 | 国产拍揄自揄精品视频麻豆| 91精品麻豆日日躁夜夜躁| 91日韩精品一区| 91蜜桃传媒精品久久久一区二区| 丁香婷婷深情五月亚洲| 97精品电影院| 99综合影院在线| 99久久777色| 91福利在线导航| 欧美三区在线视频| 欧美精品第1页| 日韩午夜精品电影| 26uuu欧美| 中文字幕乱码久久午夜不卡 | 一区二区成人在线| 亚洲福中文字幕伊人影院| 亚洲成人你懂的| 久久福利资源站| 国产69精品久久777的优势| av在线不卡免费看| 欧美在线观看一区二区| 91精品国产色综合久久不卡蜜臀| 日韩欧美一级二级三级 | 粉嫩av亚洲一区二区图片| av中文字幕一区| 欧美日韩中文精品| 日韩欧美在线综合网| 日本一区二区三区在线不卡| 国产精品久久久久影院亚瑟| 一区二区三区中文字幕精品精品| 天天射综合影视| 国产成人精品三级麻豆| 欧美一区二区三区视频在线观看| 欧美mv日韩mv国产网站| 中文字幕免费不卡在线| 亚洲综合视频在线观看| 精品一区二区在线观看| 色久综合一二码| 精品国产一区二区亚洲人成毛片| 亚洲日本在线a| 国内久久婷婷综合| 在线精品视频免费播放| 337p日本欧洲亚洲大胆色噜噜| 日韩美女精品在线| 久久成人免费电影| 欧美特级限制片免费在线观看| 26uuu成人网一区二区三区| 亚洲一区二区三区四区不卡| 国产精品一二三四| 欧美剧在线免费观看网站| 中文字幕欧美区| 日韩1区2区3区| 色94色欧美sute亚洲线路一ni| 久久影院午夜论| 日本中文字幕一区二区视频| 91一区一区三区| 国产精品天干天干在观线| 精品一区二区三区的国产在线播放| 91国产丝袜在线播放| 国产精品第一页第二页第三页| 奇米一区二区三区av| 在线日韩国产精品| 亚洲柠檬福利资源导航| 成人av中文字幕| 久久网站热最新地址| 美女视频网站久久| 3atv在线一区二区三区| 婷婷开心久久网| 欧美日韩国产首页在线观看| 一区二区三区四区中文字幕| 成人国产精品免费观看动漫| 久久久精品国产免大香伊| 精品一区二区免费| 欧美精品一区二区三区蜜桃| 免费在线观看一区| 欧美一区二区三区在线观看 | 久久青草国产手机看片福利盒子| 免费三级欧美电影| 91精品国产麻豆国产自产在线| 午夜国产精品一区| 91精品国产91久久久久久一区二区 | 久久综合色之久久综合| 裸体健美xxxx欧美裸体表演| 91精品国产色综合久久不卡蜜臀 | 欧美日韩国产精品成人| 亚洲成人黄色影院| 欧美视频一区二区三区四区 | 日本强好片久久久久久aaa| 欧美精品欧美精品系列| 日本aⅴ精品一区二区三区 | 久久精品欧美一区二区三区不卡| 国产精品一区二区你懂的| 国产欧美一区二区在线观看| 国产99久久精品| 一区二区三区四区激情| 欧美三区在线视频| 久久99精品久久只有精品| 久久九九久久九九| 成人毛片视频在线观看| 亚洲午夜av在线| 91精品国产91久久久久久一区二区 | 亚洲国产另类av| 日韩免费高清电影| 日韩一区二区三区三四区视频在线观看| 日本在线不卡视频| 中文字幕免费观看一区| 欧美美女bb生活片| 国产精品一区二区视频| 一区二区三区四区av| 91精品国产欧美日韩| a在线播放不卡| 香蕉加勒比综合久久| 久久久久久久久99精品| 色婷婷久久综合| 紧缚奴在线一区二区三区| 亚洲色图一区二区| 日韩免费电影网站| 91一区二区在线| 久久精品久久精品| 亚洲欧美韩国综合色| 欧美成人精品福利| 欧美在线观看视频在线| 国产乱码精品一区二区三区av| 亚洲视频在线一区观看| 精品国免费一区二区三区| 91亚洲精品乱码久久久久久蜜桃| 蜜桃av噜噜一区| 一区二区三区中文字幕电影| 久久精品一区二区三区不卡牛牛 | 日韩av高清在线观看| 亚洲人成在线观看一区二区| 久久蜜桃香蕉精品一区二区三区| 欧美午夜片在线看| 波多野结衣在线一区| 国产一区二区三区免费播放| 五月开心婷婷久久| 亚洲制服丝袜av| 国产精品久久精品日日| 久久久国产一区二区三区四区小说| 欧美肥胖老妇做爰| 色国产综合视频| 99v久久综合狠狠综合久久| 国产老女人精品毛片久久| 日韩国产精品久久| 五月天网站亚洲| 亚洲精品成人在线| 亚洲欧美日韩国产成人精品影院| 久久精品亚洲精品国产欧美| 亚洲精品在线网站| 日韩女优av电影| 精品国免费一区二区三区| 欧美片网站yy| 欧美一级搡bbbb搡bbbb| 欧美日韩1234| 69精品人人人人| 欧美一区二区私人影院日本| 欧美精品18+| 久久久久一区二区三区四区| 精品国产精品网麻豆系列| 欧美大片在线观看一区二区| 精品国产一二三| 久久精品网站免费观看| 欧美高清在线一区| 中文字幕视频一区| 一区二区高清视频在线观看| 亚洲一二三四区不卡| 三级在线观看一区二区| 免费成人在线观看| 久久精品国产在热久久| 国产一区二区三区蝌蚪| 成人深夜视频在线观看| 99国产麻豆精品| 欧美日韩的一区二区| 日韩视频一区二区在线观看| 久久久久久久久久久久电影| 国产精品欧美久久久久无广告| 亚洲欧美日韩电影| 视频一区在线播放| 国产乱对白刺激视频不卡| 99久久99久久免费精品蜜臀| 欧美午夜影院一区| 精品美女一区二区| 亚洲三级理论片| 日日夜夜一区二区| 国产传媒日韩欧美成人| 91福利视频久久久久| 日韩欧美一二三| 亚洲青青青在线视频| 美腿丝袜一区二区三区| 成人精品在线视频观看| 欧美片网站yy| 国产精品久久久久久久午夜片 | 日本视频免费一区| 丁香五精品蜜臀久久久久99网站 | 亚洲精品在线免费观看视频| 国产精品色哟哟| 久久精品久久久精品美女| 91香蕉视频污|