简体   繁体   English

仅在蜡烛收盘时进行买卖

[英]Plot buy or sell only when candle closes

I am developing a pine script indicator for Tradingview, and I would like some help: is there any code or command to make my plotshape command appear only after the candle closes?我正在为 Tradingview 开发一个 pine 脚本指标,我需要一些帮助:是否有任何代码或命令可以让我的 plotshape 命令仅在蜡烛关闭后出现? This would avoid premeditated signals, which can vary before the candle closes, and end up triggering alerts that can change over the candle's time.这将避免预谋的信号,这些信号在蜡烛关闭之前可能会发生变化,并最终触发可能随着蜡烛时间而变化的警报。 Thanks!谢谢!

You can either use the historical operator with your condition and the shape will appear on the opening of the next new bar :您可以将历史运算符与您的条件一起使用,形状将出现在下一个新柱的开口处:

plotshape(my_condition[1])

or you can use barstate.isconfirmed along with your condition to have the shape rendered on it's own bar, but on the very last update of the bar或者您可以将barstate.isconfirmed与您的条件一起使用,以在其自己的栏上呈现形状,但在栏的最后一次更新时

plotshape(my_condition and barstate.isconfirmed)

暂无
暂无

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

相关问题 买入和卖出信号在情节方面因蜡烛而异 - Buy and Sell signals are differing by a candle with respect to plot Trading View Pine Script:如果蜡烛上已有买入入场,如何不在蜡烛上发送卖出信号? - Trading View Pine Script: How to NOT send sell signals on the candle if there is already a buy entry on this candle? 当我的买入条件满足直到我的卖出条件满足时,如何 plot 一条水平线? - How to plot a horizontal line when my buy condition met till my sell conditions met? 高于或低于 0 时的买入卖出条件和警报 - Buy sell conditions and alerts when it is above or below 0 如何在第一根蜡烛线下方的低点上方买入,在第一根蜡烛线上方的高点下方卖出 - How to buy on the first candle with a low above the lower boll band, sell on first candle with a high below upper boll band 只能在一根蜡烛上是 plot 吗? - Can it be plot only on one candle? Pinescript - 蜡烛关闭时背景颜色“重绘” - Pinescript - background color "repaints" when the candle closes 如果成交量大于成交量 20 且蜡烛在 EMA 9 收盘,则显示买入信号 - Show Buy signal if volume is greater than volume20 and candle closes on ema 9 当所有 3 条超级趋势线均为绿色/红色且仅显示一次信号时,如何添加买入/卖出信号? - How can I add a Buy / Sell Signal when all 3 Supertrend lines are green / red and only show the signal one time? 在当前蜡烛和最后一根蜡烛强劲时获得警报 - to get an alert when it's strong buy both on current candle and last candle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM