<div dir="ltr">Boa tarde,<div><br></div><div>Eu estava verificando os diferentes modos de coletar dados intraday do yahoo e percebi que para cada função que eu uso, os dados obtidos são diferentes.</div><div><br></div><div>Por exemplo, se eu uso:</div><div><br></div><div>dados <- readLines('<a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a>',sep = ",", dec = ".")<br></div><div><br></div><div>eu obtenho:</div><div><div>"18" "1427203800,127.1800,127.2600,127.0000,127.2300,631900"</div><div>"19" "1427203868,126.9200,127.1900,126.8750,127.1700,202000"</div><div>"20" "1427203920,126.9600,127.0600,126.8700,126.9100,189500"</div><div>"21" "1427203981,126.9500,126.9900,126.8800,126.8900,198200"</div><div>"22" "1427204099,126.7799,126.9900,126.7700,126.9500,217500"</div><div>"23" "1427204100,126.6700,126.9000,126.6401,126.7799,286300"</div><div>"24" "1427204219,126.7100,126.8000,126.6500,126.6800,222800"</div><div>"25" "1427204221,126.8300,126.8700,126.5600,126.7000,238500"</div><div>"26" "1427204280,126.7100,126.9200,126.6700,126.8200,167500"</div><div>"27" "1427204340,126.8300,126.9300,126.7000,126.7166,114900"</div><div>"28" "1427204457,126.6400,126.8300,126.6000,126.8100,156100"</div><div>"29" "1427204460,126.6500,126.7900,126.6385,126.6900,102800"</div></div><div><br></div><div>se eu uso:</div><div>dados <- getURL('<a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a>',sep = ",", dec = ".")<br></div><div>obtenho:</div><div><br></div><div><div>1427203805,127.1900,127.2600,127.0796,127.2000,626100</div><div>1427203862,126.9200,127.1900,126.8750,127.1800,207800</div><div>1427203979,126.9000,127.0600,126.8700,126.9100,198000</div><div>1427203980,126.9500,126.9900,126.8800,126.9000,172200</div><div>1427204099,126.7799,126.9900,126.7700,126.9500,235000</div><div>1427204100,126.6700,126.9000,126.6401,126.7799,286300</div><div>1427204219,126.7100,126.8000,126.6500,126.6800,222800</div><div>1427204221,126.8300,126.8700,126.5600,126.7000,238500</div><div>1427204280,126.7100,126.9200,126.6700,126.8200,167500</div><div>1427204340,126.8300,126.9300,126.7000,126.7166,114900</div><div>1427204459,126.6915,126.8300,126.6100,126.8100,160900</div><div>1427204460,126.6500,126.7900,126.6385,126.6900,98000</div></div><div><br></div><div>Usando read.csv também dá dados diferentes de começo.</div><div><br></div><div>Alguem saberia me dizer o por que? E em qual devo confiar? Porque nenhuma é igualzinha ao que aparece quando você coloca esse endereço <a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a> no navegador. O resultado deste é:</div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">1427203800,127.1200,127.2300,127.0000,127.2300,631900
1427203900,127.0300,127.1900,127.0000,127.1700,87400
1427203978,126.9200,127.0400,126.8700,126.9050,309600
1427204038,126.9600,126.9900,126.8800,126.9399,174900
1427204099,126.7799,126.9900,126.7700,126.9600,235300
1427204100,126.6700,126.9000,126.6401,126.7799,286300
1427204219,126.7100,126.8000,126.6500,126.6800,222800
1427204221,126.8300,126.8700,126.5600,126.7000,238500
1427204280,126.7100,126.9200,126.6700,126.8200,167500
1427204340,126.8300,126.9300,126.7000,126.7166,114900
1427204459,126.6915,126.8300,126.6000,126.8100,160900
1427204460,126.6500,126.7900,126.6385,126.6900,98000
1427204520,126.7100,126.7200,126.6000,126.6500,108700
1427204581,126.7100,126.8400,126.6800,126.7100,129600
1427204641,126.7400,126.7700,126.6600,126.7300,98700</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">Obrigada,</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">Michelle</pre></div><div><br></div></div>