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 신호를 발동하고 소수 다중 헤드 신호를 발동하면 한 번 포지션을 열고, 소수 공백 신호를 발동하면 한 번 평점, 마틴과 비슷합니다. 그러나 리뷰를 작성하면 이렇게 작성하면 첫 번째 포지션을 발동 할 수 있습니다.

아래 그림의 지표, 예를 들어 녹색 지표 금강이 나의 longCondition 신호이고, 4개의 녹색 화살표 위치가 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
