简体   繁体   English

Pine 脚本中的多头/空头策略

[英]Long/Short strategies in Pine script

What are strategy.long and strategy.short mean in pine script, what do they resemble in below code松树脚本中的 strategy.long 和 strategy.short 是什么意思,它们在下面的代码中是什么意思

strategy.entry("LONG", strategy.long, when = "some_condition")
strategy.close("LONG", when = "some_condition")

strategy.entry("SHORT", strategy.short, when = "some_condition")
strategy.close("SHORT", when = "some_condition")

When you're flat, it means that you have no position.当你持平时,这意味着你没有位置。 Position size = 0仓位大小 = 0

When you go long you buy expect the price to go up and make a profit.当您做多时,您会期望价格上涨并获利。 Your position size is positive.您的头寸规模为正数。 You close/sell your position so that yourposition size becomes zero or flat.您关闭/卖出您的头寸,以便您的头寸规模变为零或持平。

When you go short, you sell (expecting price to go down), hence your position size becomes negative.当您做空时,您卖出(预期价格下跌),因此您的头寸规模变为负数。 You buy back later so that your position size becomes zero or flat again.您稍后回购,以便您的头寸规模再次变为零或持平。

Hope that made sense.希望这是有道理的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 pine 脚本中以柱线开盘价输入多头/空头策略? - how to enter a strategy long/short at the bar open price in pine script? 同时进行多头和空头交易的 Pine Script 策略 - Pine Script Strategy with Long and Short trades at the same time Pine 脚本 - 如何为此 RSI 长空条件编码 - Pine script - How to code for this RSI Long short condition pine script如何统计多空交易的盈亏? - How to count long and short winning and losing trades in pine script? 在 Pine Script 策略中输入点差成本 - Enter the cost of the spread in the Pine Script strategies 我在 pine 脚本中遇到 (strategy.exit) 的问题。 它适用于长途电话但不适用于短途电话 - I am facing a problem with (strategy.exit) in pine script. it is working for the long call but not working for short calls Pine Script 版本 5 条件 1 适用,如果条件 2 适用,请检查条件 1 是否仍然存在并输入 Long 或 Short - Pine Script version 5 Condition 1 applies and if condition 2 applies check if condition 1 is still in places and enter Long or Short Pine Script Strategy Not Showing Short Position 关闭; 仅关闭多头头寸 - Pine Script Strategy Not Showing Short Position Closes; Only Closing Long Positions 如何在 Pine Script 中限制每个 session 的多头和空头条目的最大数量? - How in Pine Script can I limit the max number of long and short entry per session? 是否可以在松树脚本中创建一条扁平的短线? - Is it possible to create a flat short line in pine script?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM