AioTrade Investigation (Section E: The logic of TickerServer)
guibin.beijing@gmail.com
AioTrade source code:
https://github.com/dcaoyuan/aiotrade
The TickerServer(org.aiotrade.lib.securities.dataserver.TickerServer) is a kind of DataServer which is used to process tickers. Tickers can be from the DBF, streaming, http request and so on. The TickerServer processes the incoming tickers, parses them, and then updates the internal Ser(Such as QuoteSer, MoneyFlowSer and so on) which is save in Sec. While processing the tickers, the TickerServer can also publish the relavent event to anyone who is interested in. The main logic of Ticker is almost in the method processData(values: Array[Ticker], Contract: TickerContract), details are below:
A) In levelI, the input comes from the dbf's parsing result, namely a batch of incoming tickers at a specific time.
B) When the TickerServer gets the tickers, firstly converts these tickers into SecSnaps and tickersLast.
B1) SecSnap represents a sec's snapshot, including the latest newTicker, lastTicker, dailyQuote, minutelyQuote, dailyMoneyFlow, minutelyMoneyFlow. These data can be set by Ticker via setByTicker(ticker) or individually set its setter method of var.
B2) tickerLast represents the latest tickers. Some data copyFrom the incoming ticker in order to avoid the unwanted modifying.
C) Then traverse all the secSnaps to compute the minQuote's open, high, low, close, volume, amount, also it computes the execution. If the incoming ticker's time is not larger than the last ticker's time, we deem the incoming ticker is invalid.
C1) While traversing and if the ticker is valid, collects all the tickers into allTickers, so as to publish TickersEvt(allTickers) finally by TickerServer.
C2) While traversing and if the ticker is valid, collects all the executions into allExecutions so as to insert into database finally.
C3) While traversing and if the ticker is valid, collects all the DepthSnaps into allDepthSnaps so as to publish DepthSnapsEvt(allDepthSnaps) finally by TickerServer.
C4) While traversing and if the ticker is valid, updates the daily quote by ticker, then sends the minutely and daily QuoteEvt to sec to update the chain time series. At the same time, collecting all the dailyQuote and minutelyQuote so as to publish QuotesEvt(allUpdatedDailyQuotes) and QuotesEvt(allUpdatedMinuteQuotes) by TikerServer.
C5) While traversing and if the ticker is valid, the sec could also publish single TickerEvt and single ExecutionEvt.
C6) While traversing and if the ticker is valid, update the exchangeToLastTime so as to try to tryClosing finally.
D) According to the TrandingStatus and tradingTimeInMinutes to try to do close.
分享到:
相关推荐
《电泳沉积法制备SnO2:Ti复合纳米线阵列及其气敏性质研究》 本文由李建军、朱金波等学者共同发表,详细探讨了利用电泳沉积法制备SnO2:Ti复合纳米线阵列的过程及其在气体传感方面的优异性能。该研究首次报道了这种...
乔治·布尔(George Boole,1815.11.2~1864),1815年11月2日生于英格兰的林肯。19世纪最重要的数学家之一,出版了《逻辑的数学分析》,这是它对符号逻辑诸多贡献中的第一次。1854年,他出版了《思维规律的研究》,这...
Symposium on Beyond The Gold Box: The Future Of Integrated Optics W1HBeyond the Gold Box: The Future of Integrated Optics I W1H.1 Beyond CFP2-ACO W1H.2 Device Technologies for Integrated Packaged ...
例如:The scientist's skepticism towards the new theory led to a thorough investigation. 115. live:(音乐表演)现场的。例如:The band's live performance was energetic and engaging. 116. come right ...
Getting remedial mathematics students to prefer homework with 20[percnt] and 40[percnt] more problems: An investigation of the strength of the interspersing procedure GETTING REMEDIAL MATHEMATICS ...
《Vision:A Computational Investigation into the Human Representation and Processing of Visual Information》,计算机视觉奠基之作
乔治·布尔的著作《思维规律的研究》是在逻辑学和概率论数学理论发展史上的重要贡献,这本著作由乔治·布尔所著,并于2017年7月19日发布。乔治·布尔是数学家,同时也是逻辑运算的奠基人,他的理论构建了布尔代数的...
Descriptive: studies involving the collection of data in order to test hypotheses or to answer questions concerning the current status of the subjects of the study. Exploratory: studies conducted ...
The relationship between self-esteem and academic achievement: An investigation of sex differences THE RELATIONSHIP BETWEEN SELF-ESTEEM AND ACADEMIC ACHIEVEMENT: AN INVESTIGATION OF SEX ...
一本免费的开放式教科书,涵盖了包括三角学在内的四分之二的微积分序列。
The good behavior game: An investigation of teachers' acceptance Psychology in the Schools Volume 31. January 1994 THE GOOD BEHAVIOR GAME: AN INVESTIGATION OF TEACHERS’ ACCEPTANCE DANIEL H. ...
webrtc 拥塞控制算法原理及性能分析。In this paper we experimentally eval- uate the Google Congestion Control (GCC) which has been recently proposed in the RTCWeb IETF WG
Cu-Cr-W和Cu-Cr-Mo三元合金相平衡的实验研究及热力学计算,王翠萍,黄德笑,本文通过EMPA、XRD、DSC等实验方法测定Cu-Cr-W和Cu-Cr-Mo的相平衡。同时基于本次研究得到的实验结果,利用CALPHAD技术对Cu-Cr-W和Cu-Cr-Mo...
例句:The abduction of the child sparked a massive police investigation. 9. **abed**:副词,意为“躺在床上”。例句:He spent most of the day abed due to his illness. 10. **aberration**:名词,意为...
在中度嗜热菌体系下黄铜矿与铁闪锌矿的生物浸出:阶段生物浸出过程相互作用的研究,王军,赵红波,大部分情况下,在原矿和浮选精矿中黄铜矿和铁闪锌矿是相互混在一起的。在本研究中,在中度嗜热菌体系下,主要通过...
The Metallic Behavior of Electron Precise Zintl Compounds: a Theoretical Investigation of the Electronic Structure of Ca5Ge3 Poster The Metallic Behavior of Electron Precise Zintl Compounds: a ...
- **Spiral Orbit (MIT)**: An investigation into the spiral motion of an object orbiting a central mass, requiring an understanding of central force laws and Kepler's laws of planetary motion. ...
江西某企业环境管理现状及会计行为的调查,胡丹,王京芳, 本文对一家已通过ISO9000和ISO14000标准体系认证的制造企业A进行实地调查研究,分别对其制造科和综合管理办公室有关人员就环境管理体�
Investigation of the Lower Resistance Meridian V. Speculation on the Pathophysiological Functions of Acupuncture Meridians,杨威生,,在《低阻经络研究III》和《IV》里已指出,经络是疏松结缔组织里的间液...