Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting the same indicator twice. #18

Closed
shell123 opened this issue Oct 23, 2014 · 2 comments
Closed

Plotting the same indicator twice. #18

shell123 opened this issue Oct 23, 2014 · 2 comments
Labels

Comments

@shell123
Copy link

Hello,
Currently, I cannot plot the same indicator twice without renaming the indicator. If I want to plot two RSIs, I must name one rsi and the other rsi2. This is needed, for example, when people want to use say an RSI of length 14 and another of length 21.

It would be nice to be able to do this without messing around with renaming variables (especially when some person uses 5 or more of the same indicator for some reason).

Do you know of a current way to do this? And, if not, can this be implemented?

Thanks for everything!

@andredumas
Copy link
Owner

I'm not sure I understand the question correctly. There should be no problem doing something like this:

    var sma = techan.plot.sma()
            .xScale(x)
            .yScale(y);

    svg.select("g.sma.ma-0")
        .datum(techan.indicator.sma().period(10)(data))
        .call(sma);

    svg.select("g.sma.ma-1")
        .datum(techan.indicator.sma().period(20)(data))
        .call(sma);  // Reusing the same SMA. This is ok, we 
                     // are plotting on same x and y scales.

@andredumas
Copy link
Owner

I don't think this is an issue, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants