[英]Change entry/exit text and color in pine script
是否可以更改 pine 脚本中的进入和退出文本和颜色?
目前,它们是蓝色的入口和粉红色的出口。
谢谢
不,但您可以添加自己的标签并隐藏内置标签。
要禁用图表上的内置交易标签,只需 go 到 Settings -> Style 并取消选中“Trades on chart”选项。
请参见下面的示例:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius
//@version=5
strategy("My strategy", overlay=true, margin_long=100, margin_short=100)
long_color = input.color(color.green, "Long Color")
short_color = input.color(color.red, "Short Color")
text_color = input.color(color.white, "Text Color")
is_new_long = (strategy.position_size > 0) and (strategy.position_size > strategy.position_size[1])
is_new_short = (strategy.position_size < 0) and (strategy.position_size < strategy.position_size[1])
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)
plotshape(is_new_long, "Long", shape.labeldown, location.abovebar, long_color, 0, "Long", text_color)
plotshape(is_new_short, "Short", shape.labelup, location.belowbar, short_color, 0, "Short", text_color)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.