是否可以弄清楚如何将输入设置分组到预设中,因此我不必在每个时间范围内继续更改指示器上的输入设置
我使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论