admin管理员组文章数量:1308040
I'm trying to add "Advanced Real Time chart" widget from tradinview. I'm able to add indicator Exponential moving average and Simple moving average. But it takes default 9 days length. I want to change that.
I tried as below but it does not work. Could somebody please help. Thanks a lot in advance.
widget = new TradingView.widget(
{
"width": 1200,
"height": 700,
"symbol": "NSE:DRREDDY",
"interval": "D",
"timezone": "Asia/Kolkata",
"theme": "Dark",
"style": "1",
"locale": "in",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"hide_side_toolbar": false,
"allow_symbol_change": true,
"details": true,
"studies_overrides": {
"moving average exponential.length": 20
},
"studies": [
"MAExp@tv-basicstudies"
],
"container_id": "tradingview_f6d89"
}
I'm trying to add "Advanced Real Time chart" widget from tradinview. I'm able to add indicator Exponential moving average and Simple moving average. But it takes default 9 days length. I want to change that.
I tried as below but it does not work. Could somebody please help. Thanks a lot in advance.
widget = new TradingView.widget(
{
"width": 1200,
"height": 700,
"symbol": "NSE:DRREDDY",
"interval": "D",
"timezone": "Asia/Kolkata",
"theme": "Dark",
"style": "1",
"locale": "in",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"hide_side_toolbar": false,
"allow_symbol_change": true,
"details": true,
"studies_overrides": {
"moving average exponential.length": 20
},
"studies": [
"MAExp@tv-basicstudies"
],
"container_id": "tradingview_f6d89"
}
Share
Improve this question
asked Aug 26, 2018 at 3:25
Dart ConsultantsDart Consultants
811 silver badge3 bronze badges
1
- Wele to SO. Please provide the full widget code, not only the settings and results vs expected output. Please remember that SO is not a code-writing service. – not2qubit Commented Oct 9, 2018 at 5:51
2 Answers
Reset to default 7Here's the way to do it :
"studies": [
{
"id": "MAExp@tv-basicstudies",
"version": 60,
"inputs": {
"length": 20
}
},
...
The code above takes EMA 20
ticks back on the current time frame (TF), so if you want days, you need to set TF to days
and change this value to 9
(or equivalently, set TF to hours and set EMA to 24*9
).
本文标签:
版权声明:本文标题:javascript - Tradingview widget - customize simple moving average and Exponential moving average lenght - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741833269a2400061.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论