|
发表于 2017-1-16 01:15 PM
|
显示全部楼层
本帖最后由 xinxing 于 2017-1-16 01:37 PM 编辑
5883 发表于 2017-1-15 11:07 PM
先谢!
自己采集股票的数据,你从哪里下?有可靠的周线数据吗?
(1)从Google Fiance或Yahoo Finance都可以下载。
(2)当然有可靠的周线数据。Google Fiance或Yahoo Finance都可以精确到每分钟,甚至15秒。
比如:在你的浏览器地址处CopyAndPaste:
https://www.google.com/finance/getprices?i=60&p=15d&f=d,o,h,l,c,v&df=cpct&q=SVXY
你会得到SVXY这只股票15天内每分钟的价格和VOLUME。
(3)我使用是CROSS-PLATFORM包括Linux, Windows, MAC,和Android等。
(4)发邮件/msg通知:
HOST:smtp.gmail.com
PORT:465
class Smtp : public QObject
{
Q_OBJECT
public:
Smtp(const QString &user, const QString &pass,
const QString &host = "smtp.gmail.com", int port = 465, int timeout = 30000,
QObject *parent = 0);
~Smtp();
void sendMail( const QString &from, const QString &to,
const QString &subject, const QString &body,
QStringList files = QStringList());
...
}
我采用的是:socket = new QSslSocket(this);
文体格式是:
msg = "To: <" + to + ">\n";
msg.append("From: " + from + "\n");
msg.append("Subject: " + subject + "\n");
//Let's intitiate multipart MIME with cutting boundary "frontier"
msg.append("MIME-Version: 1.0\n");
msg.append("Content-Type: multipart/mixed; boundary=frontier\n\n");
msg.append( "--frontier\n" );
msg.append( "Content-Type: text/html\n\n" );
//msg.append( "Content-Type: text/plain\n\n" );
msg.append(body);
msg.append("\n\n");
发送:
socket->connectToHostEncrypted(host, port); //"smtp.gmail.com" and 465 for gmail TLS
if (!socket->waitForConnected(timeout)) {
qDebug() << socket->errorString();
}
os = new QTextStream(socket);
...
else if (state == HandShake && responseLine == "250")
{
socket->startClientEncryption();
if(!socket->waitForEncrypted(timeout))
{
qDebug() << socket->errorString();
state = Close;
}
os->flush();
state = Auth;
}
如果是Verizon phone company:
To: 1231234567@vzwpix.com
(这里的数字就是你的电话号码,你就会收到TEXT Message)
|
评分
-
1
查看全部评分
-
|