Excel formula question.

Discussion in 'App Development' started by themickey, Oct 12, 2022.

  1. The formula will be straightforward. As you have seen, defining it is the difficult bit!

    For ease of auditing / unpicking / modifying later, keep those three or four formulae in separate columns and then add them up (or whatever operator as appropriate) rather than nesting them all in one unfathomable cell.
     
    #11     Oct 13, 2022
    themickey likes this.
  2. themickey

    themickey

    Ok, will try my best at explaining.
    Basic info, price moves in waves which are random in interval and height & depth.
    upload_2022-10-14_5-30-39.png

    I'm attempting to measure these waves on a spreadsheet on multiple stocks, so on a spreadsheet you'll gets peaks and troughs, once identified dotted all over the spreadsheet, they are all waving and cresting at different intervals.

    Old data is on LHS of spreadsheet, new data travelling toward the RHS.
    So far this morning, in the wee small hours, I have identified the Peaks and values, I've got thus far.

    upload_2022-10-14_5-40-4.png
    This is how my trial spreadsheet last panel (just working on Peaks atm) is looking so far until last close.
    As you will note, it's a large spreadsheet for 16 stocks I'm dummy trialling, I've arrived at column ~148 rows of data to achieve so fars results.
    I've checked the data and I'm getting accurate results on Peak dates and Peak heights.

    I'll just concentrate on Peaks atm, to attempt to simplify the process, the Troughs will be a straight forward inverse copy of formulas, so I'll leave that aside in the meantime.

    The next hurdle to overcome is create a table whereby Peaks are tabulated in a tidy little box showing just the stock codes and Peak values so that I can ascertain whether Peaks are rising or falling.

    Row #1 is Transaction dates
    Row #2 is column numbers, not part of the formulas.
    The "*" are obviously formulas where there is no Peak identified.
     
    Last edited: Oct 13, 2022
    #12     Oct 13, 2022
  3. SunTrader

    SunTrader

    Why do that?

    I just pulled down the formula window till it is big enough. Then move it back after I am done.
     
    #13     Oct 13, 2022
  4. SunTrader

    SunTrader

    I'm still lost as to what cell and what calculation are you trying to achieve?
     
    #14     Oct 13, 2022
  5. themickey

    themickey

    Well, already I've answered most of my own queries, how do you tabulate Peaks and Troughs and their previous timing.

    Next achievement is a standalone table to display the last two peaks and troughs with their values. Then I'm done. :)
    So I need a formula which identifies the last two values in each row.
     
    #15     Oct 13, 2022
  6. SunTrader

    SunTrader

    Done. :)
    !SPX EW daily.png
    But again I don't know what you mean by "identify" the last two peaks/troughs and their values?
     
    #16     Oct 13, 2022
  7. ondafringe

    ondafringe

    So every trading day, you add a new column to the right?

    What about the rows... why do you have 148 rows?

    And how/where does the "Series" work into the mix?

    Oh, I see you worked it out. Good! :)
     
    #17     Oct 13, 2022
  8. themickey

    themickey

    On a chart they are identified visually but human bias only sees things the brain wants to see.
    On a spreadsheet you see them as values, you know exactly date and size, it gets rid of bias and noise.

    I think I've mentioned this a number of times previously, for my way of trading, I prefer to look at numbers rather than charts, I can only view one chart at a time, in a spreadsheet I can view hundreds of stocks simultaneously and number crunch them into priorities/rankings.
     
    #18     Oct 13, 2022
  9. newwurldmn

    newwurldmn

    i think I actually had this question on my final exam for my algorithms class in college.

    Worksheet formulas can work if have them calculating right to left to create a dynamic programming answer. This is tricky as your data set is expanding but you need to see the latest point to know if you are in a new peak or not.

    best to do in vba (for excel).
     
    #19     Oct 13, 2022
    themickey likes this.
  10. themickey

    themickey

    Done automatically.

    First off, got to process raw data which includes weekend dates which need excluding.
    Then seperate data from dates.
    Then calculate moving averages as I use a 3MA to smooth the data.
    Then number crunch the peaks.
     
    #20     Oct 13, 2022