程序员的量化交易之路(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);
    }
}


相关文章
|
6天前
|
云安全 人工智能 安全
AI被攻击怎么办?
阿里云提供 AI 全栈安全能力,其中对网络攻击的主动识别、智能阻断与快速响应构成其核心防线,依托原生安全防护为客户筑牢免疫屏障。
|
16天前
|
域名解析 人工智能
【实操攻略】手把手教学,免费领取.CN域名
即日起至2025年12月31日,购买万小智AI建站或云·企业官网,每单可免费领1个.CN域名首年!跟我了解领取攻略吧~
|
10天前
|
安全 Java Android开发
深度解析 Android 崩溃捕获原理及从崩溃到归因的闭环实践
崩溃堆栈全是 a.b.c?Native 错误查不到行号?本文详解 Android 崩溃采集全链路原理,教你如何把“天书”变“说明书”。RUM SDK 已支持一键接入。
625 217
|
存储 人工智能 监控
从代码生成到自主决策:打造一个Coding驱动的“自我编程”Agent
本文介绍了一种基于LLM的“自我编程”Agent系统,通过代码驱动实现复杂逻辑。该Agent以Python为执行引擎,结合Py4j实现Java与Python交互,支持多工具调用、记忆分层与上下文工程,具备感知、认知、表达、自我评估等能力模块,目标是打造可进化的“1.5线”智能助手。
863 61
|
8天前
|
人工智能 移动开发 自然语言处理
2025最新HTML静态网页制作工具推荐:10款免费在线生成器小白也能5分钟上手
晓猛团队精选2025年10款真正免费、无需编程的在线HTML建站工具,涵盖AI生成、拖拽编辑、设计稿转代码等多种类型,均支持浏览器直接使用、快速出图与文件导出,特别适合零基础用户快速搭建个人网站、落地页或企业官网。
1358 157
|
5天前
|
编解码 Linux 数据安全/隐私保护
教程分享免费视频压缩软件,免费视频压缩,视频压缩免费,附压缩方法及学习教程
教程分享免费视频压缩软件,免费视频压缩,视频压缩免费,附压缩方法及学习教程
260 138
|
7天前
|
存储 安全 固态存储
四款WIN PE工具,都可以实现U盘安装教程
Windows PE是基于NT内核的轻量系统,用于系统安装、分区管理及故障修复。本文推荐多款PE制作工具,支持U盘启动,兼容UEFI/Legacy模式,具备备份还原、驱动识别等功能,操作简便,适合新旧电脑维护使用。
553 109