程序员理财 之Python量化交易系统(视频文件数据齐)


 Python量化交易系统


  第1章学习的内容有以下这些:课程导学-开启量化交易的大门、java

public class PrintGCLog {

    private static void gc01() {

        byte[] x = new byte[1024 * 1024]; // 1024 * 1024 分配 1MB 空间
        x = new byte[1024 * 1024];
        x = new byte[1024 * 1024];
        x = null;

        byte[] y = new byte[2 * 1024 * 1024]; // 2 * 1024 * 1024 分配 2MB 空间
    }

    public static void main(String[] args) {

        gc01();
    }
}

什么是量化? 、经常使用的股票量化指标(上):技术面 、经常使用的股票量化指标(下):基本面 、 量化投资发展史、如何搭建量化交易系统 、量化基础知识、 本章小结与重点知识复习 。redis


  第2章 学习的内容有以下这些:本章节导学&学习计划、(视频资源vxcmL46679910)) 什么是股票、获取股票数据的3种方式、使用JQData查询行情数据、使用resample函数转化时间序列、resample函数的应用、使用JQData查询财务指标、数据库

public class MoreMinorGC {

    private static void minorGC() throws InterruptedException {

        byte[] x = new byte[1024 * 1024];   // 在 Eden 区域放入一个 1MB 的对象
        x = new byte[1024 * 1024];
        x = new byte[1024 * 1024];  // 会致使前两个 1MB 的对象成为垃圾对象
        x = null;   // 将以前的三个 1MB 的对象都变成垃圾对象

        // 这句代码就会触发年轻代的 Young GC
        byte[] y = new byte[2 * 1024 * 1024];   // 在 Eden 区中分配一个 2MB 的对象

        Thread.sleep(1000);
    }

    public static void main(String[] args) throws InterruptedException {

        while (true) {
            minorGC();
        }
    }
}

使用JQData查询估值指标 、使用财务数据计算估值指标、实时更新股票数据 、建立你的股票数据库。app


第3章 学习的内容有以下这些:股票交易快速入门、使用shift函数计算涨跌幅、模拟股票交易:买入、卖出信号、模拟股票交易:计算持仓收益 、Debug:解决CopyWarning问题、模拟股票交易:计算累计收益......ide

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=
第4章 学习的内容有以下这:数据准备:本地化股票数据、数据准备:从本地读取数据、什么是均线策略、双均线策略:生成交易信号、双均线策略:计算信号收益率、计算并比较全部A股的策略收益、什么是假设检验、(视频资源vx(cmL46679910))双均线策略:利用p值检验可靠性、双均线策略:寻找最优参、双均线策略:寻找最优参数、尝试建立基于布林道的择时策略、总结。 函数

private static final ScheduledThreadPoolExecutor executor =
            new ScheduledThreadPoolExecutor(50,
                    new ThreadPoolExecutor.DiscardOldestPolicy());

    private static void processImoocers(List<Imoocer> imoocers) {
        imoocers.forEach(i -> executor.scheduleWithFixedDelay(
                i::func, 2, 3, TimeUnit.SECONDS
        ));
    }

    private static List<Imoocer> getAllImoocer(int count) {

        List<Imoocer> imoocers = new ArrayList<>(count);

        for (int i = 0; i != count; ++i) {
            imoocers.add(new Imoocer());
        }

        return imoocers;
    }

    public static void main(String[] args) throws InterruptedException {

        executor.setMaximumPoolSize(50);

        while (true) {
            processImoocers(getAllImoocer(100));
            Thread.sleep(100);
        }
    }
}


第5章学习的内容有以下这些:什么是动量策略、动量策略:筛选股票池、动量策略:计算动量因子、动量策略:生成交易信号、动量策略:计算组合收益率(等权重)、实现反向动量策略、打印策略评估指标、(视频资源vx(cmL46679910))调整投资组合权重 、构建ETF动量策略。学习

public class NeedAvoidLog {

    @PostMapping("/log")
    public Imoocer avoidLog(List<Imoocer> imoocers) {

        // 1. 避免大数据量日志的打印
        log.info("args imoocer: [{}]", imoocers); // 这种方式并很差
        if (imoocers.size() > 10) {
            log.info("args imoocer count: [{}]", imoocers.size());
        }

        // 2. 避免在循环中打日志, 特别是大循环
        imoocers.forEach(i -> log.info("imoocer name is: [{}]", i.getName()));

        // 3. 不要打没有意义的日志
        File file = new File(imoocers.get(0).getName());
        if (!file.exists()) {
            log.warn("file does not exist!");   // 没有意义
            log.warn("file does not exist: [{}]", imoocers.get(0).getName());
        }

        // 4. 若是日志什么都说明不了, 修改或删除
        double sumSalary = 0.0;
        for (Imoocer imoocer : imoocers) {
            sumSalary += imoocer.getSalary();
        }

        log.info("all imoocers sum salary is: [{}], [{}]", imoocers.size(), sumSalary);

        return null;
    }
}

第6章 学习的内容有以下这些: 有哪些经常使用的数据回测框、为何回测与实盘有差别、初始化PyAlgoTrade开发环境、定义数据与策略、PyAlgoTrade:模拟交易与回测、PyAlgoTrade:交易信号可视化、PyAlgoTrade回测双均线策略、PyAlgoTrade回测MACD指标、PyAlgoTrade回测BOLL指标。大数据

public class JavaSystemProperties {

    public static void main(String[] args) {

        // 打印全部的 Java 系统属性
        Properties pros = System.getProperties();
        pros.list(System.out);

        System.out.println("//////////////////////////////////////////////////////////////////");

        // 获取特定的 Java 系统属性, key 不存在则返回 null
        System.out.println(System.getProperty("java.home"));        // JRE 主目录
        System.out.println(System.getProperty("java.library.path"));        // 用于搜索本机库的 JRE 库搜索路径
        System.out.println(System.getProperty("java.ext.dirs"));        // JRE扩展库路径
        System.out.println(System.getProperty("java.class.path"));      // JRE类路径
        System.out.println(System.getProperty("java.version"));     // Java 版本
        System.out.println(System.getProperty("imooc-qinyi"));
    }
}


第7章学习的内容有以下这些: 如何实现程序化交易、初始化EasyTrader开发环境、认识EasyTrader基本函数、模拟实盘:双均线择时策略。优化

private final ExecutorService es = Executors.newCachedThreadPool(
            new BasicThreadFactory.Builder().namingPattern("Imooc-Qinyi-%d").build()
    );

    private final StringRedisTemplate redisTemplate;

    public InsufficientResourceController(StringRedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    @GetMapping("/{batch}")
    public DeferredResult<String> resource(@PathVariable int batch) {

        DeferredResult<String> result = new DeferredResult<>(10 * 1000L,
                "timeout");
        CompletableFuture[] futures = new CompletableFuture[batch];

        for (int i = 0; i != batch; ++i) {
            futures[i] = CompletableFuture.supplyAsync(this::getValue, es);
        }

        CompletableFuture.allOf(futures).thenRun(() -> result.setResult("success"));

        return result;
    }

    private String getValue() {

        try {
            return redisTemplate.execute((RedisCallback<String>) connection -> {
                sleep(5000);
                return "qinyi-" + connection;
            });
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return "error";
    }

    private void sleep(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
    }
}


第8章学习的内容有以下这些:什么是多因子模型 、vx(cmL46679910)关于文档说明和项目优化、如何获取更多策略 、 课程总结。ui

点击

相关文章
相关标签/搜索