Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

The separate button for add specific indicator and button for edit parameters of added indicator

Hello,
how can I create separate button for add specific indicator for example "SMA" , but not from indicator list, but from simple button in order to indicator was added quicker way as favorite indicator?
As well, how can I create separate button for quicker way to edit paramaters of this indicator?



Thank you

Paul
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi,
Welcome to our forum and thanks for contacting us with your question!

I think it's possible to achieve inside chart.events and when you updating indicators parameters, try to edit this example:
https://jsfiddle.net/r1eyvk02/

Here is an article on how to add a custom indicator, it looks useful.
https://www.highcharts.com/blog/tutoria ... al-charts/

Let me know how are you going with this.
Best regards.
Sebastian Hajdus
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi Sebastian,
thank you for your feedback.

To Add specific Indicator button:
Unfortunately, I didn't find the patch how to insert indicator as favorite one..because I did't find the class for specific indicator, in order to I could call it. Have each Indicators specific class? Is there solution how I can assing the class name for them?

To Edit specific Indicator button:
After added indicator, the indicator have own css id for its series for example indicator "SMA" have id "highcharts-sma-series", for calling the "Edit PopUp" of this idicator, could be use this identificator? How I could proceed it?

Thank you

Paul
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi,

We need to clarify a little, indicators, the next series that will depend on the second series, right?

Demo:
https://jsfiddle.net/BlackLabel/7tr1v0se/

So just adding a new series of indicators pinned to the button should work. Do you want it to look like this?

Feel free to ask any questions.
Best regards.
Sebastian Hajdus
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hello Sevatian,

The indicator series depend on main series (appl) as on your example.
I was added code below,but it doesn't work for me.

HTML

Code: Select all

<button type="button" id="button_rsi">Add RSI</button>

JS

Code: Select all

// BUTTON TO ADD INDICATOR RSI
$('#button_rsi').click(function(){
    chart.addSeries({    
      type: 'RSI',
      linkedTo: 'aapl',
    });
});

Thanks
Paul
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi,

Try to add as in the documentation, it should work, I prepared a demo for you.
https://api.highcharts.com/highstock/ch ... .addSeries

Demo:
https://jsfiddle.net/BlackLabel/7qhjspyv/

Feel free to ask any questions.
Best regards.
Sebastian Hajdus
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi Sebastian,
thank you for code and fiddle, adding specific indicator to the chart working with this code..perfect.

I would to add buttons to Legend, I found the way how to add it for visibility.
I would like to ad buttons as well for remove indicator and edit parameters of added indicator(after click will showup form appear), how I can achieve it?

jsFiddle
https://jsfiddle.net/PaulJaker/mrgk5s19/79/

Thank you.
Paul
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi,
Do you mean how to hook to these buttons in the legend (hide, remove and settings)?

I think you could try to get to the object, perform an operation on it, or access the stock-tools buttons which seems a bit more difficult task.

Best regards.
Sebastian Hajdus
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi Sebastian,
yes, some callback for already created popup.
I tried to get object, for indicator settings should be "chart.series[1].options.params", am I right ?
How I can perform operation on it?

Thanks.
Paul
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi,

As already chart.series[0].options, I don't have a params position in the object.
https://jsfiddle.net/BlackLabel/m8u67egp/

However, it seems to me that a good way is to use navigation.events.

This topic shows how to hook up custom the stock tools GUI, maybe it will be helpful.
https://github.com/highcharts/highchart ... -498249719
https://api.highcharts.com/highstock/navigation.events

Best regards.
Sebastian Hajdus
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi Sebatian,
thank you will check it.
Thank you so far.

Paul
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: The separate button for add specific indicator and button for edit parameters of added indicator

Hi,
​If you have further inquiries, you may reach out to me at any time.

Regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”