TA, like catching a greased pig

Discussion in 'Technical Analysis' started by countryBoy641, May 27, 2021.

  1. traider

    traider

    I think you can use a higher degree polynomial to get a nicer fit.
     
    #11     May 28, 2021
  2. ph1l

    ph1l

    It's hard to overfit (model noise) on typical asset prices with a parabola and three cosine waves.

    If I used a few more cosines ...
    upload_2021-5-28_14-52-34.png
    Now there is a fit that would have made Jean-Baptiste Joseph Fourier proud!:)
     
    #12     May 28, 2021
  3. ph1l

    ph1l

    Yes, here is a least squares fit with a 9th degree polynomial.
    upload_2021-5-28_14-54-59.png
    Corn to the Moon!:)
     
    Last edited: May 28, 2021
    #13     May 28, 2021
  4. ph1l

    ph1l

    No. The models are more for timing by looking at predicted inflection points and not for predicting price targets.
     
    #14     May 28, 2021
  5. Nobert

    Nobert

    Global burritos consumption up by a factor of 10.
     
    #15     May 29, 2021
    murray t turtle likes this.
  6. virtusa

    virtusa

    And what's the use in trading of your calculations? Because to me that's the only thing that counts.
    Are you not always running behind the facts?
    Like this:
    Clipboard01.jpg

    But you impressed me with that math. :)
    @globalarbtrader , you can use this for your book too, just mention my name. :D
     
    Last edited: May 29, 2021
    #16     May 29, 2021
  7. ph1l

    ph1l

    That post is a tounge-in-cheek comment to "Would you mind if I used this as an example of overfitting in my next book?" The graph is a combination of a least-squares parabola and inverse Fourier Transform to get a very overfitted curve. My original CORN post presents fitted curves that have a parabola plus three cosine waves. In my opinion, those models do not overfit the CORN prices because they visually don't follow the prices very closely. Perhaps globalarbtrader or someone else can explain how these simple curves overfit?

    I tried to explain the philosophy of this here and here. The generated models try to capture a recent trend (parabola) and oscillations around the trend (cosine waves). Since the functions depend only on time, they can be extrapolated to find possible inflection points for times of trade entry and exit.
     
    #17     May 29, 2021
    virtusa likes this.
  8. traider

    traider

    What are the advantages vs a low pass filter like the moving average
     
    #18     May 30, 2021
  9. ph1l

    ph1l

    A function like
    Code:
    y = 16.7131156921387  -  0.0153137510642409 * x  +  0.000483304698718712 * x * x
        +  0.959539353847504 * cos(twopi / 63.4018692382697 * x  +  3.40450406074524)
        +  0.770700573921204 * cos(twopi / 43.3602527495009 * x  +  4.73570346832275)
        +  0.467519104480743 * cos(twopi / 34.7284220393245 * x  +  6.08380746841431) ;
    
    has y as the predicted price, and x is the number of bars (days) from the beginning of the input data.

    Since you know what time is in the future (e.g., two weeks from now is always 14 days), this makes it possible to predict future prices and the time(s) of the next price swing(s). An image from this post illustrates this:
    [​IMG]
    The two rightmost inflection points in the detrended curve are in the future relative to when the input data ended (after the mean line in the graph ends).

    You can't do that with a filter like a moving average because it uses prices as inputs, and you don't know future prices until they happen.

    FYI, the 9th degree polynomial fit above was intended as a joke because higher-order polynomials are known for creating extreme values.
     
    #19     May 30, 2021