Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:50:56+00:00 2026-06-05T22:50:56+00:00

TTR has some excellent TA indicators. Is there a package or function that calculates

  • 0

TTR has some excellent TA indicators. Is there a package or function that calculates and charts different types of Support and resistance levels? Preferably a probability distribution
for the likely support and resistance levels

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:50:57+00:00Added an answer on June 5, 2026 at 10:50 pm

    Here’s an example to follow up on my comment.

    Calculate pivots using monthly data. Each month, use the Support and Resistance calculated from the previous month’s data. (Of course, it doesn’t have to be monthly pivots with daily data. You could use daily pivots, and an intraday price series)

    library(quantmod)
    getSymbols("SPY", from="2010-05-01", to="2012-06-15")
    mSPY <- to.monthly(SPY, drop.time=TRUE)
    # pivots() is excluded from the TTR build because it uses quantmod functions,
    # but you can still get it from GitHub by running:
    #source("https://raw.githubusercontent.com/joshuaulrich/TTR/master/R/pivots.R")
    piv <- lag(pivots(mSPY, lagts=FALSE))
    #merge, and fill forward pivot values so that there is a value for each day
    dat <- cbind(SPY, piv)
    dat[, 7:11] <- na.locf(dat[, 7:11])
    chartSeries(OHLC(SPY), theme='white')
    addTA(dat$S1, on=1, col='lightblue')
    addTA(dat$S2, on=1, col='blue')
    addTA(dat$R1, on=1, col='pink')
    addTA(dat$R2, on=1, col='red')
    

    That will produce:

    enter image description here

    Donchian Channels could also be seen as support and resistance

    chartSeries(OHLC(SPY), theme='white')
    dc <- lag(DonchianChannel(cbind(Hi(SPY), Lo(SPY))))
    addTA(dc$low, on=1, col='blue')
    addTA(dc$high, on=1, col='red')
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the TTR package to generate stock indicators. However, the indicator functions
how to get two sided moving average that is a function that averages n
Possible Duplicate: Cannot install R-forge package using install.packages Has anyone gotten the latest version
I am using the great TTR package quite often these days. It really is
I've created a PHP script that reads from beanstalkd and processes the jobs. No
I have 11 lists of different length, imported into R as p1,p2,p3,...,p11. Now I
I'm typing for example: install.packages('TTR') output is: --- Please select a CRAN mirror for
Dear List, I am trying for technical analysis with R, using packages TTR, quantmod,
I can't seem to use TTR indicator functions direclty with period.apply() from XTS. Please
I have 507 tables with (pattern = human). Inside each table there are a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.