簡體   English   中英

更改 pine 腳本中的進入/退出文本和顏色

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM