[英]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.