是否可以弄清楚如何将输入设置分组到预设中,因此我不必在每个时间范围内继续更改指示器上的输入设置

发布于 2025-02-13 19:48:55 字数 634 浏览 0 评论 0原文

我使用Pinescript编写了买/出售指标,每个时间范围(移动平均长度,信号平滑,期间等)都有不同的值。基本上,我想为每个时间范围创建一个预设。类似的内容:

preset = input.string(title ='preset',defval ='normal',options = ['normal','敏感','非常敏感'])

if preset == 'Normal'
    length_ma1_normal := 50
    length_ma2_normal := 200
plot(?) 
if preset == 'Sensitive'
    length_ma1_normal := 50
    length_ma2_normal := 100
plot(?) 

我的买入/出售信号会根据EMA交叉触发,MACD等。假设我选择“正常”,我希望图表基于50/200 EMA,“敏感”触发21/50等。当我选择其他预设时,他们都应该只绘制每个预设的值。基本上,基于4个参数触发买卖信号,是否可以为每个预设绘制所有4个(每个预设的值不同)? 我正在寻找这样的事情:

I wrote a buy/sell indicator using PineScript and I have different values for each timeframe (moving average lengths, signal smoothing, period, etc). Basically, I wanna create a preset for each timeframe. Something like this:

preset = input.string(title='Preset', defval='Normal', options=['Normal', 'Sensitive', 'Very Sensitive'])

if preset == 'Normal'
    length_ma1_normal := 50
    length_ma2_normal := 200
plot(?) 
if preset == 'Sensitive'
    length_ma1_normal := 50
    length_ma2_normal := 100
plot(?) 

My buy/sell signals get triggered based on ema crossovers, macd, etc. Let's say I choose "Normal", I want the chart to plot labels based on 50/200 ema, "Sensitive" triggers 21/50 and so on. When I choose a different preset they all should plot only what the values for each preset are. Basically, the buy/sell signals are triggered based off 4 parameters and is it possible to plot all 4 (each preset has different values) for each preset?
I'm looking to do something like this:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文