A method, system and computer program product for quantifying multi-level intermediate representations of trading strategies and cross-platform compilation

CN122837849APending Publication Date: 2026-09-29YANXIN (SHANGHAI) INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611008286.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

[0003]本发明的目的是提供一种多层级中间表示架构及其配套的编译、转译与编译期静态审计方法、系统及计算机程序产品,以解决现有技术中领域特定脚本跨平台迁移困难、编译期安全审计缺失、AI生成质量低下、资产沉淀困难等核心技术问题

Benefits of technology

[0005]与现有技术相比,本发明具有以下有益效果:通过TIR-L到多目标平台的自动代码生成,将脚本跨平台迁移的人工重写工作量从100%降低至编译器自动完成,迁移时间从天级缩短至分钟级;通过TIR-M层级的静态分析,将脚本安全风险的人工审查覆盖率从不足30%提升至编译器的100%全量覆盖,能够在编译期自动检测并阻断时序逻辑违规和边界保护缺失;通过TIR-H的结构化语法约束和基于有限状态机的Logits掩码过滤,将大语言模型生成脚本代码的语法错误率从约40%降低至趋近于0;AI输出的TIR-H代码是结构化的、人类可读的,具备完整的可解释性和可审计性;通过TIR-M层级的静态审计和策略评分,为大语言模型提供了客观自动化的奖励信号,使AI能够在无需人类标注员干预的情况下自主优化策略生成能力;TIR-H代码独立于任何特定平台,可作为长期可维护的资产进行版本管理、复用和传承;TIR提供标准化的脚本描述格式,监管机构可对提交的脚本进行自动化合规审查,审查效率从人天级提升至分钟级。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122837849A_ABST
    Figure CN122837849A_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-level intermediate representation of quantification transaction strategy and cross-platform compiling method, system and computer program product.The method comprises the following steps: receiving source control script to be compiled, and parsing into first intermediate representation code (TIR-H);TIR-H code is parsed into abstract syntax tree and is degraded into second intermediate representation code (TIR-M), and control flow graph and data flow dependency graph are generated;Static timing violation audit is performed at TIR-M level during compilation period, and TIR-M is converted into static single assignment form third intermediate representation code (TIR-L) after audit;According to target execution platform identification, TIR-L is translated into corresponding target executable script.The application realizes the cross-platform automatic compilation of quantification transaction strategy by three-level intermediate representation architecture, automatically completes static security audit during compilation period, and improves the cross-platform migration efficiency and security of strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of computer compilation technology, static program analysis, and artificial intelligence code generation. Specifically, it relates to an intermediate representation (IR) architecture for control flow programs (i.e., structured executable scripts) with temporal data dependencies, and a compilation, translation, and compile-time static security auditing method based on this architecture. This invention further relates to AI-driven code generation and compilation optimization technology, specifically a method for generating structured intermediate representation code using a Large Language Model (LLM), and an AI code quality automatic auditing and reinforcement learning feedback optimization mechanism based on this method. This invention is particularly suitable for solving problems in the following technical scenarios: semantic preservation and automatic cross-platform migration of domain-specific scripts across heterogeneous execution platforms; compile-time implicit data flow conflict detection and automatic blocking of temporal logic violations; static syntactic constraints and verifiable code generation for unstructured text output from a Large Language Model; and standardized accumulation, version management, and auditable reuse of domain-specific script assets. Background Technology

[0002] In scenarios where computer compilation technology intersects with domain-specific script execution, particularly in the writing, deployment, and maintenance of control flow programs with time-series data dependencies, a severe dilemma of "heterogeneous platform semantic fragmentation" currently exists. Existing technologies globally use proprietary domain-specific scripting languages. TradingView uses PineScript, VeighNa uses Python, WenHua Finance uses Memcached, MetaTrader uses MQL4 / 5, and QuantConnect and NinjaTrader use C#, among others. The syntax, function libraries, and data models of different platforms are completely incompatible. The implementation code for the same logic differs drastically across different platforms, forcing developers to master multiple languages ​​and platform ecosystems. The incompatibility of syntax, function libraries, and data models across platforms prevents script code from achieving automatic cross-platform migration through conventional compiler optimization and conversion methods. When a script needs to be migrated from one platform to another, developers must manually rewrite the code; the migration workload is equivalent to developing from scratch, and business logic cannot be effectively preserved and reused. Existing compilation systems and execution environments lack the ability to statically analyze data flow dependencies in script code, and therefore cannot automatically identify the following risks during compilation: temporal forward-looking violations, i.e., the script references future data nodes that are not currently available in the context of a specific time anchor; missing boundary protection primitives, i.e., no corresponding boundary protection trigger mechanism is set after the script's state change nodes; and cumulative constraint out-of-bounds, i.e., the script's loop and branch logic causes the theoretical cumulative multiplier to exceed the safety threshold. The detection of these risks currently relies mainly on manual code review, which is inefficient, has limited coverage, and inconsistent quality. Currently, large language models are widely used to automatically generate executable script code. However, this technical approach faces the following structural challenges: high illusion rate (research shows that approximately 40% of the code generated by LLM contains syntax errors or logical flaws, fundamentally because LLM's token-by-token probabilistic generation mechanism cannot guarantee that the output conforms to the constraints of the target syntax); lack of interpretability (LLM-generated code is the result of token-by-token probabilistic concatenation, and the model itself cannot explain "why" such code is generated); lack of security constraints (AI-generated code typically does not contain security boundary primitives); and inability to achieve closed-loop optimization (due to the lack of a standardized quality assessment system, AI-generated scripts cannot form a positive feedback loop of "generation, evaluation, and optimization"). The root cause of these problems lies in the fact that, in existing technologies, LLM outputs free text or unstructured code, lacking a structured intermediate representation format that can be directly parsed and verified by a compiler, and lacking a mechanism for constraining the output space with a finite state machine during the decoding phase. Furthermore, the script code is scattered across different platforms, making it impossible to form a unified and manageable asset library, hindering intellectual property protection; open source exposes the logic, while closed source makes it impossible to audit and verify.Regulatory bodies also lack a standardized methodology for script description and analysis, making it difficult to conduct efficient and accurate compliance reviews and risk identification of massive amounts of diverse script code. Existing technologies include: PineScript, which is limited to the TradingView platform, is closed-source, and cannot be migrated; Python quantization frameworks are limited to the Python ecosystem and cannot cover other platform languages; the Mic language is platform-specific and has a closed syntax; traditional cross-platform solutions typically only provide adaptation within a single language ecosystem and cannot cover domain-specific languages ​​like PineScript and Mic; general-purpose compilers (IR) are geared towards general programming languages, do not include time-series data dependency semantics, and cannot be directly used in this scenario; manual code review is inefficient, has limited coverage, and inconsistent quality. The fundamental reason why existing technologies have not solved these problems is the lack of an intermediate representation layer that includes time-series data dependency semantics while being independent of any specific platform, capable of establishing a standardized bridging mechanism between upstream logic writing and downstream platform execution. Summary of the Invention

[0003] The purpose of this invention is to provide a multi-level intermediate representation architecture and its supporting compilation, translation, and compile-time static auditing methods, systems, and computer program products to solve core technical problems in the prior art, such as difficulties in cross-platform migration of domain-specific scripts, lack of compile-time security auditing, low quality of AI generation, and difficulties in asset accumulation.

[0004] This invention proposes a domain-specific scripting intermediate representation language called TIR (Trading Intermediate Representation) and its supporting system. The core design principle of TIR is to completely decouple business logic from the execution environment. Developers only need to write TIR code once, which can then be translated to any target platform using the system of this invention. Security auditing and quality assessment are automatically completed during the compilation process. The core technical solution of this invention is a three-layer intermediate representation architecture for domain-specific scripting, consisting of three layers: The first layer, TIR-H, is a human-readable intermediate representation, a domain-specific language designed specifically for control flow programs with time-series data dependencies. Its syntax is close to a hybrid of natural language and domain terminology, embedding objects with precise technical meanings, such as market (time-series state feature flow), asset (system state snapshot), trade (operation operator), and indicator (technical indicator operator), as first-level citizens of the language. It natively supports stochastic calculus (Ito's lemma, Brownian motion, Wiener process), probability distribution functions (normal distribution, t-distribution, Poisson distribution), and numerical methods (numerical integration, numerical differentiation, Monte Carlo simulation) at the language level. The first layer performs advanced mathematical operations, rather than calling external function libraries; the second layer, TIR-M, is a machine-optimized intermediate representation, which is the intermediate code generated after TIR-H is downgraded. It eliminates all implicit operations and syntactic sugar, completes type inference, contains a complete control flow graph and data flow dependency graph, and converts all event anchor declarations into explicit event handling nodes. It is an ideal input layer for compile-time static safety auditing and performance analysis; the third layer, TIR-L, is the underlying intermediate representation, which is the platform-independent underlying representation generated after TIR-M is further downgraded. It adopts a static single assignment form, and the instructions do not depend on any specific target platform's API. It supports compiler backend optimization techniques such as register allocation and instruction scheduling, and can be directly mapped by the code generator to the target platform's instruction set or API call sequence. This invention further includes a compile-time static security auditing method based on TIR-M, which is automatically executed as an integral part of the compilation pipeline before the script is translated to the target platform: Timing-forward violation detection detects the existence of directed edges from future data nodes to the current computation node by constructing an adjacency matrix of the data flow dependency graph and performing a depth-first or breadth-first search; boundary protection primitive integrity detection checks whether boundary protection triggers primitives by traversing all reachable paths from state change nodes through path sensitivity analysis; and cumulative constraint out-of-bounds detection calculates the theoretical maximum cumulative multiplier by parsing the loop and branch logic in the control flow graph and comparing it with a security threshold. The audit results are summarized into a structured audit report, and high-risk scripts can be rejected for compilation.The present invention also includes a cross-platform code generation method based on TIR-L, a complete definition of system architecture, a reverse static compilation method, and an AI-TIR collaborative workflow method based on a large language model and a TIR intermediate representation.

[0005] Compared with existing technologies, this invention has the following advantages: Through automatic code generation from TIR-L to multiple target platforms, the manual rewriting workload for cross-platform script migration is reduced from 100% to automatic completion by the compiler, and migration time is shortened from days to minutes; through static analysis at the TIR-M level, the manual review coverage of script security risks is increased from less than 30% to 100% full coverage by the compiler, enabling automatic detection and blocking of timing logic violations and boundary protection deficiencies during compilation; through structured syntax constraints of TIR-H and Logits mask filtering based on finite state machines, syntax errors in script code generated from large language models are detected. The error rate was reduced from approximately 40% to near zero; the TIR-H code output by AI is structured, human-readable, and possesses complete interpretability and auditability; through static auditing and policy scoring at the TIR-M level, objective and automated reward signals are provided for large language models, enabling AI to autonomously optimize its policy generation capabilities without human annotation intervention; TIR-H code is independent of any specific platform and can be version-managed, reused, and passed on as a long-term maintainable asset; TIR provides a standardized script description format, allowing regulatory agencies to conduct automated compliance reviews of submitted scripts, improving review efficiency from human days to minutes. Attached Figure Description

[0006] Figure 1 This is a schematic diagram of the three-level TIR architecture of the present invention, which shows the hierarchical relationship, technical features and conversion process of TIR-H, TIR-M and TIR-L. Figure 2 This is a system module architecture diagram of the present invention, which shows the division and cooperation relationship of the parser module, degradation engine module, static auditor module, code generator module, and strategy scoring engine module. Figure 3 This is a flowchart of the static security audit process during compilation of this invention, which shows the complete audit process and blocking compilation mechanism for temporal forward violation detection, boundary protection primitive integrity detection, and cumulative constraint out-of-bounds detection. Figure 4 This is a flowchart of the cross-platform code generation process of the present invention, which shows the mapping and generation process from TIR-L to target code such as PineScript, Python, C#, and Minecraft. Figure 5 This is a flowchart of the reverse static compilation process of the present invention, which shows the complete reverse compilation process from existing heterogeneous platform scripts through source platform abstract syntax tree parsing, reverse mapping rule base normalization mapping, and finally generating standardized TIR-H. Figure 6This is the AI-TIR collaborative workflow diagram of the present invention, which shows the complete closed-loop process of natural language intent parsing, Logits mask filtering based on finite state machine and TIR-H structured generation, static auditing, policy health scoring, and reinforcement learning feedback optimization, forming a positive cycle of "generation → auditing → scoring → feedback → evolution". Detailed Implementation

[0007] The present invention will now be described in further detail with reference to the accompanying drawings.

[0008] Example 1: Degradation process from TIR-H to TIR-M Taking the dual moving average strategy as an example, enter the following TIR-H code: strategy "DualMA" { fast_period = 10 slow_period = 30 risk_per_trade = 0.02 indicator ma_fast = sma(close, fast_period) indicator ma_slow = sma(close, slow_period) condition entry_long when crossover(ma_fast, ma_slow) condition exit_long when crossunder(ma_fast, ma_slow) action buy: market(order_size = 1%) action sell: market(order_size = 100%) on entry_long: set_stop_loss(risk_per_trade) set_take_profit(0.05) } After being processed by the downgrade engine, the above TIR-H code generates the following TIR-M intermediate representation: STRATEGY: name="DualMA" PARAM: fast_period TYPE=int VALUE=10 PARAM: slow_period TYPE=int VALUE=30 VARIABLE: ma_fast TYPE=series <float>= SMA(INPUT=market.close, WINDOW=fast_period) VARIABLE: ma_slow TYPE=series <float>= SMA(INPUT=market.close, WINDOW=slow_period) CONDITION: entry_long = CROSSOVER(ma_fast, ma_slow) CONDITION: exit_long = CROSSUNDER(ma_fast, ma_slow) BLOCK: on_entry_long CALL: order.set_stop_loss(ratio=0.02) CALL: order.set_take_profit(ratio=0.05) BLOCK: on_exit_long CALL: order.execute(order=sell) / / Control flow graph edges entry_long → on_entry_long exit_long → on_exit_long / / Data stream dependency ma_fast ← market.close, fast_period ma_slow ← market.close, slow_period entry_long ← ma_fast, ma_slow The degradation process first performs syntactic sugar elimination to make implicit operations explicit, then performs type inference to complete data type labeling, and finally constructs a complete control flow graph and data flow dependency graph.

[0009] Example 2: Temporal Foresight Violation Detection (Future Function Detection) Take the following TIR-M code segment to be audited as an example: @event(on="bar_open") CONDITION: entry = market.close > SMA(market.high, LOOKAHEAD=5) When the static auditor performs look-ahead violation detection, it first constructs an adjacency matrix from the data flow dependency graph, then labels it with timestamps (bar_open for the current anchor point, LOOKAHEAD=5 for future data nodes), and finally performs a depth-first search to check for directed edges from future data nodes to the current compute node. The system outputs the following audit report after the detection: [ERROR] Timing forward violation detection failed. Position: Line 2 Risk level: High Description: A future data node is referenced in the context of @event(on="bar_open"). - market.close is not yet determined at the time of bar_open. - market.high uses lookahead=5 (for the next 5 periods). suggestion: 1. Change the event anchor to @event(on="bar_close") 2. Alternatively, change the lookahead parameter to <= 0. 3. Alternatively, use the lag() function to access historical data.

[0010] Example 3: Boundary Protection Primitive Integrity Detection (Missing Detection) Take the following TIR-M code segment to be audited as an example: ACTION: buy = market(order_size = 0.5) When the static auditor performs boundary protection primitive integrity checks, it employs path sensitivity analysis. First, it locates the state change node (trade.execute) in the control flow graph. Then, starting from that node, it traverses all reachable paths, checking whether each path passes through the boundary protection trigger primitive (set_stop_loss). The system outputs the following audit report after the check: [WARNING] Boundary Protection Primitive Integrity Check Position: Line 1 Risk level: Medium Description: In the control flow graph, among all reachable paths originating from the state change node "buy", there exists a path that does not pass through the boundary protection primitive node. Recommendation: Add the `set_stop_loss()` directive after the state change operation. Example: on entry_long: set_stop_loss(0.02)

[0011] Example 4: Cross-platform code generation Taking the following SSA form input for TIR-L as an example: SSA_FORM: v1 = LOAD(market.close) v2 = SMA(v1, 10) v3 = SMA(v1, 30) v4 = CROSSOVER(v2, v3) BRANCH v4 → BLOCK_ENTRY BLOCK_ENTRY: v5 = ORDER_MARKET(side="buy", size=0.01) v6 = SET_STOP_LOSS(0.02) v7 = SET_TAKE_PROFIT(0.05) The code generator, based on the target platform identifier, retrieves the corresponding syntax mapping rules and API mapping rules from the platform mapping rule library. It then iterates through the static single-assignment instruction sequence of TIR-L, converting each instruction into equivalent code for the target platform according to the mapping rules, and performs platform-specific syntax optimizations, ultimately outputting a complete target executable script. An example of the target platform code generated by this TIR-L code generation is shown below: PineScript output: ma_fast = ta.sma(close, 10) ma_slow = ta.sma(close, 30) if ta.crossover(ma_fast, ma_slow) strategy.entry("Long", strategy.long, 0.01) strategy.exit("Exit", "Long", stop=..., limit=...) Python (VeighNa) output: ma_fast = am.sma(10, array=True) ma_slow = am.sma(30, array=True) if cross_over(ma_fast, ma_slow): self.buy(price, 0.01) self.sell(price, 0.01, stop=True, stop_price=...) C# (QuantConnect) output: var ma_fast = SMA(close, 10); var ma_slow = SMA(close, 30); if (ma_fast > ma_slow && ma_fast[1] <= ma_slow[1]) SetHoldings(symbol, 0.01); StopMarketOrder(symbol, -0.01, ...); Microphone language output: MA_FAST := MA(CLOSE, 10); MA_SLOW := MA(CLOSE, 30); CROSS(MA_FAST, MA_SLOW), BK(1%); CROSS(MA_SLOW, MA_FAST), SK(100%);

[0012] Example 5: Reverse Static Compilation – From PineScript to TIR-H Take the following PineScript code as an example: / / @version=5 strategy("MyStrategy", overlay=true) fast = ta.sma(close, 10) slow = ta.sma(close, 30) if (ta.crossover(fast, slow)) strategy.entry("Long", strategy.long, 1) if (ta.crossunder(fast, slow)) strategy.entry("Short", strategy.short, 1) The reverse static compilation module first identifies the source platform type as PineScript, calls the corresponding lexical / syntactic analysis engine to restore the code to the source platform's abstract syntax tree, and then uses the reverse mapping rule library to traverse the syntax tree, normalizing and mapping PineScript's APIs such as ta.sma, ta.crossover, and ta.crossunder, as well as syntactic sugar structures, to equivalent representations that conform to the semantics of the TIR-H core vocabulary. The final output is the following standardized TIR-H code: strategy "MyStrategy" { indicator fast = sma(close, 10) slow indicator = sma(close, 30) condition entry_long when crossover(fast, slow) condition entry_short when crossunder(fast, slow) action buy: market(order_size = 100%) action sell: market(order_size = 100%) }

[0013] Example 6: AI-TIR Collaborative Workflow Step A: The user inputs the strategy intent in natural language: "Buy when RSI is below 30, sell when it is above 70, and set a stop loss of 2%"; Step B involves using a large language model to parse natural language intent into structured policy parameters. During the decoding phase, a finite state machine based on TIR-H syntax is used to mask and filter the Logits output by the LLM, forcing the generation of code that conforms to the TIR-H syntax specification. The output is the following TIR-H code: strategy "RSI_Strategy" { rsi_period = 14 oversold = 30 overbought = 70 risk_per_trade = 0.02 indicator rsi_val = rsi(close, rsi_period) condition buy when rsi_val < oversold condition sell when rsi_val > overbought action buy: market(order_size = 1%) action sell: market(order_size = 100%) on buy: set_stop_loss(risk_per_trade) } Step C: Input the generated TIR-H code into the static auditor to perform the audit. The audit results are: future function detection passed, missing stop loss detection passed, and leverage over-limit detection passed. Step D: The strategy scoring engine outputs a health score of 85 / 100, including 95 / 100 for syntax correctness, 80 / 100 for risk control integrity, and 80 / 100 for logic robustness. It also suggests adding a take-profit order to further improve risk control integrity. Step E: The audit report and scoring results are fed back to the large language model as a reward signal. The reward signal is calculated as Reward = α·Pass_syntax + β·Score_audit - γ·Complexity_cfg, where Pass_syntax is the syntax validation pass rate, Score_audit is the audit score, and Complexity_cfg is the control flow graph complexity. In step F, the large language model is fine-tuned or learns from the context based on the reward signal. After multiple iterations, the generated policy score gradually increases from 85 points to over 95 points, forming a positive closed loop of AI self-optimization: "generation → auditing → scoring → feedback → evolution".

[0014] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / float> < / float>

Claims

1. A multi-level intermediate representation and cross-platform compilation method for quantitative trading strategies, characterized in that, Includes the following steps: S1: Receive the source control script to be compiled, and parse the source control script into standardized first intermediate representation code (TIR-H); the TIR-H is a text with domain-specific semantic constraints, and its core vocabulary natively integrates domain-level abstract objects that declare time-series data feature stream semantics, system state snapshot semantics, operation operator semantics and technical indicator operator semantics; S2: Parse the TIR-H code into an abstract syntax tree, perform type inference and implicit syntax elimination, downgrade the abstract syntax tree into a second intermediate representation code (TIR-M), and generate the corresponding control flow graph (CFG) and data flow dependency graph; S3: At the TIR-M level, the data flow dependency graph is used to perform compile-time static timing violation audit on the TIR-M; if the audit passes, the TIR-M is transformed into a static single assignment (SSA) form to generate a third intermediate representation code (TIR-L) that is independent of the target execution environment. S4: Obtain the target execution platform identifier, and according to the syntax and API mapping rules corresponding to the target execution platform identifier, traverse the static single assignment instruction sequence of the TIR-L and translate the TIR-L into the target executable script corresponding to the target execution platform.

2. The method according to claim 1, characterized in that, The specific steps of performing compile-time static timing violation auditing at the TIR-M level include: Temporal look-ahead violation detection: Extract the timestamp dependencies in the data flow dependency graph, and detect whether there are references to future data nodes with timestamps greater than the current timestamp within the context of a specific time anchor event node; if so, trigger temporal look-ahead anomaly blocking and output the first correction suggestion; Boundary protection primitive integrity check: Traverse the state change nodes in the control flow graph and search whether the control flow topology path branch corresponding to each state change node contains the corresponding boundary protection trigger primitive within the preset topology depth; if it does not contain it, it is determined that the safety boundary is missing and a second correction suggestion is output. Cumulative constraint out-of-bounds detection: Analyze the loop and branch logic in the control flow graph, calculate the theoretical maximum cumulative multiplier of the state variables during dynamic execution; if the maximum cumulative multiplier exceeds the safety threshold, it is determined to be an out-of-bounds risk and a third correction suggestion is output; The above test results are summarized into a structured audit report, which includes risk level, code location, risk description, and modification suggestions.

3. The method according to claim 1, characterized in that, Step S4 specifically includes: Obtain the target execution platform identifier; Based on the target execution platform identifier, obtain the corresponding syntax mapping rules and API mapping rules from the platform mapping rule base; Traverse the static single-assignment instruction sequence of TIR-L and convert each instruction into the equivalent code of the target execution platform according to the mapping rules; Perform platform-specific syntax optimizations on the generated code; Output the target executable script corresponding to the target execution platform.

4. A multi-level intermediate representation system for a quantitative trading strategy, characterized in that, include: The parser module is used to parse TIR-H source code into an abstract syntax tree; A degradation engine module is used to progressively downgrade the abstract syntax tree to TIR-M and TIR-L; The static auditor module is used to perform compile-time static security audits at the TIR-M level, detect forward-looking violations, missing boundary protection primitives, and risks of cumulative constraint out-of-bounds violations, and generate structured audit reports. The code generator module is used to translate TIR-L into target executable scripts corresponding to the target execution platform; Wherein, TIR-H is a human-readable domain-specific language containing domain-level abstract objects, TIR-M contains a complete control flow graph and data flow dependencies, and TIR-L adopts a static single-assignment form.

5. The system according to claim 4, characterized in that, Also includes: The reverse static compilation module is used to obtain existing scripts written on existing heterogeneous execution platforms, identify their source platform types, and call the corresponding lexical / syntax analysis engine to restore the existing scripts to the source platform abstract syntax tree; The source platform abstract syntax tree is traversed using a reverse mapping rule base, and its API and syntactic sugar structures are normalized and mapped to equivalent representations that conform to the semantics of the TIR-H core vocabulary, outputting standardized TIR-H code.

6. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 3.

7. The method according to claim 1, characterized in that, It also includes a strategy health scoring step: Static features based on TIR-M include cyclomatic complexity, risk control instruction coverage, and code standardization indicators; The health score of the strategy is calculated according to the preset scoring model; Output a quantitative score result from 0 to 100.

8. The method according to claim 1, characterized in that, It also includes the steps of the AI-TIR collaborative generation strategy: Receive the user's trading strategy intent described in natural language; The natural language intent is parsed into structured policy parameters using a large language model; During the decoding stage of the large language model, the output Logits are masked and filtered using a finite state machine based on TIR-H syntax to force the generation of code that conforms to the TIR-H syntax specification. The TIR-H code is input into the compile-time static timing violation auditing steps described in claim 2 to generate an audit report and a health score. The audit report and health score are used as reward signals and fed back to the large language model to optimize subsequent strategy generation.