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

  • SEARCH
  • Home
  • 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 89237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:41:06+00:00 2026-05-10T22:41:06+00:00

What I want to do is take a certain stock pattern (defined as a

  • 0

What I want to do is take a certain stock pattern (defined as a series of x and y coordinates) and compare it against historical stock prices. If I find anything in the historical prices similar to that pattern I defined, I would like to return it as a match.

I’m not sure how to determine how similar two curved lines are. I did some research, and you can find the similarity of two straight lines (with linear regression), but I haven’t yet come across a good way to compare two curved lines.

My best approach right now is get several high and low points from the historical data range I’m looking at, find the slopes of the lines, and compare those to the slopes of the pattern I’m trying to match to see if they’re roughly the same.

Any better ideas? I’d love to hear them!

Edit: Thanks for the input! I considered the least squares approach before, but I wasn’t sure where to go with it. After the input I received though, I think computing the least squares of each line first to smooth out the data a little bit, then scaling and stretching the pattern like James suggested should get me what I’m looking for.

I plan on using this to identify certain technical flags in the stock to determine buy and sell signals. There are already sites out there that do this to some degree (such as stockfetcher), but of course I’d like to try it myself and see if I can do any better.

  • 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. 2026-05-10T22:41:07+00:00Added an answer on May 10, 2026 at 10:41 pm

    One of the problems is that curve fitting using non-linear functions is not always going to work for some of your patterns depending how complex they are. You could use quadratic or cubic or some other order of polynomials to get a more accurate result but it’s not going to work in all situations, particularly with any sharp changes in the data over time.

    Honestly I think a reasonable and relatively simple solution is to ‘scale’ and ‘stretch’ your pattern so that it occurs over the same range as the historical data. You can use interpolation for the x axis and multiplication plus an offset for the y-axis. After that just look at the mean of the squared differences at each point and if that is lower than a threshold value then you can consider it a match. It will require a bit of tweaking to achieve predictable results but I think it’s a nice approach that should allow you to define any sort of pattern without relying on regression producing a nicely fitted curve. Essentially it’s just an application of statistics. You could also look at standard deviations or variance for a more comprehensive approach.

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

Sidebar

Ask A Question

Stats

  • Questions 64k
  • Answers 64k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer As mentioned, you're removing the control from itself...that's not likely… May 11, 2026 at 10:52 am
  • added an answer Here is some pseudo-code to retrieve the following: If a… May 11, 2026 at 10:52 am
  • added an answer Use the flat=True construct of the django queryset: https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.values_list From… May 11, 2026 at 10:52 am

Related Questions

What I want to do is take a certain stock pattern (defined as a
What I want to do is to remove all accents and umlauts from a
What I want to do is set the focus to a specific control (specifically
What I want to do is the following: read in multiple line input from
What I want to do is scroll down the window when I expand elements
What I want to do is drawing a (large) terrain with OpenGL. So I
What I want to do is very simple but I'm trying to find the
What I want to do is to react only on specified root elements. For
What I want to do is be able to add a file to my
What I want to do is trigger a function from an extension/GM Script once

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.