http://iss.moex.com/iss/history/engines/stock/markets/shares/securities/VTBR?start=7074
BOARDID TRADEDATE SHORTNAME SECID NUMTRADES VOLUME TQBR 2017-11-14 ВТБ ао VTBR 23084 1425379000 TQBR 2017-11-15 ВТБ ао VTBR 33610 1679410670 TQBR 2017-11-16 ВТБ ао VTBR 93282 5883167793
INDEX TOTAL PAGESIZE 7074 7084 100Стартовую запись взял 7074, тк вижу, что всего доступно 7084 записи.
http://iss.moex.com/iss/history/engines/stock/markets/shares/securities/VTBR?sort_order=VOLUME&sort_order_desc=desc&limit=10
BID TRADEDATE SNAME SECID NTRADES VALUE OPEN LOW HIGH LPRICE WPRICE CLOSE VOLUME EQNL 2009-09-16 ВТБ ао VTBR 55197 11615264541.8 0.0499 0.0497 0.0575 0.0556 0.0543 0.0557 214096623000 EQNL 2009-09-17 ВТБ ао VTBR 58669 11853715662.5 0.0575 0.053 0.0601 0.0541 0.0564 0.0541 210269503000 EQNL 2009-05-12 ВТБ ао VTBR 51996 9397913609 0.0407 0.0407 0.0473 0.0459 0.0454 0.046 207105091000 EQNL 2009-06-02 ВТБ ао VTBR 48507 10044073414.4 0.0489 0.0462 0.0527 0.0485 0.0491 0.0485 204761693000 EQNL 2009-05-13 ВТБ ао VTBR 53394 9123375200.6 0.0474 0.041 0.0502 0.0427 0.0456 0.0424 199864841000 EQNL 2009-09-18 ВТБ ао VTBR 43421 9434605719.1 0.0533 0.0523 0.0582 0.0571 0.0552 0.0571 170847486000 EQNL 2013-02-14 ВТБ ао VTBR 76213 9596164339.8 0.05575 0.05566 0.05843 0.05645 0.05712 0.05647 168012610000 TQBR 2014-12-04 ВТБ ао VTBR 83147 8828243728.8 0.04929 0.04925 0.05516 0.052 0.05261 0.052 167807260000 TQBR 2014-12-16 ВТБ ао VTBR 64827 8939377257 0.0567 0.05211 0.06048 0.056 0.05613 0.056 159256200000 EQNL 2009-05-08 ВТБ ао VTBR 36907 6292186372.3 0.0363 0.0363 0.0423 0.0419 0.0396 0.0418 158809617000В итоге «бурный» день наврядли даже в первой 50-ке активных.
pw = pg.plot()
timer = pg.QtCore.QTimer()
def update():
pw.plot(x, y, clear=True)
timer.timeout.connect(update)
timer.start(100)conda update conda
conda update anaconda— добавляем рисовалку
conda install pyqtgraph— делаем первый чарт
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
# объявляем тип проги
app = QtGui.QApplication([])
# объявляем базовое окно
win = pg.GraphicsWindow()
# ... и даем ему заголовок
win.setWindowTitle('Мой Окно!')
# открываем первую панель для рисования
pane = win.addPlot()
# от балды значения по 'x' и 'y'
x = [1,2,3,4,5,6,7,8,9]
y = [1,4,9,16,25,36,49,64,81]
# нарисуем в панельке
pane.plot(x,y,pen=('r'), symbol='o')
# ...три...два...один...пуск .... п.ш..ш..ш :)
app.exec_()![#пора_граммировать [8] ... веселые картинки [0] #пора_граммировать [8] ... веселые картинки [0]](/uploads/images/00/83/40/2017/11/11/4375ce.png)
using System;
using System.Net;
using System.Text;
namespace AuthMoexSmpl
{
class Program
{
static void Main(string[] args)
{
string authLink = "https://passport.moex.com/authenticate";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(authLink);
request.ContentType = "text/plain; charset=utf-8";
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes("login:password")); //свои данные
request.PreAuthenticate = true;
request.CookieContainer = new CookieContainer();
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
for(int i=0; i < response.Headers.Count; ++i)
Console.WriteLine("\nHeader Name:{0}, Value :{1}",response.Headers.Keys[i],response.Headers[i]);
}
}
}D:\devel\net\AuthMoexSmpl>dotnet run Header Name:Cache-Control, Value :no-store, must-revalidate, no-cache, ma Header Name:Connection, Value :close Header Name:Date, Value :Fri, 10 Nov 2017 19:53:12 GMT Header Name:Pragma, Value :no-cache Header Name:ETag, Value :"xxxxxx" Header Name:Server, Value :nginx Header Name:Set-Cookie, Value :MicexPassportCert=xxxxxxx; domain=.moex.com; path=/, _passport_se m xxxxx; path=/; HttpOnly Header Name:Status, Value :200 OK Header Name:X-Runtime, Value :713 Header Name:X-Moex-Passport-Certificate, Value :xxxxxx Header Name:X-Powered-By, Value :Phusion Passenger 4.0.57 Header Name:Access-Control-Allow-Credentials, Value :true Header Name:Access-Control-Expose-Headers, Value :X-MicexPassport-Marker
using System;
using System.Net;
using System.Text;
namespace AuthMoexSmpl
{
class Program
{
static void Main(string[] args)
{
string authLink = "https://passport.moex.com/authenticate";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(authLink);
request.ContentType = "text/plain; charset=utf-8";
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes("login:password")); // вносим свои данные
request.PreAuthenticate = true;
request.CookieContainer = new CookieContainer();
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
foreach (Cookie cook in response.Cookies) {
Console.WriteLine("Cookie:");
Console.WriteLine("{0} = {1}", cook.Name, cook.Value);
Console.WriteLine("Domain: {0}", cook.Domain);
Console.WriteLine("Path: {0}", cook.Path);
Console.WriteLine("Port: {0}", cook.Port);
Console.WriteLine("Secure: {0}", cook.Secure);
Console.WriteLine("When issued: {0}", cook.TimeStamp);
Console.WriteLine("Expires: {0} (expired? {1})", cook.Expires, cook.Expired);
Console.WriteLine("Don't save: {0}", cook.Discard);
Console.WriteLine("Comment: {0}", cook.Comment);
Console.WriteLine("Uri for comments: {0}", cook.CommentUri);
Console.WriteLine("Version: RFC {0}" , cook.Version == 1 ? "2109" : "2965");
Console.WriteLine ("String: {0}", cook.ToString());
}
}
}
}D:\devel\net\AuthMoexSmpl>dotnet run Cookie: _passport_session = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx Domain: passport.moex.com Path: / Port: Secure: False When issued: 11.11.2017 01:55:42 Expires: 01.01.0001 00:00:00 (expired? False) Don't save: False Comment: Uri for comments: Version: RFC 2965 ...
reversed=1и оставить только строчку номер 15 в запросе
limit=1получим запрос вида
https://iss.moex.com/iss/engines/futures/markets/forts/securities/SiZ7/trades.json?reversed=1&limit=1Вариант автоматизации упрощенно:
using System;
using System.Net;
using System.IO;
using System.Text;
namespace GetLastPrice
{
class Program
{
static void Main(string[] args)
{
string newLine;
string[] lastLine;
string link = "https://iss.moex.com/iss/engines/futures/markets/forts/securities/SiZ7/trades.json?reversed=1&limit=1";
int count = 0;
for (;;) {
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(link);
request.ContentType = "text/plain; charset=utf-8";
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
using (Stream responseStream = response.GetResponseStream())
{
StreamReader sr = new StreamReader(responseStream, Encoding.UTF8);
while ((newLine = sr.ReadLine()) != null) {
if (count == 14) {
if (newLine =="") break;
else {
lastLine = newLine.Split(",");
Console.WriteLine("Volume is " + lastLine[6] +" at Price " + lastLine[5]);
}
}
count++;
}
}
count = 0;
response.Close();
}
}
}
}Производитель микрочипов Broadcom Ltd сделал предложение о покупке конкурента Qualcomm Inc более чем за $100 млрд, что может стать крупнейшей за всю историю сделкой в этой бурно развивающейся отрасли.
Broadcom, четвертый крупнейший производитель электронных микросхем в мире, базирующийся в США и Сингапуре, готов купить акции Qualcomm по $70 за штуку, что означает 28-процентную премию к цене закрытия прошлого четверга.