量化交易之hft篇 - 成交回报解析 (hft_order_log_parser)

41 篇文章 6 订阅

from vnpy.trader.tqz_extern.tools.position_operator.position_operator import TQZJsonOperator

from vnpy.app.tqz_hft_parser_app.hft_parser_path import TQZHftParserPath
from vnpy.app.tqz_hft_parser_app.tqz_constant import TQZOrderLogTitles

class TQZHftOrderLogParser:
    @classmethod
    def tqz_start_parser(cls, order_source_log_allPath, code_cancelOrderCounts_json_allPath):
        TQZJsonOperator.tqz_write_jsonfile(
            content=cls.__get_source_log_dictionary(order_source_log_allPath),
            target_jsonfile=code_cancelOrderCounts_json_allPath
        )

    @classmethod
    def __get_source_log_dictionary(cls, source_log_all_path: str):
        """
        Get dictionary based on source log with source_log_all_path.
        """

        log_dictionary = {}
        for line in open(source_log_all_path).readlines():
            line_log_dictionary = {}
            for line_log_item in line.rstrip().split(" ")[-1].replace('[', '').replace(']', '').split(","):
                line_log_dictionary[line_log_item.split('|')[0]] = line_log_item.split('|')[1]
            log_dictionary[line_log_dictionary[TQZOrderLogTitles.CODE.value]] = line_log_dictionary[TQZOrderLogTitles.CANCEL_ORDER_COUNTS.value]

        return log_dictionary


if __name__ == '__main__':
    TQZHftOrderLogParser.tqz_start_parser(
        TQZHftParserPath.order_source_log_allPath(),
        TQZHftParserPath.code_cancelOrderCounts_json_allPath()
    )

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
高频量化交易系统(High-Frequency Trading System,简称HFT系统)是一种利用计算机算法和快速执行进行交易的技术。它通过快速获取市场数据、分析市场走势并进行交易,以在极短时间内获得利润。CPP是C++语言的缩写,是一种常用的编程语言。 高频交易系统CPP主要包括以下几个方面: 1. 数据获取和处理:高频交易系统需要快速获取市场数据,并进行实时的数据处理和分析。CPP语言提供了高效的数据处理能力,可以快速读取和处理海量的市场数据。 2. 算法开发:高频交易系统主要利用算法进行交易决策和执行。CPP语言支持复杂的算法设计和实现,具有高效的计算能力和低延迟的执行效果,能够满足高频交易系统对速度和性能的要求。 3. 执行交易和风险控制:高频交易系统需要实时执行交易指令,并进行风险控制,以避免不必要的损失。CPP语言可以实现快速的交易执行和灵活的风控策略,确保高频交易系统的安全和稳定运行。 4. 系统优化和监控:高频交易系统需要进行系统优化和监控,以提高交易执行效率和减少风险。CPP语言支持性能优化和系统监控的功能,可以对高频交易系统进行优化和监测,提升系统的稳定性和可靠性。 总之,高频量化交易系统CPP是一种利用C++语言开发的高效、快速和可靠的交易系统,能够满足高频交易对速度和性能的要求,提高交易决策的准确性和执行效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值