输入/搜索内容
入门
平台基础
编写策略
策略结构
编程语言
JavaScript
Python
Rust
My语言(麦语言)
PINE语言
Workflow工作流
策略参数
交互控件
策略前端
模板类库
内置库
界面文字中英文
API函数速查
开发工具
回测系统
进阶专题
数据与研究
扩展API接口

平台支持并兼容Trading View的PINE语言脚本。PINE语言用于编写可以回测和实盘交易的指标与策略,社区已有超过10万个公开的PINE脚本,可以直接借用来实现自己的交易想法,不必从零开始编写。

策略示例:超级趋势策略

pine
strategy("supertrend", overlay=true) [supertrend, direction] = ta.supertrend(input(5, "factor"), input.int(10, "atrPeriod")) plot(direction < 0 ? supertrend : na, "Up direction", color = color.green, style=plot.style_linebr) plot(direction > 0 ? supertrend : na, "Down direction", color = color.red, style=plot.style_linebr) if direction < 0 if supertrend > supertrend[2] strategy.entry("entry long", strategy.long) else if strategy.position_size < 0 strategy.close_all() else if direction > 0 if supertrend < supertrend[3] strategy.entry("entry short", strategy.short) else if strategy.position_size > 0 strategy.close_all()