1
Follow
0
Followers
Le langage pine veut que le disque dur puisse écrire le pourcentage de fonds de compte de chaque unité suivante.
Comment écrire
Related Recommendations
Inventor Quant Workflow FAQ (Continuously Updated)Financial Magic Zone Global KOL RecruitmentFAQ Summary (Updating...)PINE Language Introductory Tutorial of FMZ QuantPrimary Tutorial of Strategy Writing with FMZ Quant Trading Platform (Must Read)Getting Started with FMZ Quant Trading Platform (Must Read)
Comment
All comments (2)
pine
//@version=5
strategy("Percent of Equity Order", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// 简单的均线交叉策略
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
// 如果均线交叉条件满足,则买入或卖出
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// 指定default_qty_type=strategy.percent_of_equity后,设置default_qty_value为百分比数量(0~100),1即1%。按照账户中的计价货币数量计算下单量
// 例如当前账户有10000USDT,设置1%下单,即使用100USDT规模的下单量下单(卖出时根据当前价格计算)。
2 years ago
您好,可以按照资产百分比下单,参考PINE语言文档:
https://www.fmz.com/bbs-topic/9315#strategy 中的default_qty_type参数。
2 years ago
- 1
