英文:
Pine Script Strategy doesn't work with volume
问题
//@version=5
strategy("成交量测试脚本", overlay=true)
conditionForBuy = volume > volume[1]*2
if(conditionForBuy)
strategy.entry("买入", strategy.long)
英文:
//@version=5
strategy("Volume Test Script", overlay=true)
conditionForBuy = volume > volume[1]*2
if(conditionForBuy)
strategy.entry("buy", strategy.long)
I am testing a strategy with pine script on tradingview, but the strategy never buys when the volume condition fulfills, but when I change this to a study, it's able to plot where the volume doubles from previous bar.
答案1
得分: 1
噢,它可以买。只是从不卖,因为你没有相关的代码。你持有的是长仓。 使用 strategy.exit()
或 strategy.close()
来平仓。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论