New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

How to plot 2 variables with one set forward 12 months

I believe there is a way to create a SharpChart with 2 variables that are plotted in different timeframes. As an example, you might want to superimpose the price of Lumber forwarded 12 months in the future against the current price of a Housing Index. Is there a way to do this? Thanks.

Best Answers

  • markdmarkd mod
    Answer ✓
    I think you would have to use the custom index feature for that, available with the PRO subscription level.

    I'm guessing you would download either the lumber or the housing data into a spreadsheet, forward the dates, then upload the resulting file as a custom index and display it with the other symbol.

    For more details, put "user defined index" (without the quotes) in the "Search Stockcharts.com" window on the Members page.
  • gordgord admin
    edited April 2015 Answer ✓
    I'm not sure there is a way to shift the price, but there is a way to shift a MA's both left or right. See the chartschool article below.

    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_averages

    An optional parameter can be added to specify which price field should be used in the calculations - “O” for the Open, “H” for the High, “L” for the Low, and “C” for the Close. A comma is used to separate parameters.

    Another optional parameter can be added to shift the moving averages to the left (past) or right (future). A negative number (-10) would shift the moving average to the left 10 periods. A positive number (10) would shift the moving average to the right 10 periods.

    Multiple moving averages can be overlaid the price plot by simply adding another overlay line to the workbench. StockCharts members can change the colors and style to differentiate between multiple moving averages. After selecting an indicator, open “Advanced Options” by clicking the little green triangle.

    “Advanced Options” can also be used to add a moving average overlay to other technical indicators like RSI, CCI, and Volume.


    Thus we could plot an index, make it invisible and plot a 1 period SMA of the index (a 1 period SMA is just the close), shifted left or right. I find on these longer term charts it helps to use a longer SMA say 4 to help smooth out the noise.

    Here's a 5 yr weekly chart of $HGX showing the SMA4 and below it the $LUMBER chart with SMA4 shifted 1yr (52 weeks) to the right.

    http://stockcharts.com/h-sc/ui?s=$HGX&p=W&yr=5&mn=0&dy=0&id=p54570489515




    PS: I see Markd has already given you the other option using the custom index upload feature.
  • ekwongekwong
    Answer ✓
    You can also set up a chart list and align the charts like this as well. Just saying...

Answers

  • Thanks for the feedback - several different answers that will all work
Sign In or Register to comment.