Navi for VS Code
Navi VS Code extension.
Features
- Syntax highlight.
- Syntax check.
- Code formatting.
- Code completion.
- Go to definition.
Grammar example
meta { title = "MACD", overlay = false }
@title_fast_length {
"zh-CN" = "短周期",
"zh-HK" = "短週期",
"en" = "Short cycle",
}
@title_slow_length {
"zh-CN" = "长周期",
"zh-HK" = "長週期",
"en" = "Long cycle",
}
@title_signal_length {
"zh-CN" = "移动平均周期",
"zh-HK" = "移動平均週期",
"en" = "Moving average cycle",
}
param {
@meta(title = @title_fast_length, range = 1..250)
fast_length = 12,
@meta(title = @title_slow_length, range = 1..250)
slow_length = 26,
@meta(title = @title_signal_length, range = 1..250)
signal_length = 26,
}
fast_ma = ta.sma(quote.close, fast_length, 1);
slow_ma = ta.sma(quote.close, slow_length, 1);
macd = fast_ma - slow_ma;
dea = ta.sma(macd, signal_length, 1);
dif = macd - dea;
plot(macd, title = "MACD", color = #yellow);
plot(dea, title = "DEA", color = #blue);
plot(dif, title = "DIF", color = quote.close > quote.open ? #up : #down, style = plotstyle.histogram);