• 使用深度强化学习实现金融时序交易买卖点预测


    闲言碎语不要表,看看代码就知晓。代码架构如下

    # for nature DQN
    class GPModel(tf.keras.Model):
        def __init__(self):...
    
        def call(self, inputs, training=None, mask=None):...
    
        @staticmethod
        def __build_dnn_a(activation_function=tf.nn.selu, useBatchNormalization=False):...
    
        @staticmethod
        def __build_dnn_b(activation_function=tf.nn.selu, useBatchNormalization=False):...
    
        def _del__(self):...
    
    # for dueling DQN
    class GDModel(tf.keras.Model):
        def __init__(self):...
    
        def call(self, inputs, training=None, mask=None):...
    
        @staticmethod
        def __build_v_net(activation_function=tf.nn.selu, useBatchNormalization=False):...
    
        @staticmethod
        def __build_a_net(activation_function=tf.nn.selu, useBatchNormalization=False):...
    
        @staticmethod
        def __build_dnn_a(activation_function=tf.nn.selu, useBatchNormalization=False):...
    
        @staticmethod
        def __build_dnn_b(activation_function=tf.nn.selu, useBatchNormalization=False):...
    
        def _del__(self):...
    
    # Agent
    class DQNModel(object): def __init__(self, useDuelingDQN=True):... def record(self, s, a, s_, r):... def choose_action(self, state, epsilon=0.1):... def train(self, use_double_dqn = False):... def __del__(self):... def save_weights(self, filepath):... def load_weights(self, filepath):... def get_weights(self):... def set_weights(self, weights):
    # Enviroment
    class SiEnviroment(object): def __init__(self, data):... def reset(self):... def move(self, action):... def last(self):... def describe(self):... def __del__(self):...
    # Dog
    class Dog(object): def __init__(self, profile):... def getStatus(self):... def fit(self):... def evalute(self, verbose=0, sample=0):... def predict(self):... def save_model_weights(self, filepath):... def load_model_weights(self, filepath):...

    采用 Dueling DQN + Double DQN运算预测效果如下(部分)

     
    资产编号 预测动作 胜率 历史数据测试最大收益率 历史数据测试平均收益率 历史数据测试最小收益率
    6*****.ss 观望 97.3% 206.71% 118.19% 95.73%
    6****6.ss 卖出 45.97% 158.04% 106.05% 85.40%
    6****9.ss 持有 81.1% 174.31% 112.09% 94.90%
    6***3*.ss 观望 54.64% 164.89% 109.20% 90.80%
    6****5.ss 买入 78.56% 141.74% 114.12% 94.11%

    话不多说,说给知者。功能模块可以有偿出售,寻求有兴趣的合作人员,电联:xyz2abc@163.com

  • 相关阅读:
    k8s中文网
    python range用法
    python 日志滚动 分文件
    python 语法
    flask 中文编码解码
    python的杨辉三角
    mysql8.0.4以后修改密码方式变更
    flask学习视频
    oralce的lag和lead函数
    JNI 各类数据类型处理
  • 原文地址:https://www.cnblogs.com/xyz2abc/p/14406397.html
Copyright © 2020-2023  润新知