Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tradingview widget - customize simple moving average and Exponential moving average lenght

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"
    }
like image 714
Dart Consultants Avatar asked Aug 26 '18 03:08

Dart Consultants


People also ask

How do I customize my Tradeview widget?

Customize Widget Once you've selected a widget, you will need to customize it (Click 'Get Widget' on TradingView). Configure the on-screen widget options within TradingView. Once you're done click 'Apply'.

How do you add multiple moving averages in TradingView?

Display up to 5 simple moving average on your chart. If you want to display less than 5, you can hide as much as you want in the indicator settings. If you prefer to use exponential moving average , you can find the same indicator with EMA on my profile page.


1 Answers

Here's the way to do it :

"studies": [
   {
     "id": "MAExp@tv-basicstudies",
     "version": 60,
     "inputs": {
       "length": 20
     }
   },
   ...
like image 85
Clément Letellier Avatar answered Nov 11 '22 00:11

Clément Letellier