tr8dr / tseries-patterns

trend / momentum and other patterns in financial timeseries
MIT License
229 stars 70 forks source link

Do Amplitude based Labels have Forward Looking Bias? #2

Closed jkravets1 closed 3 years ago

jkravets1 commented 4 years ago

I really like the amplitude labeler! Do the labels have forward-looking bias? Is it possible to use them in real time, or are they more for labeling the past once we know what happened? I backtested them and they seemed very accurate.

tr8dr commented 4 years ago

This is not an online indicator, I suppose I should clarify that in the documentation. It does determine the labels looking forward. Its use it primarily in identifying moves ex-post or for purposes of labeling for ML.

Running tick to tick the labeler would have a lag of Tinactive or minimum amplitude before transitioning label state. I do, however, use this labeler in live trading, not to directly predict current move, but to look backward identifying past moves. Recent past moves can be useful in predicting forward behavior.

jkravets1 commented 4 years ago

Thanks, that make sense.

flamby commented 4 years ago

So if i understood correctly, it has lookahead bias. if so, do you plan to implement one w/o lookahead bias to make it useful as a feature for ML prediction, like you do, in a sense, when using it in live trading? Or perhaps, what I'm suggesting does not make sense at all.

tr8dr commented 4 years ago

The labeler obtains its accuracy by evaluating with a forward view. It is not intended to be an online indicator. There is no online indicator that will be able to accurately label without lag short of knowing or being able to predict the future. If there was someone with a model that could predict the future accurately, then the market would be quite different, with all opportunities arbitraged out.

In terms of lag, you could, for example use a spline or MA construct to determine a smoothed view of prices and label accordingly. However any form of smoothing introduces lag in proportion to the degree of smoothing.

flamby commented 4 years ago

thanks for the clarification