Pine script 真强度指示器拉伸

Pine script 真强度指示器拉伸,pine-script,Pine Script,我对编码世界还很陌生,我正试图在Tradingview中建立一个简单的策略 我只想建立一个基于真实实力指标的买卖策略。所以,每当“慢”线穿过信号线向上时,我就想买,当慢线穿过信号线向下时,我就想卖 有人能给我提供代码吗? 我有TSI指示器的代码,仅用于显示指示器,而不用于交易信号 非常感谢 创建一个新的Pinscript。选择真实强度指示器 稍加修改,脚本将如下所示: //@version=4 study("True Strength Indicator", shorttitle="TSI",

我对编码世界还很陌生,我正试图在Tradingview中建立一个简单的策略

我只想建立一个基于真实实力指标的买卖策略。所以,每当“慢”线穿过信号线向上时,我就想买,当慢线穿过信号线向下时,我就想卖

有人能给我提供代码吗? 我有TSI指示器的代码,仅用于显示指示器,而不用于交易信号


非常感谢

创建一个新的Pinscript。选择真实强度指示器 稍加修改,脚本将如下所示:

//@version=4
study("True Strength Indicator", shorttitle="TSI", format=format.price, precision=4)
long = input(title="Long Length", type=input.integer, defval=25)
short = input(title="Short Length", type=input.integer, defval=13)
signal = input(title="Signal Length", type=input.integer, defval=13)
price = close
double_smooth(src, long, short) =>
    fist_smooth = ema(src, long)
    ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)
tsi_ema = ema(tsi_value, signal)
plot(tsi_ema, color=#FF006E)
plot(tsi_value, color=#3BB3E4)
hline(0, title="Zero")
现在使用变量tsi_value和tsi_ema创建您自己的表达式

尝试白色或交叉