0
Follow
0
Followers
strategy ((title = "多重シグナルを取得し,多重ポジションに入ります", pyramding = 5)
if longCondition and strategy.position_size <= 0
strategy.entry (("多開設", strategy.long, when = lowLong, amount = amount, comment = "多頭開設))
if strategy.position_size > 0 and lowShort
strategy.close_all (("平多", comment = "多頭平仓"))
小小夢,このコードは,私の戦略実行コードである。私が実現したいのは,longCondition信号を触発し,小レベルの多頭信号を触発すると,一度のポジションを開くこと,そして小レベルの空頭信号を触発すると,一度の平仓,マーティンのようなものである。しかし,書き終えた時,この書き込みは,最初のポジションを開くことしか触発できないことが判明しました.

下の図のように,緑の線は,金叉が私のロングコンディションの信号で,緑の矢はlowLongの信号で,赤の矢はlowShortの信号です. 緑の矢はローショート信号で,緑の矢はローショート信号で,緑の矢はローショート信号です.
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)MyLanguage DocFMZ PINE Script DocNotes & Explanation of Futures Reverse Doubling Algorithm StrategySolutions to Obtaining Docker Http Request Message
Comment
All comments (3)
第一个问题,如果要忽略pyramding参数,可以把下单函数strategy.entry改成strategy.order,这个order函数就忽略加仓次数限制的。其它和entry函数一样。
strategy(title = "获取开多信号,进入多头仓位")
if longCondition and strategy.position_size >= 0
strategy.order("开多", strategy.long, when = lowLong, amount = amount, comment = "多头开仓")
if strategy.position_size > 0 and lowShort
strategy.close_all("平多", comment = "多头平仓")
这样看看行不行。
4 years ago
- 1
