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 6575937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:26:55+00:00 2026-05-25T15:26:55+00:00

Are there any specific algorithms that will allow me to find the min and

  • 0

stock

Are there any specific algorithms that will allow me to find the min and max points in the picture above?

I have data in text format so I don’t need to find it in the picture. The problem with stocks is that they have so many local mins and maxes simple derivatives won’t work.

I am thinking of using digital filters (z domain), and smoothing out the graph, but I am still left with too many localized minimums and maximums.

I also tried to use a moving average as well to smooth out the graph, but again I have too many maxes and mins.

EDIT:

I read some of the comments and I just didn’t circle some of the minimums and and maximums by accident.

I think I came up with an algorithm that may work. First find the minimum and maximum points (High of the day and low of the day). Then draw three lines one from open to high or low whichever comes first then a line from low to high or high to low and finally to close. Then in each of these three regions find the point that is furthest points from the line as my high and low and then repeat loop.

  • 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-05-25T15:26:55+00:00Added an answer on May 25, 2026 at 3:26 pm

    I usually use a combination of Moving Average and Exponential Moving Average. It proved (empirically) to be well fitted for the task (enough for my needs, at least). The results are tuned with only two parameters. Here is a sample:

    enter image description here

    Edit

    In case it is useful for somebody, here is my Mathematica code:

    f[sym_] := Module[{l},
      (*get data*)
      l = FinancialData[sym, "Jan. 1, 2010"][[All, 2]];
      (*perform averages*)
      l1 = ExponentialMovingAverage[MovingAverage[l, 10], .2];
      (*calculate ma and min positions in the averaged list*)
      l2 = {#[[1]], l1[[#[[1]]]]} & /@ 
        MapIndexed[If[#1[[1]] < #1[[2]] > #1[[3]], #2, Sequence @@ {}] &, 
         Partition[l1, 3, 1]];
      l3 = {#[[1]], l1[[#[[1]]]]} & /@ 
        MapIndexed[If[#1[[1]] > #1[[2]] < #1[[3]], #2, Sequence @@ {}] &, 
         Partition[l1, 3, 1]];
      (*correlate with max and mins positions in the original list*)
      maxs = First /@ (Ordering[-l[[#[[1]] ;; #[[2]]]]] + #[[1]] - 
            1 & /@ ({4 + #[[1]] - 5, 4 + #[[1]] + 5} & /@ l2));
      mins = Last /@ (Ordering[-l[[#[[1]] ;; #[[2]]]]] + #[[1]] - 
            1 & /@ ({4 + #[[1]] - 5, 4 + #[[1]] + 5} & /@ l3));
      (*Show the plots*)
      Show[{
        ListPlot[l, Joined -> True, PlotRange -> All, 
         PlotLabel -> 
          Style[Framed[sym], 16, Blue, Background -> Lighter[Yellow]]],
        ListLinePlot[ExponentialMovingAverage[MovingAverage[l, 10], .2]], 
        ListPlot[{#, l[[#]]} & /@ maxs, 
         PlotStyle -> Directive[PointSize[Large], Red]],
        ListPlot[{#, l[[#]]} & /@ mins, 
         PlotStyle -> Directive[PointSize[Large], Black]]}, 
       ImageSize -> 400]
      ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any .NET-specific tools out there that can parse / access the elementary
I'm trying to find out if there is any way to elevate a specific
Are there any algorithms that you can continue hashing from a known hash digest?
Is there any way to direct C# to ignore NullReferenceException (or any specific exception
Any suggestions? Using visual studio in C#. Are there any specific tools to use
I am new to Swing. Are there any specific issues related to customizing the
Simply, are there any Java Developer specific Linux distros?
Is there any way to know if I'm compiling under a specific Microsoft Visual
Is there any way of determining whether or not a specific temp table has
Is there any way to get the custom attributes of a specific object I

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.