AioTrade Investigation (Section B: DataContract and Content)
guibin.beijing@gmail.com
AioTrade source code:
https://github.com/dcaoyuan/aiotrade
The DataContract's source code is located at
https://github.com/dcaoyuan/aiotrade/blob/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/datasource/DataContract.scala. In order to understand the concept of DataContract, lets review the concept of DataObject in NetBeans firstly.
DataObjects wrap FileObjects. A FileObject is just a container for data; it happens to have a MIME type, but like java.io.File, it doesn't know or care what kind of file it represents, or what data it contains.
A DataObject represents one or more (typically only one) FileObjects. A DataObject knows what kind of a file it represents. It may represent the parsed contents of a file such as a .java file. Or, as in the case of InstanceDataObject, the file name may have semantic meaning. Reference about DataObject:
http://wiki.netbeans.org/DevFaqDataObject.
Then we talk a little bit about Descriptor(org.aiotrade.lib.math.timeseries.descriptor.Descriptor), its source code can be found at
https://github.com/dcaoyuan/aiotrade/blob/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/descriptor/Descriptor.scala. Descriptor is something like NetBeans' DataObject, it is just a container for service instance, which can be used method
createServiceInstance(args: Any*) to create or lookup one. Descriptor has the information about service class name, frequent, isActive. It use the service class name to create the service instance, and the isActive is to mark whether the Descriptor is active. The frequent is an attribute of the Descritor, the frequently-used value can be ONE_SEC, ONE_MIN, ONE_HOUR, DAILY, WEEKLY, MONTHLY, ONE_YEAR. Details about TFreq please refer to org.aiotrade.lib.math.timeseries.TFreq.
Let's go back to talk about DataContract. The DataContract simply inherits the Descriptor. It is assumed that the binding class(that is service class) provides the data service for the DataContract.
Finally, we have to say something about Content(org.aiotrade.lib.math.timeseries.descriptor.Content), its source code is at
https://github.com/dcaoyuan/aiotrade/blob/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/descriptor/Content.scala.
Content is actually a container for descriptors. It provides convient method to add, remove, indexOf, clear, lookup the descriptors which are saved in this Content.
The Content provides a relationship between the DataServer(the data source service via DataContract's service class) and the Indicator(the descriptor which is added into the Content) which can be computed via the data originated from the data server.
So, when initializing the Sec(org.aiotrade.lib.securities.model.Sec), firstly get the Content form the sec.content, then add the TickerContract, QuoteContract, MoneyFlowContract to the content use content.addDescriptor, finally add the Indicators' descirptor to the content.
分享到:
相关推荐
电泳沉积法制备SnO2:Ti 复合纳米线阵列及其气敏性质研究,李建军,朱金波,通过电泳沉积法与阳极氧化铝模板相结合可控制备出高度有序的Sn0.96Ti0.04O复合纳米线阵列。系统的结构表征显示所得SnO2:Ti复合纳米线�
高速偏振移位键控: 实验与数值研究,李政勇,王志豪,详细研究一种由两个正交偏振态来实现的偏振移位键控(PolSK)方案,分别进行了10 Gb/s传输实验和40 Gb/s数值模拟。使用常见的马赫 - 曾��
comparative investigation between a single ended and a balanced IF VGA
Chapter 1: Best Practices and Initial Investigation Chapter 2: strace and System Call Tracing Explained Chapter 3: The /proc Filesystem Chapter 4: Compiling Chapter 5: The Stack Chapter 6: The GNU ...
Investigation of Solid Waste Management and its environmental problem in El,John Leju Celestino Ladu,Marcelino Tombe Jada,This study attempts to investigate the management of solid wastes and ...
Investigation of Layered Bismuthates: (Ba, K)3Bi2O7 and (Ba, K)2BiO4 Schichtförmige Manganate Poster Investigation of Layered Bismuthates: (Ba,K)3Bi2O7 and (Ba,K)2BiO4 N. R. Khasanovaa, M. L. ...
Cu-Cr-W和Cu-Cr-Mo三元合金相平衡的实验研究及热力学计算,王翠萍,黄德笑,本文通过EMPA、XRD、DSC等实验方法测定Cu-Cr-W和Cu-Cr-Mo的相平衡。同时基于本次研究得到的实验结果,利用CALPHAD技术对Cu-Cr-W和Cu-Cr-Mo...
《Vision:A Computational Investigation into the Human Representation and Processing of Visual Information》,计算机视觉奠基之作
Chapter 9:FE Analysis and Experimental Investigation of Cracked and Un-Cracked Thin-Walled Tubular Components to Evaluate Mechanical and Fracture Properties Chapter 10:MARS and Neural Network Models ...
芒果苷与牛血清蛋白相互作用的光谱研究,林慧,蓝景风,用荧光光谱,同步荧光光谱,紫外吸收光谱以及傅立叶变换红外光谱研究了芒果苷与牛血清白蛋白在水溶液中的相互作用机制。计算了芒
iPhone and iOS Forensics Investigation, Analysis and Mobile Security for Apple iPhone, iPad and iOS Devices 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都...
Polarization-shift keying (PolSK), which is performed based on two orthogonal polarization states, is investigated in detail by experimental and numerical simulation for data rates of 10 and 40 Gb/s....
Computational Forensics, Digital Crime, and Investigation
The objective of the Apollon 10 PW ... More specifically the design considerations as well as the technological and physical limitations to achieve the intended pulse duration and contrast are discu
磁场中浆料粘度与内部结构的关系研究,严密,彭晓领,当外磁场施加在由铁磁性Ni和非磁性ZrO2粒子组成的浆料上时,浆料的粘度会明显增大。本文采用磁场线圈、旋转粘度计和金相显微镜对磁
江西某企业环境管理现状及会计行为的调查,胡丹,王京芳, 本文对一家已通过ISO9000和ISO14000标准体系认证的制造企业A进行实地调查研究,分别对其制造科和综合管理办公室有关人员就环境管理体�
CISSP_cccure_d9-Law Investigation and Ethics.pdf