程序员的量化交易之路(22)--Cointrader值货币集合Currencies(10)

转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contentshttp://cloudtrade.top

货币集合Currencies是Currency的集合。主要是定义一些枚举:

代码如下:

public class Currencies {
    // Fiat
    public static final Currency AUD = fiat("AUD", 0.01);
    public static final Currency CAD = fiat("CAD", 0.01);
    public static final Currency CHF = fiat("CHF", 0.05);
    public static final Currency CNY = fiat("CNY", 0.01);
    public static final Currency EUR = fiat("EUR", 0.01);
    public static final Currency GBP = fiat("GBP", 0.01);
    public static final Currency HKD = fiat("HKD", 0.01);
    public static final Currency JPY = fiat("JPY", 1.00);
    public static final Currency MXN = fiat("MXN", 0.01);
    public static final Currency NZD = fiat("NZD", 0.10);
    public static final Currency RUB = fiat("RUB", 0.01);
    public static final Currency SEK = fiat("SEK", 1.00);
    public static final Currency SGD = fiat("SGD", 0.01);
    public static final Currency TRY = fiat("TRY", 0.01);
    public static final Currency USD = fiat("USD", 0.01);

    // Cryptos

    // Base coins Bitcoin, Litecoin, Primecoin, Dogecoin, Nextcoin
    // todo review bases!  they may not be correct
    // todo we need a way for a Market to trade in a different basis than the quote's basis
    public static final Currency AUR = crypto("AUR", 1e-8);
    public static final Currency BTC = crypto("BTC", 1e-8);
    public static final Currency DOGE = crypto("DOGE", 1e-8);
    public static final Currency DRK = crypto("DRK", 1e-7);
    public static final Currency FTC = crypto("FTC", 1e-8);
    public static final Currency LTC = crypto("LTC", 1e-8);
    public static final Currency MEM = crypto("MEM", 1e-8);
    public static final Currency MOON = crypto("MOON", 1e-8);
    public static final Currency NMC = crypto("NMC", 1e-8);
    public static final Currency NVC = crypto("NVC", 1e-8);
    public static final Currency NXT = crypto("NXT", 1e-8);
    public static final Currency XCP = crypto("XCP", 1e-8);
    public static final Currency XPM = crypto("XPM", 1e-8);

    // Altcoins
    // todo review bases!  they may not be correct
    public static final Currency BC = crypto("BC", 1e-8);
    public static final Currency BQC = crypto("BQC", 1e-8);
    public static final Currency BTB = crypto("BTB", 1e-8);
    public static final Currency BTQ = crypto("BTQ", 1e-8);
    public static final Currency BUK = crypto("BUK", 1e-8);
    public static final Currency C2 = crypto("C2", 1e-8);
    public static final Currency CDC = crypto("CDC", 1e-8);
    public static final Currency CENT = crypto("CENT", 1e-8);
    public static final Currency CMC = crypto("CMC", 1e-8);
    public static final Currency CNC = crypto("CNC", 1e-8);
    public static final Currency COMM = crypto("COMM", 1e-8);
    public static final Currency DGC = crypto("DGC", 1e-8);
    public static final Currency DTC = crypto("DTC", 1e-8);
    public static final Currency DVC = crypto("DVC", 1e-8);
    public static final Currency EXC = crypto("EXC", 1e-8);
    public static final Currency FLT = crypto("FLT", 1e-8);
    public static final Currency FRC = crypto("FRC", 1e-8);
    public static final Currency IFC = crypto("IFC", 1e-8);
    public static final Currency KDC = crypto("KDC", 1e-8);
    public static final Currency MAX = crypto("MAX", 1e-8);
    public static final Currency MEC = crypto("MEC", 1e-8);
    public static final Currency MINT = crypto("MINT", 1e-8);
    public static final Currency MMC = crypto("MMC", 1e-8);
    public static final Currency NEC = crypto("NEC", 1e-8);
    public static final Currency NET = crypto("NET", 1e-8);
    public static final Currency PPC = crypto("PPC", 1e-8);
    public static final Currency PRT = crypto("PRT", 1e-8);
    public static final Currency PTS = crypto("PTS", 1e-8);
    public static final Currency QRK = crypto("QRK", 1e-8);
    public static final Currency quute = crypto("quute", 1e-8);
    public static final Currency RDD = crypto("RDD", 1e-8);
    public static final Currency CANN = crypto("CANN", 1e-8);
    public static final Currency RED = crypto("RED", 1e-8);
    public static final Currency SLM = crypto("SLM", 1e-8);
    public static final Currency SRC = crypto("SRC", 1e-8);
    public static final Currency TAG = crypto("TAG", 1e-8);
    public static final Currency TIPS = crypto("TIPS", 1e-8);
    public static final Currency TIX = crypto("TIX", 1e-8);
    public static final Currency VRC = crypto("VRC", 1e-8);
    public static final Currency VTC = crypto("VTC", 1e-8);
    public static final Currency WDC = crypto("WDC", 1e-8);
    public static final Currency XC = crypto("XC", 1e-8);
    public static final Currency YAC = crypto("YAC", 1e-8);
    public static final Currency ZCC = crypto("ZCC", 1e-8);
    public static final Currency ZET = crypto("ZET", 1e-8);

    private static Currency fiat(String symbol, double basis) {
        return Currency.forSymbolOrCreate(symbol, true, basis);
    }

    private static Currency crypto(String symbol, double basis) {
        return Currency.forSymbolOrCreate(symbol, false, basis);
    }
}
时间: 2024-10-25 03:26:56

程序员的量化交易之路(22)--Cointrader值货币集合Currencies(10)的相关文章

程序员的量化交易之路(1)----规划开篇

其实,一直对量化交易有一定的理解和情节.早在中大读研究生的时候实验室师兄,已经去了中国平安核心投资团队,做高频交易研究的国源师兄的影响,就开始对金融世界产生了浓厚的兴趣.看了丁磊编著的<量化投资--策略与技术>和艾琳.奥尔德里奇的<高频交易>,反复的看,但是都入不了味,现在回过头来想,一个连股都不炒的人怎么可能入味呢.对一些金融的基本概念都不懂. 2013年7月出社会工作后,在10月份确立目标.需要炒股,而且需要一个深入的理解金融的世界.所以确定去考一个证券从业考试,选了证券基础和

程序员的量化交易之路(11)--命令参数解析库JCommonder学习

转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contents,http://cloudtrade.top 在学习量化交易平台的过程中,接触到一个参数解析的库,JCommander.今天把它记录一下. 它的官网为:http://www.jcommander.org/ 1. 概述 Jcommander是一个非常小的框架,用于解析命令行参数. 可以通过注解来描述你的参数选项: import com.beust.jcommander.Paramete

程序员的量化交易之路(2)----Esper文档学习之技术概览(1)

转载请注明出处:http://blog.csdn.net/minimicall/ 在接下来的20个工作日中,我将坚持翻译或者略翻译Esper的官方文档. 为什么需要学习Esper,因为我们需要理解复合事件处理 Complex Event Processing (CEP).在量化交易系统中,CEP是必不可少的.它负责处理海量的实时事件. 关于CEP更多知识,大家可以翻阅网络相关资料.我这里集中在学习开源的CEP系统,Esper.. 今天开始第一篇:技术概览. 1. CEP和事件序列分析 Esper

程序员的量化交易之路(13)--Cointrader类图(1)

转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contents, htpp://cloudtrader.top 今天开始正式切入到Cointrader的源码分析学习中,其主页为:https://github.com/timolson/cointrader. 它是基于Esper的一个比特币云交易托管平台.和我想做的事情比较相近.而且虽然现在没什么功能,但代码量相对少,对于学习非常好. 下面是它的一个类图.: 后面我们会根据这个类图一步步的剖析整个

程序员的量化交易之路(38)--Lean之实时事件处理接口IRealTimeHandler和RealTimeEvent6

转载需注明出处:http://blog.csdn.net/minimicall?viewmode=contents,http://cloudtrade.top/ 这节开始我们要开始说明另外一个模块:实时事件处理模块. 这个模块的工作是什么呢.它就是用来设置一些在特定时间需要执行的任务.比如,每天开盘的时候,你可以做一个什么动作,比如每天收盘的时候你也可以做一个动作.当然还有更为广泛的运用. 在Lean中,是开启一个单独的线程来处理这种定时任务的. 实时事件:RealTimeEvent 实时事件处

程序员的量化交易之路(36)--Lean之数据读取SubscriptionDataReader4

转载需注明出处:http://blog.csdn.net/minimicall?viewmode=contents,http://cloudtrade.top 数据读取需要定义一个读者.直接见下面代码: namespace QuantConnect.Lean.Engine.DataFeeds { /******************************************************** * CLASS DEFINITIONS ***********************

程序员的量化交易之路(35)--Lean之DataFeed数据槽3

转载需注明出处:http://blog.csdn.net/minimicall,http://cloudtrade.top/ Lean引擎的模块划分非常的规范.其中DataFeed是数据槽,就是供应数据的模块. 1. IDataFeed 接口 模块的接口为: namespace QuantConnect.Lean.Engine.DataFeeds { /// <summary> /// Datafeed interface for creating custom datafeed source

程序员的量化交易之路(29)--Cointrader之Tick实体(16)

转载需注明出处:http://blog.csdn.net/minimicall,http://cloudtrade.top Tick:什么是Tick,在交易平台中非常常见,其实就 单笔交易时某只证券的基本数据. 我们通过代码来学习吧: package org.cryptocoinpartners.schema; import javax.annotation.Nullable; import javax.persistence.Entity; import javax.persistence.M

程序员的量化交易之路(14)--Cointrader数据表(2)

Cointrader表结构 转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contents,http://cloudtrader.top 设置(setup)   Install Java Install Maven Install MySql Create a database using mysql -u root -e `create database cointrader;` This is mysql root not system r