quantnodes 3.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- QuantNodes/__init__.py +15 -0
- QuantNodes/__main__.py +14 -0
- QuantNodes/agent/__init__.py +158 -0
- QuantNodes/agent/agents/__init__.py +13 -0
- QuantNodes/agent/agents/definition.py +180 -0
- QuantNodes/agent/agents/manager.py +73 -0
- QuantNodes/agent/config/__init__.py +34 -0
- QuantNodes/agent/config/executor.py +958 -0
- QuantNodes/agent/config/loader.py +427 -0
- QuantNodes/agent/config/templates/bollinger_bands.yaml +84 -0
- QuantNodes/agent/config/templates/dual_ma.yaml +72 -0
- QuantNodes/agent/config/templates/empty.yaml +56 -0
- QuantNodes/agent/config/templates/mean_reversion.yaml +47 -0
- QuantNodes/agent/config/templates/mean_reversion_zscore.yaml +90 -0
- QuantNodes/agent/config/templates/momentum.yaml +81 -0
- QuantNodes/agent/config/templates/momentum_breakout.yaml +84 -0
- QuantNodes/agent/config/templates/rsi_strategy.yaml +72 -0
- QuantNodes/agent/config/templates/volume_price.yaml +86 -0
- QuantNodes/agent/config/types.py +156 -0
- QuantNodes/agent/config_mapper.py +293 -0
- QuantNodes/agent/core/__init__.py +19 -0
- QuantNodes/agent/core/dream.py +47 -0
- QuantNodes/agent/core/quant_dream.py +274 -0
- QuantNodes/agent/cron_jobs.py +314 -0
- QuantNodes/agent/nanobot_bridge.py +242 -0
- QuantNodes/agent/permission/__init__.py +30 -0
- QuantNodes/agent/permission/defaults.py +36 -0
- QuantNodes/agent/permission/evaluate.py +41 -0
- QuantNodes/agent/permission/models.py +59 -0
- QuantNodes/agent/permission/service.py +133 -0
- QuantNodes/agent/providers/__init__.py +11 -0
- QuantNodes/agent/providers/base.py +102 -0
- QuantNodes/agent/providers/quantnodes.py +610 -0
- QuantNodes/agent/providers/rate_limiter.py +326 -0
- QuantNodes/agent/providers/registry.py +163 -0
- QuantNodes/agent/skills/__init__.py +20 -0
- QuantNodes/agent/skills/base.py +118 -0
- QuantNodes/agent/skills/bridge.py +73 -0
- QuantNodes/agent/skills/factor/__init__.py +14 -0
- QuantNodes/agent/skills/factor/correlation.py +99 -0
- QuantNodes/agent/skills/factor/group_backtest.py +114 -0
- QuantNodes/agent/skills/factor/ic_analysis.py +106 -0
- QuantNodes/agent/skills/loader.py +107 -0
- QuantNodes/agent/skills/registry.py +105 -0
- QuantNodes/agent/skills/strategy/__init__.py +16 -0
- QuantNodes/agent/skills/strategy/bollinger.py +86 -0
- QuantNodes/agent/skills/strategy/dual_ma.py +82 -0
- QuantNodes/agent/skills/strategy/momentum.py +74 -0
- QuantNodes/agent/skills/strategy/rsi_reversal.py +99 -0
- QuantNodes/agent/skills_quant/__init__.py +14 -0
- QuantNodes/agent/skills_quant/backtest-analyze/SKILL.md +42 -0
- QuantNodes/agent/skills_quant/config-driven/SKILL.md +72 -0
- QuantNodes/agent/skills_quant/factor-research/SKILL.md +40 -0
- QuantNodes/agent/skills_quant/quant-dream/SKILL.md +55 -0
- QuantNodes/agent/skills_quant/risk-management/SKILL.md +45 -0
- QuantNodes/agent/skills_quant/strategy-design/SKILL.md +43 -0
- QuantNodes/agent/templates/__init__.py +4 -0
- QuantNodes/agent/tools/__init__.py +173 -0
- QuantNodes/agent/tools/_workspace.py +51 -0
- QuantNodes/agent/tools/alpha_backtest.py +328 -0
- QuantNodes/agent/tools/alpha_evaluate.py +493 -0
- QuantNodes/agent/tools/backtest.py +226 -0
- QuantNodes/agent/tools/base.py +133 -0
- QuantNodes/agent/tools/code_search.py +207 -0
- QuantNodes/agent/tools/config_backtest.py +401 -0
- QuantNodes/agent/tools/context.py +97 -0
- QuantNodes/agent/tools/dream_skill.py +77 -0
- QuantNodes/agent/tools/echo.py +38 -0
- QuantNodes/agent/tools/factor.py +231 -0
- QuantNodes/agent/tools/file_ops.py +201 -0
- QuantNodes/agent/tools/git_ops.py +190 -0
- QuantNodes/agent/tools/operator_lookup.py +218 -0
- QuantNodes/agent/tools/output_truncation.py +77 -0
- QuantNodes/agent/tools/path_check.py +43 -0
- QuantNodes/agent/tools/pipeline.py +62 -0
- QuantNodes/agent/tools/registry.py +150 -0
- QuantNodes/agent/tools/sandbox.py +62 -0
- QuantNodes/agent/tools/shell_safety.py +63 -0
- QuantNodes/agent/tools/strategy.py +106 -0
- QuantNodes/agent/tools/task.py +171 -0
- QuantNodes/agent/tools/web_fetch.py +142 -0
- QuantNodes/agent/tools/web_search.py +114 -0
- QuantNodes/agent/tools/wiki.py +370 -0
- QuantNodes/agent/utils/__init__.py +11 -0
- QuantNodes/agent/utils/helpers.py +43 -0
- QuantNodes/agent/utils/prompt_templates.py +30 -0
- QuantNodes/agent/workflows/__init__.py +20 -0
- QuantNodes/agent/workflows/implementations/__init__.py +8 -0
- QuantNodes/agent/workflows/implementations/alpha_gpt.py +508 -0
- QuantNodes/agent/workflows/implementations/mcts.py +442 -0
- QuantNodes/agent/workflows/parsers.py +44 -0
- QuantNodes/agent/workflows/registry.py +119 -0
- QuantNodes/agent/workflows/step_agent.py +219 -0
- QuantNodes/agent/workflows/tool.py +198 -0
- QuantNodes/ai/__init__.py +93 -0
- QuantNodes/ai/llm/__init__.py +75 -0
- QuantNodes/ai/llm/base.py +233 -0
- QuantNodes/ai/llm/decorators.py +281 -0
- QuantNodes/ai/llm/gateway.py +571 -0
- QuantNodes/ai/llm/null.py +76 -0
- QuantNodes/ai/llm/openai.py +435 -0
- QuantNodes/ai/optimizer.py +405 -0
- QuantNodes/ai/prompts/__init__.py +229 -0
- QuantNodes/ai/sandbox.py +371 -0
- QuantNodes/ai/sandbox_pandas_bridge.py +150 -0
- QuantNodes/ai/strategy_gen.py +396 -0
- QuantNodes/backtest/__init__.py +64 -0
- QuantNodes/backtest/backtest_node.py +188 -0
- QuantNodes/backtest/broker_node.py +378 -0
- QuantNodes/backtest/config_runner.py +397 -0
- QuantNodes/backtest/config_strategy.py +64 -0
- QuantNodes/backtest/risk_node.py +360 -0
- QuantNodes/backtest/strategy_node.py +268 -0
- QuantNodes/cache_node/__init__.py +19 -0
- QuantNodes/cache_node/base.py +244 -0
- QuantNodes/cache_node/cache_store.py +99 -0
- QuantNodes/cache_node/metadata.py +100 -0
- QuantNodes/cli/__init__.py +109 -0
- QuantNodes/cli/_helpers.py +511 -0
- QuantNodes/cli/command.py +110 -0
- QuantNodes/cli/commands/__init__.py +69 -0
- QuantNodes/cli/commands/agent.py +158 -0
- QuantNodes/cli/commands/alpha.py +951 -0
- QuantNodes/cli/commands/chat.py +38 -0
- QuantNodes/cli/commands/evolve.py +120 -0
- QuantNodes/cli/commands/factor.py +569 -0
- QuantNodes/cli/commands/init.py +190 -0
- QuantNodes/cli/commands/run.py +259 -0
- QuantNodes/cli/commands/serve.py +398 -0
- QuantNodes/cli/commands/version.py +120 -0
- QuantNodes/cli/enhanced.py +146 -0
- QuantNodes/conf_node/__init__.py +37 -0
- QuantNodes/conf_node/base.py +120 -0
- QuantNodes/conf_node/env_config.py +132 -0
- QuantNodes/conf_node/ini_config.py +70 -0
- QuantNodes/conf_node/json_config.py +69 -0
- QuantNodes/conf_node/yaml_config.py +78 -0
- QuantNodes/constants.py +17 -0
- QuantNodes/core/__init__.py +196 -0
- QuantNodes/core/_lookback_helpers.py +49 -0
- QuantNodes/core/ast_parser.py +198 -0
- QuantNodes/core/base.py +61 -0
- QuantNodes/core/cache_manager.py +344 -0
- QuantNodes/core/cache_utils.py +150 -0
- QuantNodes/core/cond_builder.py +53 -0
- QuantNodes/core/config.py +170 -0
- QuantNodes/core/constants.py +48 -0
- QuantNodes/core/control.py +412 -0
- QuantNodes/core/data_preprocessing.py +453 -0
- QuantNodes/core/data_source.py +46 -0
- QuantNodes/core/events.py +178 -0
- QuantNodes/core/evolution/__init__.py +22 -0
- QuantNodes/core/evolution/loop.py +583 -0
- QuantNodes/core/evolution/operators.py +289 -0
- QuantNodes/core/evolution/settings.py +44 -0
- QuantNodes/core/expression.py +841 -0
- QuantNodes/core/feedback/__init__.py +38 -0
- QuantNodes/core/feedback/channels.py +182 -0
- QuantNodes/core/feedback/collector.py +91 -0
- QuantNodes/core/feedback/dataclass.py +239 -0
- QuantNodes/core/feedback/llm_judge.py +138 -0
- QuantNodes/core/knowledge/__init__.py +69 -0
- QuantNodes/core/knowledge/knowledge_base.py +217 -0
- QuantNodes/core/knowledge/lineage_compress.py +196 -0
- QuantNodes/core/knowledge/lineage_expand.py +123 -0
- QuantNodes/core/knowledge/metrics/__init__.py +43 -0
- QuantNodes/core/knowledge/metrics/evaluator.py +176 -0
- QuantNodes/core/knowledge/metrics/metrics.py +220 -0
- QuantNodes/core/knowledge/rag_prompt.py +196 -0
- QuantNodes/core/knowledge/retriever.py +209 -0
- QuantNodes/core/lambda_node.py +81 -0
- QuantNodes/core/monitoring/__init__.py +22 -0
- QuantNodes/core/monitoring/collector.py +292 -0
- QuantNodes/core/monitoring/dashboard.py +365 -0
- QuantNodes/core/node.py +375 -0
- QuantNodes/core/pandas_utils.py +504 -0
- QuantNodes/core/parallel/__init__.py +15 -0
- QuantNodes/core/parallel/worker.py +140 -0
- QuantNodes/core/parallel/worker_process.py +265 -0
- QuantNodes/core/path_utils.py +73 -0
- QuantNodes/core/pipeline.py +328 -0
- QuantNodes/core/plugin.py +135 -0
- QuantNodes/core/quality_gate/__init__.py +32 -0
- QuantNodes/core/quality_gate/complexity.py +94 -0
- QuantNodes/core/quality_gate/consistency.py +26 -0
- QuantNodes/core/quality_gate/node.py +97 -0
- QuantNodes/core/quality_gate/redundancy.py +51 -0
- QuantNodes/core/quality_gate/settings.py +43 -0
- QuantNodes/core/quality_gate/zoo.py +98 -0
- QuantNodes/core/serializable.py +116 -0
- QuantNodes/core/serialization.py +673 -0
- QuantNodes/core/tools.py +333 -0
- QuantNodes/core/trajectory/__init__.py +25 -0
- QuantNodes/core/trajectory/entry.py +116 -0
- QuantNodes/core/trajectory/lineage.py +67 -0
- QuantNodes/core/trajectory/pool.py +211 -0
- QuantNodes/core/trajectory/selector.py +140 -0
- QuantNodes/core/visualization/__init__.py +33 -0
- QuantNodes/core/visualization/builder.py +233 -0
- QuantNodes/core/visualization/gate_breakdown.py +140 -0
- QuantNodes/core/visualization/lineage_dag.py +203 -0
- QuantNodes/core/visualization/metric_distribution.py +125 -0
- QuantNodes/core/visualization/report.py +68 -0
- QuantNodes/database_node/__init__.py +69 -0
- QuantNodes/database_node/base.py +135 -0
- QuantNodes/database_node/clickhouse_node.py +272 -0
- QuantNodes/database_node/csv_node.py +83 -0
- QuantNodes/database_node/duckdb_node.py +86 -0
- QuantNodes/database_node/factory.py +83 -0
- QuantNodes/database_node/mysql_node.py +100 -0
- QuantNodes/database_node/parquet_node.py +75 -0
- QuantNodes/database_node/sqlite_node.py +67 -0
- QuantNodes/factor_node/__init__.py +50 -0
- QuantNodes/factor_node/factor.py +563 -0
- QuantNodes/factor_node/factor_db.py +421 -0
- QuantNodes/factor_node/factor_functions/__init__.py +252 -0
- QuantNodes/factor_node/factor_functions/_helpers.py +358 -0
- QuantNodes/factor_node/factor_functions/_helpers_debug.py +317 -0
- QuantNodes/factor_node/factor_functions/composite_ops.py +136 -0
- QuantNodes/factor_node/factor_functions/math_ops.py +433 -0
- QuantNodes/factor_node/factor_functions/section_ops.py +290 -0
- QuantNodes/factor_node/factor_functions/talib_ops.py +1293 -0
- QuantNodes/factor_node/factor_functions/time_ops.py +535 -0
- QuantNodes/factor_node/factor_operation.py +1115 -0
- QuantNodes/factor_node/factor_table.py +1073 -0
- QuantNodes/factor_node/quant_nodes_object.py +60 -0
- QuantNodes/mcp_server/__init__.py +27 -0
- QuantNodes/mcp_server/__main__.py +4 -0
- QuantNodes/mcp_server/server.py +272 -0
- QuantNodes/methods/__init__.py +28 -0
- QuantNodes/methods/pipeline.py +100 -0
- QuantNodes/methods/sandbox.py +102 -0
- QuantNodes/monitor/__init__.py +27 -0
- QuantNodes/monitor/agent_tools/__init__.py +5 -0
- QuantNodes/monitor/agent_tools/monitor_tool.py +98 -0
- QuantNodes/monitor/agent_tools/schedule_tool.py +98 -0
- QuantNodes/monitor/agent_tools/version_tool.py +133 -0
- QuantNodes/monitor/monitor/__init__.py +6 -0
- QuantNodes/monitor/monitor/alerter.py +60 -0
- QuantNodes/monitor/monitor/collector.py +164 -0
- QuantNodes/monitor/monitor/dashboard.py +115 -0
- QuantNodes/monitor/monitor/drift.py +190 -0
- QuantNodes/monitor/scheduler/__init__.py +4 -0
- QuantNodes/monitor/scheduler/runner.py +133 -0
- QuantNodes/monitor/scheduler/scheduler.py +184 -0
- QuantNodes/monitor/storage/__init__.py +16 -0
- QuantNodes/monitor/storage/models.py +70 -0
- QuantNodes/monitor/storage/repository.py +407 -0
- QuantNodes/monitor/version/__init__.py +4 -0
- QuantNodes/monitor/version/diff.py +81 -0
- QuantNodes/monitor/version/version_manager.py +182 -0
- QuantNodes/operator_node/__init__.py +28 -0
- QuantNodes/operator_node/base.py +97 -0
- QuantNodes/operator_node/query_node.py +129 -0
- QuantNodes/operator_node/sql_builder.py +125 -0
- QuantNodes/operator_node/sql_utils.py +172 -0
- QuantNodes/operator_node/transform.py +130 -0
- QuantNodes/operators/__init__.py +90 -0
- QuantNodes/operators/_engine.py +108 -0
- QuantNodes/operators/composite.py +161 -0
- QuantNodes/operators/composite_dag.py +667 -0
- QuantNodes/operators/composite_dag_ops.py +343 -0
- QuantNodes/operators/composite_dag_pandas_ops.py +382 -0
- QuantNodes/operators/custom.py +408 -0
- QuantNodes/operators/facade.py +164 -0
- QuantNodes/operators/math.py +163 -0
- QuantNodes/operators/proxy.py +29 -0
- QuantNodes/operators/registry.py +144 -0
- QuantNodes/operators/section.py +99 -0
- QuantNodes/operators/talib.py +757 -0
- QuantNodes/operators/templates.py +95 -0
- QuantNodes/operators/time_series.py +136 -0
- QuantNodes/prompts/__init__.py +20 -0
- QuantNodes/prompts/backtest/__init__.py +12 -0
- QuantNodes/prompts/backtest/factor_based.py +86 -0
- QuantNodes/prompts/backtest/standard.py +73 -0
- QuantNodes/prompts/factor/__init__.py +14 -0
- QuantNodes/prompts/factor/correlation.py +77 -0
- QuantNodes/prompts/factor/group_backtest.py +86 -0
- QuantNodes/prompts/factor/ic_analysis.py +91 -0
- QuantNodes/prompts/strategy/__init__.py +18 -0
- QuantNodes/prompts/strategy/market_neutral.py +96 -0
- QuantNodes/prompts/strategy/mean_reversion.py +107 -0
- QuantNodes/prompts/strategy/momentum.py +160 -0
- QuantNodes/prompts/strategy/pairs_trading.py +107 -0
- QuantNodes/prompts/strategy/trend_following.py +96 -0
- QuantNodes/research/README.md +106 -0
- QuantNodes/research/__init__.py +154 -0
- QuantNodes/research/_legacy_3c/__init__.py +61 -0
- QuantNodes/research/_legacy_3c/auto_researcher.py +289 -0
- QuantNodes/research/_legacy_3c/factor_evaluator.py +560 -0
- QuantNodes/research/_legacy_3c/factor_miner.py +318 -0
- QuantNodes/research/_legacy_3c/mcts_search.py +324 -0
- QuantNodes/research/factor_test/__init__.py +25 -0
- QuantNodes/research/factor_test/config.py +184 -0
- QuantNodes/research/factor_test/config_builder.py +276 -0
- QuantNodes/research/factor_test/e2e/data_prep.py +163 -0
- QuantNodes/research/factor_test/e2e/run_evolution_e2e.py +309 -0
- QuantNodes/research/factor_test/evolution_adapter.py +231 -0
- QuantNodes/research/factor_test/feedback_wrapper.py +102 -0
- QuantNodes/research/factor_test/ifind_db/__init__.py +7 -0
- QuantNodes/research/factor_test/ifind_db/fetcher.py +224 -0
- QuantNodes/research/factor_test/ifind_db/ifind_database.py +689 -0
- QuantNodes/research/factor_test/nodes/__init__.py +1 -0
- QuantNodes/research/factor_test/nodes/_base.py +91 -0
- QuantNodes/research/factor_test/nodes/adjust_date_node.py +48 -0
- QuantNodes/research/factor_test/nodes/configs.py +240 -0
- QuantNodes/research/factor_test/nodes/factor_neutralize_node.py +87 -0
- QuantNodes/research/factor_test/nodes/factor_preprocess_node.py +222 -0
- QuantNodes/research/factor_test/nodes/factor_score_node.py +141 -0
- QuantNodes/research/factor_test/nodes/factor_test_report_node.py +153 -0
- QuantNodes/research/factor_test/nodes/group_analyzer_node.py +317 -0
- QuantNodes/research/factor_test/nodes/ic_analyzer_node.py +112 -0
- QuantNodes/research/factor_test/nodes/load_data_node.py +100 -0
- QuantNodes/research/factor_test/nodes/long_short_node.py +93 -0
- QuantNodes/research/factor_test/nodes/neutralizers.py +222 -0
- QuantNodes/research/factor_test/nodes/preprocess_strategies.py +277 -0
- QuantNodes/research/factor_test/nodes/risk_correlation_node.py +112 -0
- QuantNodes/research/factor_test/nodes/sample_pool_filter_node.py +110 -0
- QuantNodes/research/factor_test/nodes/tradability_filter_node.py +92 -0
- QuantNodes/research/factor_test/pipeline_runner.py +305 -0
- QuantNodes/research/factor_test/pipeline_spec.py +216 -0
- QuantNodes/research/factor_test/utils/__init__.py +26 -0
- QuantNodes/research/factor_test/utils/constants.py +86 -0
- QuantNodes/research/factor_test/utils/data_loader.py +141 -0
- QuantNodes/research/factor_test/utils/date_utils.py +232 -0
- QuantNodes/research/factor_test/utils/file_loaders.py +150 -0
- QuantNodes/research/factor_test/utils/labels.py +37 -0
- QuantNodes/research/factor_test/utils/metrics_extractor.py +55 -0
- QuantNodes/research/factor_test/utils/performance_metrics.py +175 -0
- QuantNodes/research/factor_test/utils/safe_load.py +106 -0
- QuantNodes/research/quant_alpha/CHANGELOG.md +80 -0
- QuantNodes/research/quant_alpha/README.md +142 -0
- QuantNodes/research/quant_alpha/__init__.py +45 -0
- QuantNodes/research/quant_alpha/adapters/__init__.py +99 -0
- QuantNodes/research/quant_alpha/adapters/calculator.py +503 -0
- QuantNodes/research/quant_alpha/adapters/expression.py +387 -0
- QuantNodes/research/quant_alpha/alpha101_design/__init__.py +50 -0
- QuantNodes/research/quant_alpha/alpha101_design/few_shot_examples.py +243 -0
- QuantNodes/research/quant_alpha/alpha101_design/philosophy.py +474 -0
- QuantNodes/research/quant_alpha/alpha158_design/__init__.py +63 -0
- QuantNodes/research/quant_alpha/alpha158_design/few_shot_examples.py +219 -0
- QuantNodes/research/quant_alpha/alpha158_design/philosophy.py +240 -0
- QuantNodes/research/quant_alpha/evaluation/__init__.py +47 -0
- QuantNodes/research/quant_alpha/evaluation/baselines/__init__.py +8 -0
- QuantNodes/research/quant_alpha/evaluation/baselines/g1_handcrafted.py +135 -0
- QuantNodes/research/quant_alpha/evaluation/baselines/g2_llm_only.py +269 -0
- QuantNodes/research/quant_alpha/evaluation/baselines/g3_alpha_gpt.py +152 -0
- QuantNodes/research/quant_alpha/evaluation/clickhouse_data_loader.py +227 -0
- QuantNodes/research/quant_alpha/evaluation/contracts.py +376 -0
- QuantNodes/research/quant_alpha/evaluation/evaluators/__init__.py +6 -0
- QuantNodes/research/quant_alpha/evaluation/evaluators/polars_evaluator.py +545 -0
- QuantNodes/research/quant_alpha/evaluation/mock_data_loader.py +226 -0
- QuantNodes/research/quant_alpha/evaluation/runner.py +243 -0
- QuantNodes/research/quant_alpha/llm/__init__.py +38 -0
- QuantNodes/research/quant_alpha/llm/parser.py +681 -0
- QuantNodes/research/quant_alpha/logic_driven_pipeline.py +411 -0
- QuantNodes/research/quant_alpha/logic_mining/__init__.py +74 -0
- QuantNodes/research/quant_alpha/logic_mining/compiler.py +457 -0
- QuantNodes/research/quant_alpha/logic_mining/generator.py +366 -0
- QuantNodes/research/quant_alpha/logic_mining/models.py +252 -0
- QuantNodes/research/quant_alpha/logic_mining/parser.py +287 -0
- QuantNodes/research/quant_alpha/logic_mining/pipelines.py +297 -0
- QuantNodes/research/quant_alpha/logic_mining/sources.py +149 -0
- QuantNodes/research/quant_alpha/mcts/__init__.py +66 -0
- QuantNodes/research/quant_alpha/mcts/cache.py +262 -0
- QuantNodes/research/quant_alpha/mcts/extension_ops.py +320 -0
- QuantNodes/research/quant_alpha/mcts/feedback.py +825 -0
- QuantNodes/research/quant_alpha/mcts/op_prior.py +180 -0
- QuantNodes/research/quant_alpha/mcts/search.py +540 -0
- QuantNodes/research/quant_alpha/mcts/tree.py +201 -0
- QuantNodes/research/quant_alpha/operator_vocab/__init__.py +50 -0
- QuantNodes/research/quant_alpha/operator_vocab/config.py +54 -0
- QuantNodes/research/quant_alpha/operator_vocab/metadata.py +263 -0
- QuantNodes/research/quant_alpha/operator_vocab/vocabulary.py +481 -0
- QuantNodes/research/quant_alpha/pipeline.py +1027 -0
- QuantNodes/research/quant_alpha/types/__init__.py +27 -0
- QuantNodes/research/quant_alpha/types/constants.py +28 -0
- QuantNodes/research/quant_alpha/types/state.py +205 -0
- QuantNodes/research/quant_alpha/workflow/__init__.py +32 -0
- QuantNodes/research/quant_alpha/workflow/alpha_gpt.py +911 -0
- QuantNodes/research/quant_alpha/workflow/alpha_logics.py +416 -0
- QuantNodes/research/quant_alpha/workflow/state.py +27 -0
- QuantNodes/research/report_reproducer.py +485 -0
- QuantNodes/research/wiki.py +1155 -0
- QuantNodes/symbolic/__init__.py +51 -0
- QuantNodes/symbolic/compiler.py +113 -0
- QuantNodes/symbolic/dialect.py +260 -0
- QuantNodes/symbolic/executor.py +147 -0
- QuantNodes/symbolic/expression.py +234 -0
- QuantNodes/symbolic/functions.py +433 -0
- QuantNodes/symbolic/optimizer.py +165 -0
- QuantNodes/ui_node/__init__.py +30 -0
- QuantNodes/ui_node/base.py +222 -0
- quantnodes-3.0.0.dist-info/METADATA +463 -0
- quantnodes-3.0.0.dist-info/RECORD +399 -0
- quantnodes-3.0.0.dist-info/WHEEL +5 -0
- quantnodes-3.0.0.dist-info/entry_points.txt +24 -0
- quantnodes-3.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,757 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""
|
|
3
|
+
TA-Lib 算子(代理层)
|
|
4
|
+
|
|
5
|
+
本模块将 factor_functions/talib_ops.py 中的注册算子包装为类接口。
|
|
6
|
+
TA-Lib 算子通过 map_batches 桥接 Polars ↔ NumPy。
|
|
7
|
+
|
|
8
|
+
注意:本模块为代理层,实际实现位于 factor_functions/talib_ops.py。
|
|
9
|
+
|
|
10
|
+
覆盖指标:
|
|
11
|
+
- 趋势/重叠: SMA, EMA, DEMA, TEMA, WMA, KAMA, T3, BBANDS, ...
|
|
12
|
+
- 动量: RSI, MACD, STOCH, CCI, WILLR, MFI, ROC, MOM, ADX, ...
|
|
13
|
+
- 波动率: ATR, NATR, TRANGE
|
|
14
|
+
- 成交量: AD, ADOSC, OBV
|
|
15
|
+
- K线形态: CDL_DOJI, CDL_HAMMER, CDL_ENGULFING, ... (60+)
|
|
16
|
+
- 价格变换: AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE
|
|
17
|
+
- 统计函数: BETA, CORREL, LINEARREG, STDDEV, ...
|
|
18
|
+
|
|
19
|
+
Usage:
|
|
20
|
+
from QuantNodes.operators.talib import TaLibOperators
|
|
21
|
+
result = TaLibOperators.sma(pl.col("close"), timeperiod=20)
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
from typing import TYPE_CHECKING, Union, Tuple
|
|
27
|
+
|
|
28
|
+
from polars import Expr
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if TYPE_CHECKING:
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class TaLibOperators:
|
|
38
|
+
"""TA-Lib 算子代理层"""
|
|
39
|
+
|
|
40
|
+
@staticmethod
|
|
41
|
+
def sma(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
42
|
+
"""简单移动平均线 (Simple Moving Average)"""
|
|
43
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
44
|
+
return talib_ops.talib_sma(expr, timeperiod=timeperiod)
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def ema(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
48
|
+
"""指数移动平均线 (Exponential Moving Average)"""
|
|
49
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
50
|
+
return talib_ops.talib_ema(expr, timeperiod=timeperiod)
|
|
51
|
+
|
|
52
|
+
@staticmethod
|
|
53
|
+
def wma(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
54
|
+
"""加权移动平均线 (Weighted Moving Average)"""
|
|
55
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
56
|
+
return talib_ops.talib_wma(expr, timeperiod=timeperiod)
|
|
57
|
+
|
|
58
|
+
@staticmethod
|
|
59
|
+
def dema(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
60
|
+
"""双重指数移动平均线 (Double Exponential Moving Average)"""
|
|
61
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
62
|
+
return talib_ops.talib_dema(expr, timeperiod=timeperiod)
|
|
63
|
+
|
|
64
|
+
@staticmethod
|
|
65
|
+
def tema(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
66
|
+
"""三重指数移动平均线 (Triple Exponential Moving Average)"""
|
|
67
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
68
|
+
return talib_ops.talib_tema(expr, timeperiod=timeperiod)
|
|
69
|
+
|
|
70
|
+
@staticmethod
|
|
71
|
+
def trima(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
72
|
+
"""三角移动平均线 (Triangular Moving Average)"""
|
|
73
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
74
|
+
return talib_ops.talib_trima(expr, timeperiod=timeperiod)
|
|
75
|
+
|
|
76
|
+
@staticmethod
|
|
77
|
+
def kama(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
78
|
+
"""考夫曼自适应移动平均线 (Kaufman Adaptive Moving Average)"""
|
|
79
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
80
|
+
return talib_ops.talib_kama(expr, timeperiod=timeperiod)
|
|
81
|
+
|
|
82
|
+
@staticmethod
|
|
83
|
+
def t3(expr: Union[Expr, str], timeperiod: int = 5, vfactor: float = 0.7) -> Expr:
|
|
84
|
+
"""T3 移动平均线 (Triple Exponential Moving Average with volume factor)"""
|
|
85
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
86
|
+
return talib_ops.talib_t3(expr, timeperiod=timeperiod, vfactor=vfactor)
|
|
87
|
+
|
|
88
|
+
@staticmethod
|
|
89
|
+
def ht_trendline(expr: Union[Expr, str]) -> Expr:
|
|
90
|
+
"""希尔伯特变换趋势线 (Hilbert Transform Trendline)"""
|
|
91
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
92
|
+
return talib_ops.talib_ht_trendline(expr)
|
|
93
|
+
|
|
94
|
+
@staticmethod
|
|
95
|
+
def mama(expr: Union[Expr, str], fastlimit: float = 0.5, slowlimit: float = 0.05) -> Expr:
|
|
96
|
+
"""MAMA 移动平均 (MESA Adaptive Moving Average)"""
|
|
97
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
98
|
+
return talib_ops.talib_mama(expr, fastlimit=fastlimit, slowlimit=slowlimit)
|
|
99
|
+
|
|
100
|
+
@staticmethod
|
|
101
|
+
def mavp(expr: Union[Expr, str], periods: Union[Expr, str], minperiod: int = 2, maxperiod: int = 30) -> Expr:
|
|
102
|
+
"""移动平均变动周期 (MA with Variable Period)"""
|
|
103
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
104
|
+
return talib_ops.talib_mavp(expr, periods, minperiod=minperiod, maxperiod=maxperiod)
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
def midpoint(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
108
|
+
"""价格中点 (Midpoint over period)"""
|
|
109
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
110
|
+
return talib_ops.talib_midpoint(expr, timeperiod=timeperiod)
|
|
111
|
+
|
|
112
|
+
@staticmethod
|
|
113
|
+
def midprice(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
114
|
+
"""中间价格 (Midpoint Price over period)"""
|
|
115
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
116
|
+
return talib_ops.talib_midprice(expr, timeperiod=timeperiod)
|
|
117
|
+
|
|
118
|
+
@staticmethod
|
|
119
|
+
def sar(expr: Union[Expr, str], acceleration: float = 0.02, maximum: float = 0.2) -> Expr:
|
|
120
|
+
"""抛物线 SAR"""
|
|
121
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
122
|
+
return talib_ops.talib_sar(expr, acceleration=acceleration, maximum=maximum)
|
|
123
|
+
|
|
124
|
+
@staticmethod
|
|
125
|
+
def ma(expr: Union[Expr, str], timeperiod: int = 30, matype: int = 0) -> Expr:
|
|
126
|
+
"""通用移动平均线 (Moving Average)"""
|
|
127
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
128
|
+
return talib_ops.talib_ma(expr, timeperiod=timeperiod, matype=matype)
|
|
129
|
+
|
|
130
|
+
@staticmethod
|
|
131
|
+
def bbands(expr: Union[Expr, str], timeperiod: int = 5, nbdevup: float = 2.0,
|
|
132
|
+
nbdevdn: float = 2.0, matype: int = 0) -> Tuple[Expr, Expr, Expr]:
|
|
133
|
+
"""布林带 — 返回 (upper, middle, lower)"""
|
|
134
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
135
|
+
return talib_ops.talib_bbands(expr, timeperiod=timeperiod, nbdevup=nbdevup, nbdevdn=nbdevdn, matype=matype)
|
|
136
|
+
|
|
137
|
+
@staticmethod
|
|
138
|
+
def bbands_upper(expr: Union[Expr, str], timeperiod: int = 5, nbdevup: float = 2.0,
|
|
139
|
+
nbdevdn: float = 2.0, matype: int = 0) -> Expr:
|
|
140
|
+
"""布林带上轨"""
|
|
141
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
142
|
+
return talib_ops.talib_bbands_upper(expr, timeperiod=timeperiod, nbdevup=nbdevup, nbdevdn=nbdevdn, matype=matype)
|
|
143
|
+
|
|
144
|
+
@staticmethod
|
|
145
|
+
def bbands_middle(expr: Union[Expr, str], timeperiod: int = 5, nbdevup: float = 2.0,
|
|
146
|
+
nbdevdn: float = 2.0, matype: int = 0) -> Expr:
|
|
147
|
+
"""布林带中轨"""
|
|
148
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
149
|
+
return talib_ops.talib_bbands_middle(expr, timeperiod=timeperiod, nbdevup=nbdevup, nbdevdn=nbdevdn, matype=matype)
|
|
150
|
+
|
|
151
|
+
@staticmethod
|
|
152
|
+
def bbands_lower(expr: Union[Expr, str], timeperiod: int = 5, nbdevup: float = 2.0,
|
|
153
|
+
nbdevdn: float = 2.0, matype: int = 0) -> Expr:
|
|
154
|
+
"""布林带下轨"""
|
|
155
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
156
|
+
return talib_ops.talib_bbands_lower(expr, timeperiod=timeperiod, nbdevup=nbdevup, nbdevdn=nbdevdn, matype=matype)
|
|
157
|
+
|
|
158
|
+
@staticmethod
|
|
159
|
+
def rsi(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
160
|
+
"""相对强弱指标 (Relative Strength Index)"""
|
|
161
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
162
|
+
return talib_ops.talib_rsi(expr, timeperiod=timeperiod)
|
|
163
|
+
|
|
164
|
+
@staticmethod
|
|
165
|
+
def macd(expr: Union[Expr, str], fastperiod: int = 12, slowperiod: int = 26,
|
|
166
|
+
signalperiod: int = 9) -> Tuple[Expr, Expr, Expr]:
|
|
167
|
+
"""MACD — 返回 (macd_line, signal_line, histogram)"""
|
|
168
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
169
|
+
return talib_ops.talib_macd(expr, fastperiod=fastperiod, slowperiod=slowperiod, signalperiod=signalperiod)
|
|
170
|
+
|
|
171
|
+
@staticmethod
|
|
172
|
+
def macd_line(expr: Union[Expr, str], fastperiod: int = 12, slowperiod: int = 26,
|
|
173
|
+
signalperiod: int = 9) -> Expr:
|
|
174
|
+
"""MACD 线"""
|
|
175
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
176
|
+
return talib_ops.talib_macd_line(expr, fastperiod=fastperiod, slowperiod=slowperiod, signalperiod=signalperiod)
|
|
177
|
+
|
|
178
|
+
@staticmethod
|
|
179
|
+
def macd_signal(expr: Union[Expr, str], fastperiod: int = 12, slowperiod: int = 26,
|
|
180
|
+
signalperiod: int = 9) -> Expr:
|
|
181
|
+
"""MACD 信号线"""
|
|
182
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
183
|
+
return talib_ops.talib_macd_signal(expr, fastperiod=fastperiod, slowperiod=slowperiod, signalperiod=signalperiod)
|
|
184
|
+
|
|
185
|
+
@staticmethod
|
|
186
|
+
def macd_hist(expr: Union[Expr, str], fastperiod: int = 12, slowperiod: int = 26,
|
|
187
|
+
signalperiod: int = 9) -> Expr:
|
|
188
|
+
"""MACD 柱状图 (histogram)"""
|
|
189
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
190
|
+
return talib_ops.talib_macd_hist(expr, fastperiod=fastperiod, slowperiod=slowperiod, signalperiod=signalperiod)
|
|
191
|
+
|
|
192
|
+
@staticmethod
|
|
193
|
+
def stoch(expr: Union[Expr, str], fastk_period: int = 5, slowk_period: int = 3,
|
|
194
|
+
slowk_matype: int = 0, slowd_period: int = 3, slowd_matype: int = 0) -> Tuple[Expr, Expr]:
|
|
195
|
+
"""随机指标 (Stochastic) — 返回 (slowk, slowd)"""
|
|
196
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
197
|
+
return talib_ops.talib_stoch(expr, fastk_period=fastk_period, slowk_period=slowk_period,
|
|
198
|
+
slowk_matype=slowk_matype, slowd_period=slowd_period, slowd_matype=slowd_matype)
|
|
199
|
+
|
|
200
|
+
@staticmethod
|
|
201
|
+
def stoch_k(expr: Union[Expr, str], fastk_period: int = 5, slowk_period: int = 3, slowk_matype: int = 0) -> Expr:
|
|
202
|
+
"""随机指标 K 线 (Stochastic %K)"""
|
|
203
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
204
|
+
return talib_ops.talib_stoch_k(expr, fastk_period=fastk_period, slowk_period=slowk_period, slowk_matype=slowk_matype)
|
|
205
|
+
|
|
206
|
+
@staticmethod
|
|
207
|
+
def stoch_d(expr: Union[Expr, str], fastk_period: int = 5, slowk_period: int = 3, slowk_matype: int = 0,
|
|
208
|
+
slowd_period: int = 3, slowd_matype: int = 0) -> Expr:
|
|
209
|
+
"""随机指标 D 线 (Stochastic %D)"""
|
|
210
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
211
|
+
return talib_ops.talib_stoch_d(expr, fastk_period=fastk_period, slowk_period=slowk_period, slowk_matype=slowk_matype,
|
|
212
|
+
slowd_period=slowd_period, slowd_matype=slowd_matype)
|
|
213
|
+
|
|
214
|
+
@staticmethod
|
|
215
|
+
def cci(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
216
|
+
"""商品通道指标 (Commodity Channel Index)"""
|
|
217
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
218
|
+
return talib_ops.talib_cci(expr, timeperiod=timeperiod)
|
|
219
|
+
|
|
220
|
+
@staticmethod
|
|
221
|
+
def willr(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
222
|
+
"""威廉指标 (Williams %R)"""
|
|
223
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
224
|
+
return talib_ops.talib_willr(expr, timeperiod=timeperiod)
|
|
225
|
+
|
|
226
|
+
@staticmethod
|
|
227
|
+
def mfi(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
228
|
+
"""资金流量指标 (Money Flow Index)"""
|
|
229
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
230
|
+
return talib_ops.talib_mfi(expr, timeperiod=timeperiod)
|
|
231
|
+
|
|
232
|
+
@staticmethod
|
|
233
|
+
def roc(expr: Union[Expr, str], timeperiod: int = 10) -> Expr:
|
|
234
|
+
"""变动率 (Rate of Change)"""
|
|
235
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
236
|
+
return talib_ops.talib_roc(expr, timeperiod=timeperiod)
|
|
237
|
+
|
|
238
|
+
@staticmethod
|
|
239
|
+
def rocp(expr: Union[Expr, str], timeperiod: int = 10) -> Expr:
|
|
240
|
+
"""变动率百分比 (Rate of Change Percentage)"""
|
|
241
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
242
|
+
return talib_ops.talib_rocp(expr, timeperiod=timeperiod)
|
|
243
|
+
|
|
244
|
+
@staticmethod
|
|
245
|
+
def rocr(expr: Union[Expr, str], timeperiod: int = 10) -> Expr:
|
|
246
|
+
"""变动率比率 (Rate of Change Ratio)"""
|
|
247
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
248
|
+
return talib_ops.talib_rocr(expr, timeperiod=timeperiod)
|
|
249
|
+
|
|
250
|
+
@staticmethod
|
|
251
|
+
def rocr100(expr: Union[Expr, str], timeperiod: int = 10) -> Expr:
|
|
252
|
+
"""变动率比率*100 (Rate of Change Ratio 100 scale)"""
|
|
253
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
254
|
+
return talib_ops.talib_rocr100(expr, timeperiod=timeperiod)
|
|
255
|
+
|
|
256
|
+
@staticmethod
|
|
257
|
+
def mom(expr: Union[Expr, str], timeperiod: int = 10) -> Expr:
|
|
258
|
+
"""动量 (Momentum)"""
|
|
259
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
260
|
+
return talib_ops.talib_mom(expr, timeperiod=timeperiod)
|
|
261
|
+
|
|
262
|
+
@staticmethod
|
|
263
|
+
def adx(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
264
|
+
"""平均趋向指标 (Average Directional Movement Index)"""
|
|
265
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
266
|
+
return talib_ops.talib_adx(expr, timeperiod=timeperiod)
|
|
267
|
+
|
|
268
|
+
@staticmethod
|
|
269
|
+
def adxr(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
270
|
+
"""平均趋向指标评估 (Average Directional Movement Index Rating)"""
|
|
271
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
272
|
+
return talib_ops.talib_adxr(expr, timeperiod=timeperiod)
|
|
273
|
+
|
|
274
|
+
@staticmethod
|
|
275
|
+
def apo(expr: Union[Expr, str], fastperiod: int = 12, slowperiod: int = 26, matype: int = 0) -> Expr:
|
|
276
|
+
"""绝对价格震荡 (Absolute Price Oscillator)"""
|
|
277
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
278
|
+
return talib_ops.talib_apo(expr, fastperiod=fastperiod, slowperiod=slowperiod, matype=matype)
|
|
279
|
+
|
|
280
|
+
@staticmethod
|
|
281
|
+
def ppo(expr: Union[Expr, str], fastperiod: int = 12, slowperiod: int = 26, matype: int = 0) -> Expr:
|
|
282
|
+
"""百分比价格震荡 (Percentage Price Oscillator)"""
|
|
283
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
284
|
+
return talib_ops.talib_ppo(expr, fastperiod=fastperiod, slowperiod=slowperiod, matype=matype)
|
|
285
|
+
|
|
286
|
+
@staticmethod
|
|
287
|
+
def cmo(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
288
|
+
"""钱德动量摆动指标 (Chande Momentum Oscillator)"""
|
|
289
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
290
|
+
return talib_ops.talib_cmo(expr, timeperiod=timeperiod)
|
|
291
|
+
|
|
292
|
+
@staticmethod
|
|
293
|
+
def dx(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
294
|
+
"""趋向指标 (Directional Movement Index)"""
|
|
295
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
296
|
+
return talib_ops.talib_dx(expr, timeperiod=timeperiod)
|
|
297
|
+
|
|
298
|
+
@staticmethod
|
|
299
|
+
def minus_di(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
300
|
+
"""负向指标 (Minus Directional Indicator)"""
|
|
301
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
302
|
+
return talib_ops.talib_minus_di(expr, timeperiod=timeperiod)
|
|
303
|
+
|
|
304
|
+
@staticmethod
|
|
305
|
+
def plus_di(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
306
|
+
"""正向指标 (Plus Directional Indicator)"""
|
|
307
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
308
|
+
return talib_ops.talib_plus_di(expr, timeperiod=timeperiod)
|
|
309
|
+
|
|
310
|
+
@staticmethod
|
|
311
|
+
def minus_dm(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
312
|
+
"""负向动量 (Minus Directional Movement)"""
|
|
313
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
314
|
+
return talib_ops.talib_minus_dm(expr, timeperiod=timeperiod)
|
|
315
|
+
|
|
316
|
+
@staticmethod
|
|
317
|
+
def plus_dm(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
318
|
+
"""正向动量 (Plus Directional Movement)"""
|
|
319
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
320
|
+
return talib_ops.talib_plus_dm(expr, timeperiod=timeperiod)
|
|
321
|
+
|
|
322
|
+
@staticmethod
|
|
323
|
+
def aroon(expr: Union[Expr, str], timeperiod: int = 14) -> Tuple[Expr, Expr]:
|
|
324
|
+
"""阿隆指标 — 返回 (aroondown, aroonup)"""
|
|
325
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
326
|
+
return talib_ops.talib_aroon(expr, timeperiod=timeperiod)
|
|
327
|
+
|
|
328
|
+
@staticmethod
|
|
329
|
+
def aroondown(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
330
|
+
"""阿隆下降线"""
|
|
331
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
332
|
+
return talib_ops.talib_aroondown(expr, timeperiod=timeperiod)
|
|
333
|
+
|
|
334
|
+
@staticmethod
|
|
335
|
+
def aroonup(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
336
|
+
"""阿隆上升线"""
|
|
337
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
338
|
+
return talib_ops.talib_aroonup(expr, timeperiod=timeperiod)
|
|
339
|
+
|
|
340
|
+
@staticmethod
|
|
341
|
+
def aroonosc(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
342
|
+
"""阿隆振荡指标 (Aroon Oscillator)"""
|
|
343
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
344
|
+
return talib_ops.talib_aroonosc(expr, timeperiod=timeperiod)
|
|
345
|
+
|
|
346
|
+
@staticmethod
|
|
347
|
+
def bop(expr: Union[Expr, str]) -> Expr:
|
|
348
|
+
"""力量指标 (Balance of Power)"""
|
|
349
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
350
|
+
return talib_ops.talib_bop(expr)
|
|
351
|
+
|
|
352
|
+
@staticmethod
|
|
353
|
+
def trix(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
354
|
+
"""三重指数平滑变动率 (1-day Rate of Change of Triple Smooth EMA)"""
|
|
355
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
356
|
+
return talib_ops.talib_trix(expr, timeperiod=timeperiod)
|
|
357
|
+
|
|
358
|
+
@staticmethod
|
|
359
|
+
def ultosc(expr: Union[Expr, str], timeperiod1: int = 7, timeperiod2: int = 14, timeperiod3: int = 28) -> Expr:
|
|
360
|
+
"""终极振荡指标 (Ultimate Oscillator)"""
|
|
361
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
362
|
+
return talib_ops.talib_ultosc(expr, timeperiod1=timeperiod1, timeperiod2=timeperiod2, timeperiod3=timeperiod3)
|
|
363
|
+
|
|
364
|
+
@staticmethod
|
|
365
|
+
def stochf(expr: Union[Expr, str], fastk_period: int = 5, fastd_period: int = 3, fastd_matype: int = 0) -> Tuple[Expr, Expr]:
|
|
366
|
+
"""快速随机指标 — 返回 (fastk, fastd)"""
|
|
367
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
368
|
+
return talib_ops.talib_stochf(expr, fastk_period=fastk_period, fastd_period=fastd_period, fastd_matype=fastd_matype)
|
|
369
|
+
|
|
370
|
+
@staticmethod
|
|
371
|
+
def stochrsi(expr: Union[Expr, str], timeperiod: int = 14, fastk_period: int = 5, fastd_period: int = 3, fastd_matype: int = 0) -> Tuple[Expr, Expr]:
|
|
372
|
+
"""随机 RSI — 返回 (fastk, fastd)"""
|
|
373
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
374
|
+
return talib_ops.talib_stochrsi(expr, timeperiod=timeperiod, fastk_period=fastk_period, fastd_period=fastd_period, fastd_matype=fastd_matype)
|
|
375
|
+
|
|
376
|
+
@staticmethod
|
|
377
|
+
def stochrsi_k(expr: Union[Expr, str], timeperiod: int = 14, fastk_period: int = 5, fastd_period: int = 3, fastd_matype: int = 0) -> Expr:
|
|
378
|
+
"""随机 RSI %K"""
|
|
379
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
380
|
+
return talib_ops.talib_stochrsi_k(expr, timeperiod=timeperiod, fastk_period=fastk_period, fastd_period=fastd_period, fastd_matype=fastd_matype)
|
|
381
|
+
|
|
382
|
+
@staticmethod
|
|
383
|
+
def stochrsi_d(expr: Union[Expr, str], timeperiod: int = 14, fastk_period: int = 5, fastd_period: int = 3, fastd_matype: int = 0) -> Expr:
|
|
384
|
+
"""随机 RSI %D"""
|
|
385
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
386
|
+
return talib_ops.talib_stochrsi_d(expr, timeperiod=timeperiod, fastk_period=fastk_period, fastd_period=fastd_period, fastd_matype=fastd_matype)
|
|
387
|
+
|
|
388
|
+
@staticmethod
|
|
389
|
+
def macdext(expr: Union[Expr, str], fastperiod: int = 12, fastmatype: int = 0, slowperiod: int = 26, slowmatype: int = 0,
|
|
390
|
+
signalperiod: int = 9, signalmatype: int = 0) -> Tuple[Expr, Expr, Expr]:
|
|
391
|
+
"""扩展 MACD — 返回 (macd, signal, hist)"""
|
|
392
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
393
|
+
return talib_ops.talib_macdext(expr, fastperiod=fastperiod, fastmatype=fastmatype, slowperiod=slowperiod, slowmatype=slowmatype,
|
|
394
|
+
signalperiod=signalperiod, signalmatype=signalmatype)
|
|
395
|
+
|
|
396
|
+
@staticmethod
|
|
397
|
+
def macdfix(expr: Union[Expr, str], signalperiod: int = 9) -> Tuple[Expr, Expr, Expr]:
|
|
398
|
+
"""固定周期 MACD — 返回 (macd, signal, hist)"""
|
|
399
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
400
|
+
return talib_ops.talib_macdfix(expr, signalperiod=signalperiod)
|
|
401
|
+
|
|
402
|
+
@staticmethod
|
|
403
|
+
def atr(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
404
|
+
"""平均真实范围 (Average True Range)"""
|
|
405
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
406
|
+
return talib_ops.talib_atr(expr, timeperiod=timeperiod)
|
|
407
|
+
|
|
408
|
+
@staticmethod
|
|
409
|
+
def natr(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
410
|
+
"""归一化平均真实范围 (Normalized Average True Range)"""
|
|
411
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
412
|
+
return talib_ops.talib_natr(expr, timeperiod=timeperiod)
|
|
413
|
+
|
|
414
|
+
@staticmethod
|
|
415
|
+
def trange(expr: Union[Expr, str]) -> Expr:
|
|
416
|
+
"""真实范围 (True Range)"""
|
|
417
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
418
|
+
return talib_ops.talib_trange(expr)
|
|
419
|
+
|
|
420
|
+
@staticmethod
|
|
421
|
+
def ad(expr: Union[Expr, str]) -> Expr:
|
|
422
|
+
"""累积/派发线 (Accumulation/Distribution Line)"""
|
|
423
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
424
|
+
return talib_ops.talib_ad(expr)
|
|
425
|
+
|
|
426
|
+
@staticmethod
|
|
427
|
+
def adosc(expr: Union[Expr, str], fastperiod: int = 3, slowperiod: int = 10) -> Expr:
|
|
428
|
+
"""累积/派发震荡 (Chaikin A/D Oscillator)"""
|
|
429
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
430
|
+
return talib_ops.talib_adosc(expr, fastperiod=fastperiod, slowperiod=slowperiod)
|
|
431
|
+
|
|
432
|
+
@staticmethod
|
|
433
|
+
def obv(expr: Union[Expr, str]) -> Expr:
|
|
434
|
+
"""能量潮 (On Balance Volume)"""
|
|
435
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
436
|
+
return talib_ops.talib_obv(expr)
|
|
437
|
+
|
|
438
|
+
@staticmethod
|
|
439
|
+
def cdl_doji(expr: Union[Expr, str]) -> Expr:
|
|
440
|
+
"""十字星 (Doji)"""
|
|
441
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
442
|
+
return talib_ops.talib_cdl_doji(expr)
|
|
443
|
+
|
|
444
|
+
@staticmethod
|
|
445
|
+
def cdl_hammer(expr: Union[Expr, str]) -> Expr:
|
|
446
|
+
"""锤子线 (Hammer)"""
|
|
447
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
448
|
+
return talib_ops.talib_cdl_hammer(expr)
|
|
449
|
+
|
|
450
|
+
@staticmethod
|
|
451
|
+
def cdl_engulfing(expr: Union[Expr, str]) -> Expr:
|
|
452
|
+
"""吞没形态 (Engulfing Pattern)"""
|
|
453
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
454
|
+
return talib_ops.talib_cdl_engulfing(expr)
|
|
455
|
+
|
|
456
|
+
@staticmethod
|
|
457
|
+
def cdl_morningstar(expr: Union[Expr, str], penetration: float = 0.0) -> Expr:
|
|
458
|
+
"""晨星 (Morning Star)"""
|
|
459
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
460
|
+
return talib_ops.talib_cdl_morningstar(expr, penetration=penetration)
|
|
461
|
+
|
|
462
|
+
@staticmethod
|
|
463
|
+
def cdl_eveningstar(expr: Union[Expr, str], penetration: float = 0.0) -> Expr:
|
|
464
|
+
"""暮星 (Evening Star)"""
|
|
465
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
466
|
+
return talib_ops.talib_cdl_eveningstar(expr, penetration=penetration)
|
|
467
|
+
|
|
468
|
+
@staticmethod
|
|
469
|
+
def cdl_hangingman(expr: Union[Expr, str]) -> Expr:
|
|
470
|
+
"""上吊线 (Hanging Man)"""
|
|
471
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
472
|
+
return talib_ops.talib_cdl_hangingman(expr)
|
|
473
|
+
|
|
474
|
+
@staticmethod
|
|
475
|
+
def cdl_shootingstar(expr: Union[Expr, str]) -> Expr:
|
|
476
|
+
"""射击之星 (Shooting Star)"""
|
|
477
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
478
|
+
return talib_ops.talib_cdl_shootingstar(expr)
|
|
479
|
+
|
|
480
|
+
@staticmethod
|
|
481
|
+
def cdl_harami(expr: Union[Expr, str]) -> Expr:
|
|
482
|
+
"""孕线形态 (Harami Pattern)"""
|
|
483
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
484
|
+
return talib_ops.talib_cdl_harami(expr)
|
|
485
|
+
|
|
486
|
+
@staticmethod
|
|
487
|
+
def cdl_piercing(expr: Union[Expr, str]) -> Expr:
|
|
488
|
+
"""刺透形态 (Piercing Pattern)"""
|
|
489
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
490
|
+
return talib_ops.talib_cdl_piercing(expr)
|
|
491
|
+
|
|
492
|
+
@staticmethod
|
|
493
|
+
def cdl_darkcloudcover(expr: Union[Expr, str], penetration: float = 0.0) -> Expr:
|
|
494
|
+
"""乌云盖顶 (Dark Cloud Cover)"""
|
|
495
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
496
|
+
return talib_ops.talib_cdl_darkcloudcover(expr, penetration=penetration)
|
|
497
|
+
|
|
498
|
+
@staticmethod
|
|
499
|
+
def cdl_spinningtop(expr: Union[Expr, str]) -> Expr:
|
|
500
|
+
"""纺锤顶 (Spinning Top)"""
|
|
501
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
502
|
+
return talib_ops.talib_cdl_spinningtop(expr)
|
|
503
|
+
|
|
504
|
+
@staticmethod
|
|
505
|
+
def cdl_3whitesoldiers(expr: Union[Expr, str]) -> Expr:
|
|
506
|
+
"""三只白兵 (Three White Soldiers)"""
|
|
507
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
508
|
+
return talib_ops.talib_cdl_3whitesoldiers(expr)
|
|
509
|
+
|
|
510
|
+
@staticmethod
|
|
511
|
+
def cdl_3blackcrows(expr: Union[Expr, str]) -> Expr:
|
|
512
|
+
"""三只乌鸦 (Three Black Crows)"""
|
|
513
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
514
|
+
return talib_ops.talib_cdl_3blackcrows(expr)
|
|
515
|
+
|
|
516
|
+
@staticmethod
|
|
517
|
+
def avgprice(expr: Union[Expr, str]) -> Expr:
|
|
518
|
+
"""平均价格 (Average Price)"""
|
|
519
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
520
|
+
return talib_ops.talib_avgprice(expr)
|
|
521
|
+
|
|
522
|
+
@staticmethod
|
|
523
|
+
def medprice(expr: Union[Expr, str]) -> Expr:
|
|
524
|
+
"""中间价格 (Median Price)"""
|
|
525
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
526
|
+
return talib_ops.talib_medprice(expr)
|
|
527
|
+
|
|
528
|
+
@staticmethod
|
|
529
|
+
def typprice(expr: Union[Expr, str]) -> Expr:
|
|
530
|
+
"""典型价格 (Typical Price)"""
|
|
531
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
532
|
+
return talib_ops.talib_typprice(expr)
|
|
533
|
+
|
|
534
|
+
@staticmethod
|
|
535
|
+
def wclprice(expr: Union[Expr, str]) -> Expr:
|
|
536
|
+
"""加权收盘价 (Weighted Close Price)"""
|
|
537
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
538
|
+
return talib_ops.talib_wclprice(expr)
|
|
539
|
+
|
|
540
|
+
@staticmethod
|
|
541
|
+
def beta(expr: Union[Expr, str], timeperiod: int = 5) -> Expr:
|
|
542
|
+
"""Beta 系数"""
|
|
543
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
544
|
+
return talib_ops.talib_beta(expr, timeperiod=timeperiod)
|
|
545
|
+
|
|
546
|
+
@staticmethod
|
|
547
|
+
def correl(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
548
|
+
"""相关系数 (Pearson's Correlation Coefficient)"""
|
|
549
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
550
|
+
return talib_ops.talib_correl(expr, timeperiod=timeperiod)
|
|
551
|
+
|
|
552
|
+
@staticmethod
|
|
553
|
+
def linearreg(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
554
|
+
"""线性回归值 (Linear Regression)"""
|
|
555
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
556
|
+
return talib_ops.talib_linearreg(expr, timeperiod=timeperiod)
|
|
557
|
+
|
|
558
|
+
@staticmethod
|
|
559
|
+
def linearreg_angle(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
560
|
+
"""线性回归角度 (Linear Regression Angle)"""
|
|
561
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
562
|
+
return talib_ops.talib_linearreg_angle(expr, timeperiod=timeperiod)
|
|
563
|
+
|
|
564
|
+
@staticmethod
|
|
565
|
+
def linearreg_intercept(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
566
|
+
"""线性回归截距 (Linear Regression Intercept)"""
|
|
567
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
568
|
+
return talib_ops.talib_linearreg_intercept(expr, timeperiod=timeperiod)
|
|
569
|
+
|
|
570
|
+
@staticmethod
|
|
571
|
+
def linearreg_slope(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
572
|
+
"""线性回归斜率 (Linear Regression Slope)"""
|
|
573
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
574
|
+
return talib_ops.talib_linearreg_slope(expr, timeperiod=timeperiod)
|
|
575
|
+
|
|
576
|
+
@staticmethod
|
|
577
|
+
def stddev(expr: Union[Expr, str], timeperiod: int = 5, nbdev: int = 1) -> Expr:
|
|
578
|
+
"""标准差 (Standard Deviation)"""
|
|
579
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
580
|
+
return talib_ops.talib_stddev(expr, timeperiod=timeperiod, nbdev=nbdev)
|
|
581
|
+
|
|
582
|
+
@staticmethod
|
|
583
|
+
def tsf(expr: Union[Expr, str], timeperiod: int = 14) -> Expr:
|
|
584
|
+
"""时间序列预测 (Time Series Forecast)"""
|
|
585
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
586
|
+
return talib_ops.talib_tsf(expr, timeperiod=timeperiod)
|
|
587
|
+
|
|
588
|
+
@staticmethod
|
|
589
|
+
def var(expr: Union[Expr, str], timeperiod: int = 5, nbdev: int = 1) -> Expr:
|
|
590
|
+
"""方差 (Variance)"""
|
|
591
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
592
|
+
return talib_ops.talib_var(expr, timeperiod=timeperiod, nbdev=nbdev)
|
|
593
|
+
|
|
594
|
+
@staticmethod
|
|
595
|
+
def ht_dcperiod(expr: Union[Expr, str]) -> Expr:
|
|
596
|
+
"""希尔伯特变换主导周期 (Hilbert Transform Dominant Cycle Period)"""
|
|
597
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
598
|
+
return talib_ops.talib_ht_dcperiod(expr)
|
|
599
|
+
|
|
600
|
+
@staticmethod
|
|
601
|
+
def ht_dcphase(expr: Union[Expr, str]) -> Expr:
|
|
602
|
+
"""希尔伯特变换主导周期相位 (Hilbert Transform Dominant Cycle Phase)"""
|
|
603
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
604
|
+
return talib_ops.talib_ht_dcphase(expr)
|
|
605
|
+
|
|
606
|
+
@staticmethod
|
|
607
|
+
def ht_phasor(expr: Union[Expr, str]) -> Expr:
|
|
608
|
+
"""希尔伯特变换相位 (Hilbert Transform Phasor)"""
|
|
609
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
610
|
+
return talib_ops.talib_ht_phasor(expr)
|
|
611
|
+
|
|
612
|
+
@staticmethod
|
|
613
|
+
def ht_sine(expr: Union[Expr, str]) -> Expr:
|
|
614
|
+
"""希尔伯特变换正弦 (Hilbert Transform SineWave)"""
|
|
615
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
616
|
+
return talib_ops.talib_ht_sine(expr)
|
|
617
|
+
|
|
618
|
+
@staticmethod
|
|
619
|
+
def ht_trendmode(expr: Union[Expr, str]) -> Expr:
|
|
620
|
+
"""希尔伯特变换趋势模式 (Hilbert Transform Trend vs Cycle Mode)"""
|
|
621
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
622
|
+
return talib_ops.talib_ht_trendmode(expr)
|
|
623
|
+
|
|
624
|
+
@staticmethod
|
|
625
|
+
def acos(expr: Union[Expr, str]) -> Expr:
|
|
626
|
+
"""反余弦 (Inverse Cosine)"""
|
|
627
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
628
|
+
return talib_ops.talib_acos(expr)
|
|
629
|
+
|
|
630
|
+
@staticmethod
|
|
631
|
+
def asin(expr: Union[Expr, str]) -> Expr:
|
|
632
|
+
"""反正弦 (Inverse Sine)"""
|
|
633
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
634
|
+
return talib_ops.talib_asin(expr)
|
|
635
|
+
|
|
636
|
+
@staticmethod
|
|
637
|
+
def atan(expr: Union[Expr, str]) -> Expr:
|
|
638
|
+
"""反正切 (Inverse Tangent)"""
|
|
639
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
640
|
+
return talib_ops.talib_atan(expr)
|
|
641
|
+
|
|
642
|
+
@staticmethod
|
|
643
|
+
def cos(expr: Union[Expr, str]) -> Expr:
|
|
644
|
+
"""余弦 (Cosine)"""
|
|
645
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
646
|
+
return talib_ops.talib_cos(expr)
|
|
647
|
+
|
|
648
|
+
@staticmethod
|
|
649
|
+
def cosh(expr: Union[Expr, str]) -> Expr:
|
|
650
|
+
"""双曲余弦 (Hyperbolic Cosine)"""
|
|
651
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
652
|
+
return talib_ops.talib_cosh(expr)
|
|
653
|
+
|
|
654
|
+
@staticmethod
|
|
655
|
+
def sin(expr: Union[Expr, str]) -> Expr:
|
|
656
|
+
"""正弦 (Sine)"""
|
|
657
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
658
|
+
return talib_ops.talib_sin(expr)
|
|
659
|
+
|
|
660
|
+
@staticmethod
|
|
661
|
+
def sinh(expr: Union[Expr, str]) -> Expr:
|
|
662
|
+
"""双曲正弦 (Hyperbolic Sine)"""
|
|
663
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
664
|
+
return talib_ops.talib_sinh(expr)
|
|
665
|
+
|
|
666
|
+
@staticmethod
|
|
667
|
+
def sqrt(expr: Union[Expr, str]) -> Expr:
|
|
668
|
+
"""平方根 (Square Root)"""
|
|
669
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
670
|
+
return talib_ops.talib_sqrt(expr)
|
|
671
|
+
|
|
672
|
+
@staticmethod
|
|
673
|
+
def tan(expr: Union[Expr, str]) -> Expr:
|
|
674
|
+
"""正切 (Tangent)"""
|
|
675
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
676
|
+
return talib_ops.talib_tan(expr)
|
|
677
|
+
|
|
678
|
+
@staticmethod
|
|
679
|
+
def tanh(expr: Union[Expr, str]) -> Expr:
|
|
680
|
+
"""双曲正切 (Hyperbolic Tangent)"""
|
|
681
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
682
|
+
return talib_ops.talib_tanh(expr)
|
|
683
|
+
|
|
684
|
+
@staticmethod
|
|
685
|
+
def exp(expr: Union[Expr, str]) -> Expr:
|
|
686
|
+
"""指数函数 (Exponential)"""
|
|
687
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
688
|
+
return talib_ops.talib_exp(expr)
|
|
689
|
+
|
|
690
|
+
@staticmethod
|
|
691
|
+
def ln(expr: Union[Expr, str]) -> Expr:
|
|
692
|
+
"""自然对数 (Natural Log)"""
|
|
693
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
694
|
+
return talib_ops.talib_ln(expr)
|
|
695
|
+
|
|
696
|
+
@staticmethod
|
|
697
|
+
def log10(expr: Union[Expr, str]) -> Expr:
|
|
698
|
+
"""常用对数 (Log10)"""
|
|
699
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
700
|
+
return talib_ops.talib_log10(expr)
|
|
701
|
+
|
|
702
|
+
@staticmethod
|
|
703
|
+
def ceil(expr: Union[Expr, str]) -> Expr:
|
|
704
|
+
"""向上取整 (Ceiling)"""
|
|
705
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
706
|
+
return talib_ops.talib_ceil(expr)
|
|
707
|
+
|
|
708
|
+
@staticmethod
|
|
709
|
+
def floor(expr: Union[Expr, str]) -> Expr:
|
|
710
|
+
"""向下取整 (Floor)"""
|
|
711
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
712
|
+
return talib_ops.talib_floor(expr)
|
|
713
|
+
|
|
714
|
+
@staticmethod
|
|
715
|
+
def add(expr_a: Union[Expr, str], expr_b: Union[Expr, str]) -> Expr:
|
|
716
|
+
"""加法 (Add)"""
|
|
717
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
718
|
+
return talib_ops.talib_add(expr_a, expr_b)
|
|
719
|
+
|
|
720
|
+
@staticmethod
|
|
721
|
+
def sub(expr_a: Union[Expr, str], expr_b: Union[Expr, str]) -> Expr:
|
|
722
|
+
"""减法 (Subtract)"""
|
|
723
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
724
|
+
return talib_ops.talib_sub(expr_a, expr_b)
|
|
725
|
+
|
|
726
|
+
@staticmethod
|
|
727
|
+
def mult(expr_a: Union[Expr, str], expr_b: Union[Expr, str]) -> Expr:
|
|
728
|
+
"""乘法 (Multiply)"""
|
|
729
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
730
|
+
return talib_ops.talib_mult(expr_a, expr_b)
|
|
731
|
+
|
|
732
|
+
@staticmethod
|
|
733
|
+
def div(expr_a: Union[Expr, str], expr_b: Union[Expr, str]) -> Expr:
|
|
734
|
+
"""除法 (Divide)"""
|
|
735
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
736
|
+
return talib_ops.talib_div(expr_a, expr_b)
|
|
737
|
+
|
|
738
|
+
@staticmethod
|
|
739
|
+
def max(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
740
|
+
"""滚动最大值 (Rolling Maximum)"""
|
|
741
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
742
|
+
return talib_ops.talib_max(expr, timeperiod=timeperiod)
|
|
743
|
+
|
|
744
|
+
@staticmethod
|
|
745
|
+
def min(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
746
|
+
"""滚动最小值 (Rolling Minimum)"""
|
|
747
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
748
|
+
return talib_ops.talib_min(expr, timeperiod=timeperiod)
|
|
749
|
+
|
|
750
|
+
@staticmethod
|
|
751
|
+
def sum(expr: Union[Expr, str], timeperiod: int = 30) -> Expr:
|
|
752
|
+
"""滚动求和 (Rolling Sum)"""
|
|
753
|
+
from QuantNodes.factor_node.factor_functions import talib_ops
|
|
754
|
+
return talib_ops.talib_sum(expr, timeperiod=timeperiod)
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
talib_ops = TaLibOperators()
|