-
基于感知哈希的相似性图像检索
基于感知哈希中phash算法,汉明距离判别。进行图像检索,功能类似于百度/谷歌的以图搜图,不错的算法哦~
- 2020-12-02下载
- 积分:1
-
Building Trading Bots Using Java [2016]
Building Trading Bots Using JavaEnglish | 6 Jan. 2017 | ISBN: 1484225198 | 300 Pages | PDF | 6.22 MBBuild an automated currency trading bot from scratch with java. In this book, you will learn about the nitty-gritty of automated trading and have a closer look at Java, the Spring Framework, event-Building Trading Bots Using Javahekhar VarshneyGrangesSwitzerlandISBN13(pbk):978-1-4842-2519-6ISBN-13(electronic): 978-1-4842-2520-2DOI10.1007/978-1-4842-2520-2Library of Congress Control Number: 2016961228Copyright o 2016 by Shekhar VarshneyThis work is subject to copyright All rights are reserved by the Publisher, whether the wholeor part of the material is concerned, specifically the rights of translation, reprinting, reuse ofillustrations, recitation, broadcasting, reproduction on microfilms or in any other physicalway, and transmission or information storage and retrieval, electronic adaptation, computersoftware, or by similar or dissimilar methodology now known or hereafter developedTrademarked names, logos, and images may appear in this book. Rather than use a trademarksymbol with every occurrence of a trademarked name, logo, or image we use the names, logos,nd images only in an editorial fashion and to the benefit of the trademark owner, with nointention of infringement of the trademarkThe use in this publication of trade names, trademarks, service marks, and similar terms, even ifthey are not identified as such, is not to be taken as an expression of opinion as to whetheror notthey are subject to proprietary rightsWhile the advice and information in this book are believed to be true and accurate at thedate of publication, neither the authors nor the editors nor the publisher can accept any legalresponsibility for any errors or omissions that may be made. The publisher makes no warranty,express or implied, with respect to the material contained hereinManaging Director: Welmoed SpahrLead Editor: Steve AnglinEditorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black, Louise Corrigan,Jonathan gennick, Robert Hutchinson, Celestin Suresh John, Nikhil KarkalJames Markham, Susan McDermott, Matthew Moodie, Natalie Pao, Gwenan SpearingCoordinating Editor: Mark PowersCopy Editor: Kezia EndsleyCompositor: SPi GlobalIndexer: SPi GlobaArtist: SPi GlobalDistributed to the book trade worldwide by Springer Science+ Business Media New York,233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505e-mailorders-ny@springer-sbm.comorvisitwww.springeronline.com.ApressMedia,Llcisa California LlC and the sole member(owner) is Springer Science Business Media FinanceInc(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporationForinformationontranslationspleasee-mailrights@apress.comorvisitwww.apress.comApress and friends of ed books may be purchased in bulk for academic, corporate, or promotionaluse eBook versions and licenses are also available for most titles For more information referenceourSpecialbUlkSales-ebookLicensingwebpageatwww.apress.com/bulk-salesAny source code or other supplementary materials referenced by the author in this text areavailabletoreadersatwww.apress.com.Fordetailedinformationabouthowtolocateyourbookssourcecodegotowww.apress.com/source-code/.ReaderscanalsoaccesssourcecodeatSpringerlink in the Supplementary Material section for each chapter.Printed on acid-free paperedicated to the angels in my lifemy mother, my wife Preshita, and my two daughters Mihika and anyaLast but not the least, my college professor, Dr. Rajat Moona,who sowed the seeds of computer programming in my dnaContents at a glanceAbout the authorChapter 1: Introduction to Trading Bota.Chapter 2: Account Management27Chapter 3: Tradeable Instruments47Chapter 4: Event Streaming: Market Data EventsChapter 5: Historic Instrument Market Data aeEERaar75Chapter 6: Placing Orders and trades97Chapter 7: Event Streaming: Trade/Order/Account Events159Chapter 8: Integration with Twitter aamna■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■175Chapter 9: Implementing Strategies.am.203Chapter 10: Heartbeating ammmmmmmmmmmn 219Chapter 11: E-Mail Notifications ammmmatmmammmmmmmnmamman 231Chapter 12: Configuration, Deployment, and Running the Bot 243Chapter 13: Unit Testing■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■口■■■■■263Index…277ContentsAbout the author,i币Chapter 1: Introduction to Trading Bot m mmmemmIRD■■■■■■■■■■■■■■■■■■■■■■■■■What Is a Trading Bot?Why do We need a trading bot?...3The capabilities of the Trading BotDesign goalsCode organization and software Stack Used .OANDA REST API as Reference Implementation.m....ammann. 8Opening an oanda practice Account80 ANDA JS0 N Keys…………Constructor Dependencies for OANDA Implementations15Event-Driven architectureG0 ogle eventBus…18Provider helper Interface20Trading Config class.........mmonann......mtnonnn.......tnn 22Obtaining the Source Code.aaeeaaaee... 24Try It Yourself section..aaaaaa.. 24Chapter 2: Account Managementa27Account provider interface31A Concrete Implementation for AccountDataProvider32Encapsulating Everything Behind a Generic AccountlnfoService37Try It yourself43VIlCONTENTSChapter 3: Tradeable Instruments47InstrumentA Concrete Implementation for InstrumentDataProvider52Encapsulating Everything Behind a Generic Instrumentservice56Try It yourself58Chapter 4: Event Streaming: Market Data Events mmmmmmmmmm. 61Streaming Market Data Interface.A Concrete Implementation for MarketData StreamingService .m..63Downstream Market data event disseminationMarketEventcallback……69Try It Yourself,…70Chapter 5: Historic Instrument Market Data mmmmmmmm 75How to read a candlestick75Enum Defining the Candlestick Granularity76Define pojo to hold candlestick information77Historical Data Provider Interface79A Concrete Implementation for HistoricMarketDataProvidern81Discussion An Alternate Database Implementation85Candlesticks for Moving Average Calculations....88MovingAverage calculation Service89Try lt YourselfChapter 6: Placing Orders and Trades■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97Order pojo definition98Order Management provider Interface101A Concrete Implementation for Order ManagementProvider,103A Simple orderInfoService,115CONTENTSValidating Orders Before Execution: PreOrderValidationService... 116Putting It All Together in an OrderExecution Service .mmmm... 121Trade pojo definition124Trade Management provider Interface127A Concrete Implementation for TradeManagementProvider129Encapsulating Read Operations Behind TradelnfoService.....m. 136Try It yourself144Chapter 7: Event Streaming: Trade/order/Account Events m 159Streaming Event Interface161A Concrete Implementation for Events StreamingService162Try It Yourself171Chapter 8: Integration with Twitter■■■■■■■■■■■■■■■■■■■■175Creating a Twitter Application175Spring Social180Using and Configuring Spring Social180Harvesting FX Tweets181Tweetharvester Interface wmmm. 185XTWeethandler Interface,,,………AbstractFxtweethandler base class186User-Specific TweetHandlersTry lt Yourself.Chapter 9: Implementing Strategies.aa203Copy Twitter Strategy204Fade the Move Strategy210Try It Yourself214CONTENTSChapter 10: Heartbeating ammammmmmmmmmmmmmmm 219HeartBeatPayload. ..m......m. 219Streaming the Heartbeat Interface220A Concrete Implementation for HeartBeatstreamingService221HeartBeatcallback Interface223DefaultheartBeatservice223Try It Yourself226Chapter 11: E-Mail notifications n231Notification Design.EmailPayLoad poJoEmailContentgenerator interface……232Sample Implementations.EventEmailNotifier service mm...m. 235Try It Yourself.237Chapter 12: Configuration, Deployment, and running the bot m 243Configuring the Trading Bot243Core Beans configuration244Twitter-Related Beans Configuration.....................247Provider Beans Configuration248Strategies configuration…254Services Configuration254Building the Bot...,,,,,…,,……256Running the bot.....,,……259CONTENTSChapter 13: Unit Testinga263Using Mockito as a Mocking Framework.Mocking Http iNteraction..............m....................e........................ 264Mocking Streams.The versatile verify Mockit0…....,.,,…271Mocking Twitter Interaction .EclEmma Code Coverage Tool for Eclipse ide.nDDDDDDDDDm274Index■■■■■■■■■■■■■■■■■■■口En277
- 2020-12-07下载
- 积分:1
-
常见国际期刊论文投稿模板
汇总了一些常见的国际期刊的论文投稿模板,包括Springer,IEEE/ACM, Elsevier, IEICE, AIP等
- 2020-12-08下载
- 积分:1
-
Jacobi__矩阵特征值和特征向量(详细,有例子)
Jacobi__矩阵特征值和特征向量(详细,有例子)
- 2020-12-10下载
- 积分:1
-
用simulink实现APFC电路仿真连接图
PFCmatlab仿真电路图
- 2020-11-27下载
- 积分:1
-
基于双闭环PID控制的一阶倒立摆控制系统设计
1、理解一阶倒立摆的工作机理及其数学模型的建立及简化的方法;2、通过对一阶倒立摆的建模,掌握使用Matlab/Simulink软件对控制系统的建模方法;3、通过对一阶倒立摆控制系统的设计,理解和掌握双闭环PID控制系统的设计方法;4、掌握双闭环PID控制器参数整定的方法;5、掌握Simulink子系统的创建方法;6、理解和掌握控制系统设计中稳定性、快速性的权衡以及不断通过仿真实验优化控制系统的方法。
- 2021-05-06下载
- 积分:1
-
c# winform换肤(含源码)包含winform皮肤64套
本人在给予vs2012 c#编写的一个简答的winform换肤方法,方便大家快速预览皮肤的样式,以便应用,不足之处还请多指正,谢谢~~~
- 2020-06-02下载
- 积分:1
-
支持向量机
关于支持向量机里面讲核函数的,介绍了线性核函数、高斯核函数、及多项式核函数等。还介绍了核函数的判定以及Mercer定理1x1121T3212T42.3p(a)L313x2.3.32cT1V2C.223+d更一般地,核数K(x2z)=(xz+)“对应的映射后特征维度为a(求解方法参见http://zhidao.baiducom/question/16706714.html)由于计算的是内积,我们可以想到IR中的余弦相似度,如果ⅹ和z向量夹角越小,那么核函数值越大,反之,越小。因此,核函数值是(x)和(z)的相似度。再看另外一个核函数K(r, z)=expz-z|222这时,如果x和z很相近(x-2‖≈0),那么核函数值为1,如果x和z相差很大(x-2》0),那么核函数值约等于0。由于这个函数类似于高斯分布,因此称为高斯核函数,也叫做径向基函数( Radial basis function简称RBF)。它能够把原始特征映射到无穷维。既然高斯核函数能够比较ⅹ和z的相似度,并映射到0到1,回想 logistic回归, sigmoid函数可以,因此还有sigmoid核函数等等下面有张图说明在低维线性不可分时,映射到高维后就可分了,使用高斯核函数。Linear回回看目即Gaussian来自 Eric Xing的sdes注意,使用核函数后,怎么分类新来的样本呢?线性的时候我们使用SVM学与出W和b,新来样木ⅹ的话,我们使用wTx+ b来判断,如果值大于等于1,那么是正类,小于等于是负类。在两者之间,认为无法确定。如果使用了核函数后,W2x+b就变成了wφ(x)+b,是否先要找到p(x),然后再预测?答案背定不是了,找φ(x很麻烦,回想我们之前说过的wa+6=boy(0)x+bi=1(x(,x)+b只需将替换成(x,x),然后值的判断同上8核函数有效性判定问题:给定一个函数K,我们能否使用K来替代计算φ(x)2中(z),也就说,是否能够找出一个,使得对丁所有的x和z,都有k(x,2)=(x)r中(2)9比如给出了K(x,2)=(x2)2,是否能够认为K是一个有效的核函数下面来解决这个问题,给定m个训练样本全(r(3xm,每一个对应一个特征向量。那么,我们可以将(e) yJ仟意两个和带入K中,计算得到=0。I可以从1到m,j以从1到m,这样可以计算出m*m的核函数矩阵( Kernel Matrix)。为了方便,我们将核函数矩阵和(x,z)都使用K来表示如果假设K是有效地核函数,那么根据核函数定义k1=K(x0x0)=p(x()p(x0)=p(x(0)p(x()=K(x(,x)=K可见,矩阵K应该是个对称阵。让我们得出一个更强的结论,首先使用符号中x(x)来表示映射函数中(x)的第k维属性值。那么对于任意向量z,得2K2=∑∑2K3∑∑(m0y(0)2∑∑∑(z0)(x0)z∑∑∑29(x)k(z0)k i j=S|∑zipk(c(ak0.最后一步和前面计算K(x)=(x2)时类似。从这个公式我们可以看出,如果K是个有效的核函数(即K(xz)和(x)p(2)等价),那么,在训练集上得到的核函数矩阵K应该是半正定的(K≥0这样我们得到一个核函数的必要条件:K是有效的核函数==>核函数矩阵K是对称半正定的可幸的是,这个条件也是充分的,由 Mercer定理来表达。Mercer定理:如果函数K是×四→巫上的映射(也就是从两个n维向量映射到实数域)。那么如果K是一个有效核函数(也称为 Mercer核函数),那么当且仅当对于训练样例(r()x(m,其相应的核函数矩阵是对称半正定的。Mercer定理表明为了证明K是有效的核函数,那么我们不用去寻找φ,而只需要在训练集上求出各,然后判断矩阵K是否是半正定(使用左上角主子式大于等于零等方法)即可。许多其他的教科书在 Mercer定理证明过程中使用了范数和再生希尔伯特空间等概念,但在特征是n维的情况下,这里给出的证明是等价的。核函数不仅仅用在SWM上,但凡在一个模型后算法中出现了,我们都可以常使用区(xz)去替换,这可能能够很好地改善我们的算法。posted on2011-03-1820:22 Jerry Lead阅读(…)评论(…)编辑收藏刷新评论刷新页面返回顶部博客园首页博问新闻闪存程序员招聘知识库Powered by:博客园 Copyright@ Jerry Lead
- 2020-12-01下载
- 积分:1
-
中国菜刀,
中国菜刀,很好用
- 2020-12-05下载
- 积分:1
-
基于opencv的数字识别
通过opencv对图片上的数字进行识别。识别方式和步骤主要是寻找出数字的外轮廓,然后根据轮廓外接矩阵对数字进行分割,然后根据模板,求出其与分割好的数字的像素差值,找出最匹配的数字。
- 2020-12-06下载
- 积分:1